|
Post by generalthegreat on Sept 13, 2009 15:33:14 GMT 1
still dificult to me that scripting just one thing i gotta know how to put in one objective is good enough for me. i got a russian line where i got to break through the russians have 2000 as ID #. what is the code i must type in into scite editor and how do i get the map in the costum missions folder can you descripe it shortly how i get the mission running with objectives. if i know this i can do a lot by now but i am really stuck. those tutorials descripe multiple objectives but thats not what i want so i dont know anymore what to scrip with it..
|
|
Che Guevara
Stariji vodnik
Scripting for fun.
Posts: 58
|
Post by Che Guevara on Sept 13, 2009 17:03:58 GMT 1
You could use this small script. It runs 1 objective in which you have to kill the Russian troops with ID 2000. Than the objective is fulfilled and the mission is won. You'll loose if you have 1 unit left.
You can find an explanation in the updated map html for letting it appear in the custom map section of the game. There is a link for it in the topic about scripting tutorials.
Succes!
function Init() RunScript("AShowObjective", 3000); RunScript("ALoose", 3000); end;
function AShowObjective() ObjectiveChanged(0,0); RunScript("ACheckObjective", 3000); RunScript("ACompleteObjective", 5000); Suicide(); end;
function ACheckObjective() if GetNUnitsInScriptGroup(2000) <= 1 then SetIGlobalVar("Mission0", 1); Suicide(); end; end;
function ACompleteObjective() if GetIGlobalVar("Mission0", 0) == 1 then ObjectiveChanged(0, 1); RunScript("AWin", 3000); Suicide(); end; end;
function AWin() Win(0); Suicide(); end;
function ALoose() if GetNUnitsInParty(0) <= 1 then Loose(0); Suicide(); end; end;
|
|