Skip to content
User Avatar
#652
Auto-translated
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;
Создаётся карта "Забытый Авангард (готовность 80%)