kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Mar 24, 2016 20:47:11 GMT 1
In the MapEditor, you can click Start Commands again and as many as desired, but they will all be processed one after another. This will work fine if you want them to swarm from the moment they land. On the contrary, in lua script, you can make the swarm happen from any specific trigger and depending on your map, this will give more freedom and more control as quin states.
About the Reinf Groups - their numbers can be different. Group 0 containing units with ScriptID's 161171 and 154171. In lua, you are calling the group ID, not the unit ID's. But you can work both ways and say Group 154171 contains unit 154171. When you have a lot of reinforcements, this can be easier to remember who is exactly who. When you call these reinf's in lua, there is less confusion when using the same ID for both group and unit, in my experience that is. In case you perfectly know and remember what unit is in which group, then you can also choose to work that way.
|
|
|
Post by ariete on Mar 24, 2016 22:07:00 GMT 1
thank you quin .. i'll study the thing. kaoz thank you !!! yes!!! quote : in the MapEditor, you can click Start Commands again and as many as desired, but they will all be processed one after another. This will work fine if you want them to swarm from the moment they land. exactly, basically they force a player move of withdraw quote : In lua, you are calling the group ID, not the unit ID's. But you can work both ways and say Group 154171 contains unit 154171. me too i usually do the same, but now i'm trying a new system for which IDscript can't be the same of its reif group, reinf group must be in a number beetween 0 and 32000, or map editor doesn't accept it. anyway i can use a number so long for the units ID script (154171)?
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Mar 25, 2016 14:36:05 GMT 1
anyway i can use a number so long for the units ID script (154171)? Oh, must it be a number between 0 and 32000? I couldn't say because I have never used such long numbers.
|
|
|
Post by ariete on Mar 25, 2016 14:57:50 GMT 1
gods save the quin
|
|
|
Post by ariete on Apr 4, 2016 16:27:33 GMT 1
else
what's mean exactly?
player can accomplish a objective in 2 ways (2 conditions : if 1 else 2)
or is a way to able the player to continue the mission despite the objective is failed (1 condition else another condition but player lost the objective)
thank you ariete (down wit da union)
|
|
|
Post by Quintaxel on Apr 5, 2016 14:06:27 GMT 1
About the meaning of else.
Take the following example
function Check()--if....else
local a = GetNUnitsInScriptGroup (2000); -- check number of units in scriptgroup 2000 if a < 10 then -- check condition DisplayTrace ("a = less than 10"); -- Do this when true else -- So a = 10 or more DisplayTrace ("a is more than 10") -- then do this end; Suicide(); end; The else statement is used in combination with if. So the "if" statement in the function above has only 2 possible outcomes.
True : execute the code after "then" False: execute the code after "else"
As I understand your question correctly then an objective can be achieved in different ways.
In this case you would be looking for an 'or' function
eg.
function Check() if GetNUnitsInArea (0,"ScriptArea1") > 5 or GetNUnitsInArea (0, "ScriptArea2") > 5 then DisplayTrace ("Objective accomplished"); end; Suicide(); end;
So you could meet an objective in 2 ways. 1) you have more than 5 units within ScriptArea1 2) or you have more than 5 units within ScriptArea2
Hope this helps
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,112
|
Post by kaoz on Apr 5, 2016 16:11:47 GMT 1
...and then there's also elseif...
I have used it a few times to check whether an objective is reached or not. You could give an objective a failed status ObjectiveChanged(2, 2). As quin states, when using or, the function can be reached if 1 of the possibilities is true. When using else or elseif, it is more of a choice between possibilities. Failed objectives can sound like fun in theory, but in practice might lead to frustration with player. Therefore it should be used with caution if you don't want the player to quit the game. I have used it a few times for a bonus mission and for defending a town like in the given script example. Elseif is very handy when you f.e. want the player to give a chance to defend a town. You could run the above script to check whether the player succeeded in this or not.
|
|
|
Post by ariete on Apr 6, 2016 0:53:01 GMT 1
thank you friends for the explanations
|
|
|
Post by ariete on Apr 25, 2016 16:25:24 GMT 1
i have this case
a patrol fuction which start in objective 6, when the units for that patrol will be called as reiforcement
i have to know just if i put runscript function patrol under function init is correct, or maybe i have to put it in startobjective6 or checkobjective 6 parts. thank you
|
|
|
Post by Quintaxel on Apr 26, 2016 10:10:50 GMT 1
I would not put the patrol under the function Init() but under the startobjective 6 part. When objective 6 starts you could put the reinforcements on the map and run the patrol function.
|
|
|
Post by ariete on Apr 26, 2016 12:40:33 GMT 1
and so it will continue also for the next objectives?
|
|
|
Post by Quintaxel on Apr 26, 2016 13:22:47 GMT 1
It should. The trigger to run the patrol function is the fact that the objective6 started. If it doesn't work then you can send me the script.
|
|
|
Post by ariete on Apr 26, 2016 20:21:21 GMT 1
function Init() SwitchWeather(0); SwitchWeatherAutomatic(1); RunScript("ToLose", 5000); RunScript("StartObjective0", 5000); end;
function StartObjective0() ObjectiveChanged(0,0); RunScript("CheckObjective0", 15000); Suicide(); end;
function CheckObjective0() ObjectiveChanged(0, 1); RunScript("StartObjective1", 5000); Suicide(); end;
function StartObjective1() DisplayTrace("136 infantry regiment - 43 division"); DisplayTrace("elements of the 47 independent mixed brigade"); LandReinforcement(111); ObjectiveChanged(1,0); RunScript("CheckObjective1", 15000); Suicide(); end;
function CheckObjective1() if ((GetNScriptUnitsInArea(21, "landing_strip") < 1) or (GetNScriptUnitsInArea(111, "landing_strip") < 1)) then ObjectiveChanged(1, 1); RunScript("StartObjective2", 5000); Suicide(); end; end;
function StartObjective2() LandReinforcement(112); ObjectiveChanged(2,0); RunScript("CheckObjective2", 5000); Suicide(); end;
function CheckObjective2() if ((GetNScriptUnitsInArea(22, "Afetna_point") > 1) and (GetNUnitsInScriptGroup(112) < 1)) then ObjectiveChanged(2, 1); RunScript("StartObjective3", 5000); Suicide(); end; end;
function StartObjective3() LandReinforcement(1131); LandReinforcement(1132); RunScript("Reinforcement1133", 15000); ObjectiveChanged(3,0); RunScript("CheckObjective3", 5000); Suicide(); end;
function CheckObjective3() if GetNUnitsInScriptGroup(1131) < 1 then ObjectiveChanged(3, 1); RunScript("StartObjective4", 5000); Suicide(); end; end;
function Reinforcement1133() LandReinforcement(1133); Suicide(); end;
function StartObjective4() LandReinforcement(1141); RunScript("Reinforcement1142", 5000); RunScript("Reinforcement1143", 5000); ObjectiveChanged(4,0); RunScript("CheckObjective4", 5000); Suicide(); end;
function CheckObjective4() if ((GetNScriptUnitsInArea(24, "Charan_Kanoa") > 1) and (GetNUnitsInScriptGroup(1141) < 1)) then ObjectiveChanged(4, 1); RunScript("StartObjective5", 5000); Suicide(); end; end;
function Reinforcement1142() LandReinforcement(1142); Suicide(); end;
function Reinforcement1143() LandReinforcement(1143); Suicide(); end;
function StartObjective5() LandReinforcement(15); DisplayTrace("4 company / 9 tank regiment - 47 independent mixed brigade"); LandReinforcement(115); ObjectiveChanged(5,0); RunScript("CheckObjective5", 5000); Suicide(); end;
function CheckObjective5() if ((GetNScriptUnitsInArea(24, "Charan_Kanoa") > 1) and (GetNUnitsInScriptGroup(115) < 1)) then ObjectiveChanged(5, 1); RunScript("StartObjective6", 5000); Suicide(); end; end;
function StartObjective6() LandReinforcement(1161); LandReinforcement(1162); LandReinforcement(1201); LandReinforcement(1223); RunScript("Patrol1201", 5000); RunScript("Patrol1223", 5000); ObjectiveChanged(6,0); RunScript("CheckObjective6", 5000); Suicide(); end;
function CheckObjective6() if ((GetNScriptUnitsInArea(22, "Afetna_point") > 1) and (GetNUnitsInScriptGroup(1162) < 1)) then ObjectiveChanged(6, 1); RunScript("StartObjective7", 5000); Suicide(); end; end;
function Patrol1201() if GetNScriptUnitsInArea (1201,"P0") > 0 then Cmd(3,1201, GetScriptAreaParams("P1")); RunScript("RePatrol1201",5000); Suicide(); end; end;
function RePatrol1201() if GetNScriptUnitsInArea (1201,"P1") > 0 then QCmd(3,1201, GetScriptAreaParams("P0")); RunScript("Patrol1201",5000); Suicide(); end; end;
function Patrol1223() if GetNScriptUnitsInArea (1223,"P2") > 0 then Cmd(3,1223, GetScriptAreaParams("P3")); RunScript("RePatrol1223",5000); Suicide(); end; end;
function RePatrol1223() if GetNScriptUnitsInArea (1223,"P3") > 0 then QCmd(3,1223, GetScriptAreaParams("P2")); RunScript("Patrol1223",5000); Suicide(); end; end;
function StartObjective7() LandReinforcement(17); DisplayTrace("battalion from 135 infantry regiment - 43 division"); ObjectiveChanged(7,0); RunScript("CheckObjective7", 5000); Suicide(); end;
function CheckObjective7() if ((GetNScriptUnitsInArea(22, "Afetna_point") > 1) and (GetNUnitsInScriptGroup(17) < 1)) then ObjectiveChanged(7, 1); RunScript("StartObjective8", 5000); Suicide(); end; end;
function StartObjective8() LandReinforcement(118); ObjectiveChanged(8,0); RunScript("CheckObjective8", 5000); Suicide(); end;
function CheckObjective8() if GetNScriptUnitsInArea(22, "Afetna_point") < 1 then ObjectiveChanged(8, 1); RunScript("StartObjective9", 5000); Suicide(); end; end;
function StartObjective9() LandReinforcement(19); DisplayTrace("9 tank regiment - 47 independent mixed brigade"); ObjectiveChanged(9,0); RunScript("CheckObjective9", 5000); Suicide(); end;
function CheckObjective9() if GetNUnitsInArea(1, "area_9Tr") < 1 then ObjectiveChanged(9, 1); RunScript("StartObjective10", 5000); Suicide(); end; end;
function StartObjective10() LandReinforcement(10); DisplayTrace("1 Yokosuka SNLF"); ObjectiveChanged(10,0); RunScript("CheckObjective10", 5000); Suicide(); end;
function CheckObjective10() if GetNUnitsInArea(1, "area_1Ysnlf") < 1 then ObjectiveChanged(10, 1); RunScript("ToWin", 5000); Suicide(); end; end;
function ToWin() Win(0); end;
function ToLose() if GetNUnitsInParty(0) == 0 then Loose(0); Suicide(); end; end;
|
|
|
Post by ariete on May 17, 2016 13:41:56 GMT 1
ptrb or ptrs are anti tank guns usefull during the first stages of the war, at least they can shoot a pz III. so basically just US and Germany could have in the game the potentials to use an efficent AT infantry during-after 1943 considering japan developed the type 2 rocket launcher in 1944 (founded in iwo jima, saipan, and manchuria) and romanians had some panzerfaust in 1944, i have, as said before, undressed the other armies (british, italians and russians) under this point of view. italians ok, but for brits and russians infantry AT formations, they are too weak. sure AT guns resolve this lack ... you, how would you do? --- edit : for example, russian had bazzoka leand lease, but sincerly i don't remember so much bazooka in RKKA, at least the guards, but maybe i wrong should i do AT squads for brits with bazooka ? date ? 43?
|
|
|
Post by ariete on May 19, 2016 12:10:39 GMT 1
suitable against armoured cars !?!
|
|