Connection ErrorBad RequestSession 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.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Resident of Kirov, these are basic scripts... messagebox and removeobject...
Copy this into your "MapScript.lua" file.
function hatF ()
Trigger(OBJECT_TOUCH_TRIGGER, "hat" nil );
MessageBox (GetMapDataPath().."text.txt");
end;
Trigger(OBJECT_TOUCH_TRIGGER, "hat" "hatF" );
Create a file in Unicode format named "text" and place it in the map data archive. Write the message in it. Create an object (in your case, a peasant hut), name it "hat" in the object tree, which will be located on the right.
Added 1 minute ago
So, you need to activate the trigger first, and then reset it? I'll try it now.
Added 8 minutes ago
Maybe I didn't understand something, or I missed something in the code, but the script still doesn't work :( Currently, it looks like this:
function dopF ()
prog = 1;
MessageBox (GetMapDataPath().."text10.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "wayF", nil );
sleep (5);
SetObjectiveState('obj_dop', OBJECTIVE_ACTIVE);
SetObjectiveVisible( 'obj_dop', true, PLAYER_1 );
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "wayF", "dopF" );
end;
function dop1 ()
if prog == 1 then
MessageBox (GetMapDataPath().."text11.txt");
elseif prog == 2 then
SetObjectiveState("obj_dop", OBJECTIVE_COMPLETED);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", nil );
AddHeroCreatures("hero", 64, 30);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", "dop1" );
end;
function fenixF ()
Trigger(OBJECT_TOUCH_TRIGGER, "fenix", nil );
prog = prog +1;
Trigger(OBJECT_TOUCH_TRIGGER, "fenix", "fenixF" );
end;
Hmm... Unfortunately, I don't quite understand your idea, but most likely the line Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", nil ); should be placed after the line Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", nil ); Also, the line Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", "dop1" ); should definitely be after the 'end', not before. Also, the line Trigger(OBJECT_TOUCH_TRIGGER, "fenix", "fenixF" ); should be placed after the nearest 'end', not before.
Okay, I'll arrange the end triggers now... but I didn't understand this:
but most likely the line Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", nil ); should be placed after the line Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", nil );
Added 7 minutes ago Something started working... Now the message I wanted is displayed, if prog is equal to one, the trigger didn't reset, everything is as intended, BUT for some reason, issuing the quest didn't work, the main trigger, where SetObjectiveState is... however, there is progress. Currently, the script looks like this:
function dopF(heroname)
prog = 1
MessageBox(GetMapDataPath() .. "text10.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "wayF", nil);
sleep(5)
SetObjectiveState('obj_dop', OBJECTIVE_ACTIVE);
SetObjectiveVisible('obj_dop', true, 1);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "wayF", "dopF");
end;
function dop1()
if prog == 1 then
MessageBox(GetMapDataPath() .. "text11.txt");
end;
if prog == 2 then
SetObjectiveState("obj_dop", OBJECTIVE_COMPLETED);
AddHeroCreatures("hero", 64, 30);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", nil);
end;
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "way1", "dop1");
function fenixF(heroname)
prog = prog + 1
Trigger(OBJECT_TOUCH_TRIGGER, "fenix", nil);
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, "fenix", "fenixF");
Added after 47 seconds
Approximately like this.
Дайте мне всего шесть строк, написанных рукой самого честного человека, и я найду, за что его можно повесить. Весьма хороший попутчик... До первого перекрестка.
AkaR
Auto-translated
It all worked ;) Thank you very much :) I'll post the finished map in a day or two :)
Added 1 minute ago If anyone is interested, the working script looks like this:
Could you provide a script that displays different messages on different days (but within the same region)? Specifically:
* When entering reg1 during the first week, display message mes1.
* When entering reg1 during the second week, display message mes2.
* When entering reg1 during the third week, display message mes3.
* When entering reg1 during the fourth week, display message mes4.
* And so on.
Thank you in advance!
There is a GetDate function; it returns the date. You can do this: create a trigger on a region, use GetDate in the condition, and vary the dates using elseif. (I haven't used this function, so I'm not sure if it's possible to return only the day or, depending on the parameter, return the day, week, or month. You can check this in the manual.)
Dyrman
Auto-translated
This function can return anything: Day (absolute and relative), week (only relative), month (month is month). If something too complex is needed, it's not difficult to write it yourself using the available functions.
GetDate(week) - returns the week number relative to the month (1, 2, 3, 4).
Absolute day is the day count since the start of the game, and relative day is the day of the week or day of the month.
Seems like that's how it works.
Please tell me how to add animations to creatures on the map, for example, when playing Heroes, I saw an animation of peasants waving pitchforks on the map, not in battle, or knights waving swords, archdevils punching, etc. How can I add the same to my map??? I created a map, but there's nothing interesting in it.:confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused:
Ment
Auto-translated
It’s very simple: you add a script to the map: PlayObjectAnimation(monster name in quotes, animation name, loop); For example: PlayObjectAnimation("priest","attack00",IDLE); The name must be your own, script-based name. To name a creature with that name, you need to select it, find the Name line in the left panel, and enter the name there (in our case, priest ).