Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
How can I make it so that a certain number of resources are deducted from a player on a specific day? Thanks in advance.
I don't know the script completely, but it can be done using the New_Day_Trigger. If this exists in any of the campaigns from "Tribes of the East", please remind me. Then, I might be able to help if I can.
...И справедливость я несу На острие меча.
Кампания "Искупление" - 15%
О кампании
"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру, и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!
I remember about the experience, but not about the resources.
I also wanted to create a StartCombat script in my map, but it's not popular – it's not used in either custom maps or Nival maps... I just replaced it. In your case, I don't even know how to replace it...
...И справедливость я несу На острие меча.
Кампания "Искупление" - 15%
О кампании
"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру, и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!
Here are many examples using this trigger:
https://www.google.ru/search?q=NEW_DAY_TRIGGER+forum.heroesworld.ru&oq=NEW_DAY_TRIGGER+forum.heroesworld.ru&aqs=chrome..69i57.2887j0j4&sourceid=chrome&es_sm=93&ie=UTF-8#q=NEW_DAY_TRIGGER+forum.heroesworld.ru&newwindow=1&filter=0
Here's how to change resources:
SetPlayerResource(nPlayerID, nResID, nCount)
Sets the current amount of resource nResID to nCount for player nPlayerID. Based on this function, a higher-level primitive is implemented in the /scripts/advmap-startup.lua file – void SetPlayerStartResource(nPlayerID, nResID, nCount), which distributes starting resources to the player depending on the difficulty level.
And here's how to find out the current amount of resources:
GetPlayerResource(nPlayerID, nResID)
Returns the current amount of resource nResID for player nPlayerID. Resource IDs are defined in /scripts/advmap-startup.lua and are as follows:
WOOD = 0
ORE = 1
MERCURY = 2
CRYSTAL = 3
SULFUR = 4
GEM = 5
GOLD = 6
Example: Add 10000 gold to the first player:
SetPlayerResource(1, GOLD, GetPlayerResource(1, GOLD) + 10000).
Hello, hello fellow experts in this thread! :)\n\nActually, I just started learning scripting today and decided to try my hand at something small.\n\nSo, there are two objects named cr1 and cr2. The idea is that when a hero touches the first one, they receive 10 units of sulfur, and when they touch the second one, they receive 10 gems.\n\nSo, here's the question: what's wrong here? :/\n
\nAnd yes, I would be very grateful to anyone who explains to me what parameters are actually passed to the function associated with the touch trigger:smile20:
The 'path' variable is not defined. The script should work if you add the following to the beginning:
path = GetMapDataPath()
You can also remove two extra do-end pairs, but that's just for aesthetics.
It displays the name of the hero who touched the object and the name of the object itself.
Thank you :)
Another question: for some reason, the built-in script checker complains about the function (not defined) and the 'heroname' parameter (also not defined).
What could be undefined there?
I got a little confused with do-end: based on my experience with Pascal and C, I'm used to 'else' not being the beginning of a code block.
I think I can express the general opinion by saying that you should look for the answers yourself. Stop bothering others with trivial questions that you can easily find the answers to in 10 minutes, especially considering that it has already been discussed. It's as if others have nothing better to do than to write the entire script for someone else.
Hello, great masters of the ancient Lua language. I've encountered some difficulties with restructuring a town... In general, everything works as intended with the trigger, but I would like to add some animation to the town's transformation. So, here's the essence of my question: what should I add to this trigger?
```
function transform ()
SetObjectiveState ( "obj3",OBJECTIVE_COMPLETED);
sleep (5);
TransformTown ( "necr1", TOWN_HAVEN );
Trigger ( OBJECT_TOUCH_TRIGGER, "lightwather", "transform", nil);
end;
Trigger ( OBJECT_TOUCH_TRIGGER, "lightwather", "transform" );
```
To play a visual effect of the "Holy Word" spell over the town between completing the quest and transforming the town? Please help if it's not too much trouble. I would be very grateful.
SetObjectiveState ( "obj3",OBJECTIVE_COMPLETED); PlayVisualEffect('/Effects/_(Effect)/HolyWord.xdb#xpointer(/Effect)', 'necr1', '', X, Y, Z, 0, 0); sleep (5); Instead of X, Y, and Z, you need to choose an offset to your liking; you can set Z to 5-6 right away. And you will probably need to increase the sleep time several times, as the animation is quite long.
SetObjectiveState ( "obj3",OBJECTIVE_COMPLETED); PlayVisualEffect('/Effects/_(Effect)/HolyWord.xdb#xpointer(/Effect)', 'necr1', '', X, Y, Z, 0, 0); sleep (5); Instead of X, Y, Z, you need to choose an offset to your liking; you can set Z to 5-6 right away. And you will probably need to increase the sleep time several times, as the animation is quite long.
Thank you very much.
And can I ask another question?
The MessageBox function absolutely refuses to work.
function Question () MessageBox("Maps\Multiplayer\Vostok\Question.txt"); Trigger(REGION_ENTER_AND_STOP_TRIGGER,"reg_1","Question",nil); end; Trigger(REGION_ENTER_AND_STOP_TRIGGER,"reg_1","Question");
The region is specified correctly; when entering it, the hero stops, but the message is not displayed. The path to the text file also seems to be specified correctly; at least, this file is in the root of the map in Unicode encoding. Can you tell me what the problem might be?
Added 1 hour 18 minutes ago Oops, sorry, I figured it out). I typed the slashes in the wrong direction... Now there's another problem: after reading the forum, I wrote the following script...
Function Question () QuestionBox("path to file","yes"); end; Trigger(6,"reg1","Question");
function yes () local gold = GetPlayerResourse(1,6); if gold >=3000 then SetPlayerResourse(1,6,GetPlayerResourse(1,6)-3000) SetObjectOwer("gar1",PLAYER_1) else MoveHeroRealTime("Diraya",75,25,0) end; end;
Please tell me, newbie, how to reset the trigger? Where should I insert Trigger(6,"reg1","Question",nil)?;
P.S. sorry for not following all the spacing in the script; I'm just writing from my phone, looking at the monitor, and I don't have the ability to simply copy and paste the text