runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on May 17, 2010 22:38:23 GMT 1
Another scripting related question and this one almost drives me nuts:
just two examples from MK
1.: kursk_test map ~ line 360:
2.: butovo_map ~ line 650:
Well the situation is basically the same. a unit/units of a script group is/are removed from the map.
but why was on the one hand ">0" and and on the other hand ">= 1" used.
Do I miss here something?
Those lines are common thing in MK scripts and used million times. but I don't see the difference. checked it out and two versions work of course.
or is it as simple as like Leon (RIP) used to say: different strokes for different folks. meaning it's just a matter of the scripter's personal preference
Btw: anyone knows who and how many people scripted the MK maps?
ok, steelwedge did some scripts but who else?
maybe I'm wrong here, but having a look at the scripts and considering their specific styles I would venture a guess and say there were at least three different scripters involved.
|
|
|
Post by danzig70 on May 18, 2010 0:19:26 GMT 1
I would say its just preference. I have used <= 0 for victory conditions knowing the number of enemy units wont be less than 0.
|
|
|
Post by jeffcanada on May 18, 2010 11:23:10 GMT 1
I would say its just preference. I have used <= 0 for victory conditions knowing the number of enemy units wont be less than 0. Yes but remembering and old saying of my friend Leon, sometimes there's a lonely soldier lost in the map, hiding in some bar and wants to go home, you can't find him and the script won't end. From there I prefer to use <= 1 instead.
|
|
Ocelo
General
Map Artist/Eastern Front enthusiast
Posts: 1,400
|
Post by Ocelo on May 18, 2010 15:06:44 GMT 1
Personally, for script areas, I use 3-5 units, while for attacking AI, I use less than 2-3, and all the units in the group are armored, not infantry.
|
|
|
Post by danzig70 on May 18, 2010 17:07:29 GMT 1
I would say its just preference. I have used <= 0 for victory conditions knowing the number of enemy units wont be less than 0. Yes but remembering and old saying of my friend Leon, sometimes there's a lonely soldier lost in the map, hiding in some bar and wants to go home, you can't find him and the script won't end. From there I prefer to use <= 1 instead. That's where I'd be hiding!
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on May 19, 2010 17:18:30 GMT 1
I would say its just preference. Seems to be so. Really couldn't figure out any difference of ">0" or ">=1" in a "unit(s) removing from map"- context
|
|
|
Post by Jagged Steel on Jun 7, 2010 18:38:38 GMT 1
I am trying to work out a simple new script for a Multiplayer map. For some reason the "display trace" text at the start of game displays 5 times. Why is this happening? Also, this script I started with sets the weather to "3". How are the weather conditions numbered, and is there a way I can set the weather to say a sandstorm (Africa season) for 5 minutes at the start of game? Here is the .lua , could someone better versed in .lua please take a look and see what I am doing wrong ? cid-d60a13c118ecd366.skydrive.live.com/self.aspx/.Public/Jagged%5E_Steel%5E_Bigtimev061010.luafunction Beginn() DisplayTrace ("We have made Enemy contact in the village ahead Commander!"); DisplayTrace ("Deploy your forces and expect reinforcements arriving via the Tre Capuzzo road."); DisplayTrace ("The last units in our column should arrive within an hour."); DisplayTrace ("Your forces include captured and repaired enemy equipment."); DisplayTrace ("Supplies are limited, your orders are to scavange what you can from the battlefield when possible."); DisplayTrace ("Capture all flags to win the battle. Good Luck!"); DisplayTrace ("A map by Jagged Steel"); end;
function Beginnend() KillScript("Beginn"); end;
function support100() LandReinforcement(100); Suicide(); end;
function support101() LandReinforcement(101); Suicide(); end;
function support102() LandReinforcement(102); Suicide(); end;
function support103() LandReinforcement(103); Suicide(); end;
function support104() LandReinforcement(104); Suicide(); end;
function support105() LandReinforcement(105); Suicide(); end;
function Init() SwitchWeatherAutomatic (3); RunScript("Beginn", 1200); RunScript("Beginnend",6000); RunScript("support100",300000); RunScript("support101",600000); RunScript("support102",1200000); RunScript("support103",1800000); RunScript("support104",2400000); RunScript("support105",3000000); end;
Edit to add: After looking at the posted script, I have noticed that there is a space after the comma in the RunScript Beginn line. Is this the problem making it display 5 times?? Update: I removed the space and it still displays the entire text block exactly 5 times. Did I omit something or screw up punctuation?
|
|
|
Post by wespex on Jun 7, 2010 21:16:53 GMT 1
function Beginn() DisplayTrace ("We have made Enemy contact in the village ahead Commander!"); DisplayTrace ("Deploy your forces and expect reinforcements arriving via the Tre Capuzzo road."); DisplayTrace ("The last units in our column should arrive within an hour."); DisplayTrace ("Your forces include captured and repaired enemy equipment."); DisplayTrace ("Supplies are limited, your orders are to scavange what you can from the battlefield when possible."); DisplayTrace ("Capture all flags to win the battle. Good Luck!"); DisplayTrace ("A map by Jagged Steel"); Suicide() end;
Just add Suicide to your Beginn function to stop the loop and then you can get rid of your Beginnend function as it would not be needed in this case. This should fix your looping problem.
|
|
|
Post by Jagged Steel on Jun 7, 2010 21:26:10 GMT 1
Great, thank you. These things always seem so simple afterwards. I added the suicide and removed the beginnend function and it runs fine now. What are my options for setting the weather to storm for a period? If I set the weather in a script line, will it remain that condition, or does the random weather change function still apply and turn the weather back at some point?
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 7, 2010 21:50:12 GMT 1
I am trying to work out a simple new script for a Multiplayer map. For some reason the "display trace" text at the start of game displays 5 times. Why is this happening? Also, this script I started with sets the weather to "3". How are the weather conditions numbered, and is there a way I can set the weather to say a sandstorm (Africa season) for 5 minutes at the start of game? Here is the .lua , could someone better versed in .lua please take a look and see what I am doing wrong ? cid-d60a13c118ecd366.skydrive.live.com/self.aspx/.Public/Jagged%5E_Steel%5E_Bigtimev061010.luafunction Beginn() DisplayTrace ("We have made Enemy contact in the village ahead Commander!"); DisplayTrace ("Deploy your forces and expect reinforcements arriving via the Tre Capuzzo road."); DisplayTrace ("The last units in our column should arrive within an hour."); DisplayTrace ("Your forces include captured and repaired enemy equipment."); DisplayTrace ("Supplies are limited, your orders are to scavange what you can from the battlefield when possible."); DisplayTrace ("Capture all flags to win the battle. Good Luck!"); DisplayTrace ("A map by Jagged Steel"); [glow=red,2,300]Suicide();[/glow]end;
function Beginnend() KillScript("Beginn"); [glow=red,2,300]Suicide()[/glow]end;
function support100() LandReinforcement(100); Suicide(); end;
function support101() LandReinforcement(101); Suicide(); end;
function support102() LandReinforcement(102); Suicide(); end;
function support103() LandReinforcement(103); Suicide(); end;
function support104() LandReinforcement(104); Suicide(); end;
function support105() LandReinforcement(105); Suicide(); end;
function Init() SwitchWeatherAutomatic (3); <--remove this line RunScript("Beginn", 1200); RunScript("Beginnend",6000); <--remove this line RunScript("support100",300000); RunScript("support101",600000); RunScript("support102",1200000); RunScript("support103",1800000); RunScript("support104",2400000); RunScript("support105",3000000); end;
Edit to add: After looking at the posted script, I have noticed that there is a space after the comma in the RunScript Beginn line. Is this the problem making it display 5 times?? Update: I removed the space and it still displays the entire text block exactly 5 times. Did I omit something or screw up punctuation? 1. You missed a "Suicide()" in your first "Beginn"-Block. Therefore it runs as long as it is stopped. It's triggered by RunScript(Beginner) you used as time 1200 millisecs = 1.2 sec. Your KillScript(Beginn) is trigger by RunScript(Beginnend) after 6000millisec = 6 secs. 1.2sec+1.2sec+1.2sec+1.2sec+1.2sec = 6sec. Therefore it runs 5 times. Additionally you did forget a "Suicide()" in your function Beginnend() But it doesn't matter in that case as you can remove the whole "Beginnend" Block. Because by putting a Suicide in your Beginn function this function is run only one time. 2. For weather conditions please check Calvin's Scripting Guide. LUA Scripting Guide_Download-LinkSwitchWeather(iState) · Switch the weather, if iState is 1, the weather becomes BAD and the aviation is not available. · if iState is 0, the weather becomes GOOD, and the aviation is available SwitchWeatherAutomatic(iState) · Set the random weather. · if iState is 1, the weather is random. · if iState is 0, the weather is ALWAYS the same Additionally I'd recommend this Scripting Tutorial: Basic Scripting Lessons3. You can start with a 5 min sandstorm by just putting SwitchWeather(1); RunScript("Stormover", 300000); <-- = 300000msec = 300sec = 5 min in your Beginn function. Then you need a block like this function Stormover() SwitchWeatherAutomatic(1); Suicide(); end; then you've got random weather again. So the beginning of your script could look something like this: function Beginn() DisplayTrace ("We have made Enemy contact in the village ahead Commander!"); DisplayTrace ("Deploy your forces and expect reinforcements arriving via the Tre Capuzzo road."); DisplayTrace ("The last units in our column should arrive within an hour."); DisplayTrace ("Your forces include captured and repaired enemy equipment."); DisplayTrace ("Supplies are limited, your orders are to scavange what you can from the battlefield when possible."); DisplayTrace ("Capture all flags to win the battle. Good Luck!"); DisplayTrace ("A map by Jagged Steel"); SwitchWeather(1); RunScript("Stormover", 300000); Suicide(); end; function Stormover() SwitchWeatherAutomatic(1); Suicide(); end; ..... Good luck. For any further questions don't hesitate to ask. EDIT: Oops...Wespex has been faster.. ;D
|
|
|
Post by Jagged Steel on Jun 7, 2010 22:17:33 GMT 1
Thanks again, that was a good explanation runrum. I understand the looping much better now. Thanks for the links too, I have calvins guide somewhere but couldn't find it. I am going to try the change weather functions you suggested, I will report the results after I give it a try.
Update: I used the code lines you posted and everything works great! Weather now storms (no aviation) for 5 minutes and then switches to auto.
|
|
|
Post by Jagged Steel on Jun 7, 2010 23:31:17 GMT 1
How does this "FlagReinforcement" work? From what I can see here it is a yes/no type of query? How can you apply reinforcements when certain Flag point numbers have been reached? The original BK Multiplayer map "Lost Victory" seems to award reinforcements based on Flag points, but I cannot figure out exactly how this is working. Edit : Here is the LostVictory script if anyone would like to take a look at it. I can't make heads nor tails of this : Code: function FlagReinforcement (nParty) if ( (nParty == 0) and (GetNUnitsInPartyUF(0) < 18)) then RunScript("Flag0", 100); end; if ( (nParty == 1) and (GetNUnitsInPartyUF(1) < 18)) then RunScript("Flag1", 100); end; end; ----------------------------------------------------------------------- function Flag0() while (5 == 5) do if (GetIGlobalVar("temp.010", 0) == 0) then local num1 = RandomInt(2) + 101; SetIGlobalVar("temp.010", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.011", 0) == 0) then local num1 = RandomInt(2) + 101; SetIGlobalVar("temp.011", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.012", 0) == 0) then local num1 = RandomInt(2) + 101; SetIGlobalVar("temp.012", 1); LandReinforcement(num1); break; end; ---- if (GetIGlobalVar("temp.020", 0) == 0) then local num1 = RandomInt(2) + 103; SetIGlobalVar("temp.020", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.021", 0) == 0) then local num1 = RandomInt(2) + 103; SetIGlobalVar("temp.021", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.022", 0) == 0) then local num1 = RandomInt(2) + 103; SetIGlobalVar("temp.022", 1); LandReinforcement(num1); break; end; ---- if (GetIGlobalVar("temp.030", 0) == 0) then local num1 = RandomInt(2) + 105; SetIGlobalVar("temp.030", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.031", 0) == 0) then local num1 = RandomInt(2) + 105; SetIGlobalVar("temp.031", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.032", 0) == 0) then local num1 = RandomInt(2) + 105; SetIGlobalVar("temp.032", 1); LandReinforcement(num1); break; end; ---- if (GetIGlobalVar("temp.040", 0) == 0) then local num1 = RandomInt(2) + 107; SetIGlobalVar("temp.040", 1); SetIGlobalVar("temp.050", 0); SetIGlobalVar("temp.051", 0); SetIGlobalVar("temp.052", 0); LandReinforcement(num1); Suicide(); end; if (GetIGlobalVar("temp.041", 0) == 0) then local num1 = RandomInt(2) + 107; SetIGlobalVar("temp.041", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.042", 0) == 0) then local num1 = RandomInt(2) + 107; SetIGlobalVar("temp.042", 1); LandReinforcement(num1); break; end;
---- if (GetIGlobalVar("temp.050", 0) == 0) then local num1 = RandomInt(2) + 109; SetIGlobalVar("temp.050", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.051", 0) == 0) then local num1 = RandomInt(2) + 109; SetIGlobalVar("temp.051", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.052", 0) == 0) then local num1 = RandomInt(2) + 109; SetIGlobalVar("temp.052", 1); SetIGlobalVar("temp.040", 0); SetIGlobalVar("temp.041", 0); SetIGlobalVar("temp.042", 0); LandReinforcement(num1); break; end; end; Suicide(); end; ---------------------------------------------------------------------- function Flag1() while (5 == 5) do if (GetIGlobalVar("temp.110", 0) == 0) then local num1 = RandomInt(2) + 201; SetIGlobalVar("temp.110", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.111", 0) == 0) then local num1 = RandomInt(2) + 201; SetIGlobalVar("temp.111", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.112", 0) == 0) then local num1 = RandomInt(2) + 201; SetIGlobalVar("temp.112", 1); LandReinforcement(num1); break; end; ---- if (GetIGlobalVar("temp.120", 0) == 0) then local num1 = RandomInt(2) + 203; SetIGlobalVar("temp.120", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.121", 0) == 0) then local num1 = RandomInt(2) + 203; SetIGlobalVar("temp.121", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.122", 0) == 0) then local num1 = RandomInt(2) + 203; SetIGlobalVar("temp.122", 1); LandReinforcement(num1); break; end; ---- if (GetIGlobalVar("temp.130", 0) == 0) then local num1 = RandomInt(2) + 205; SetIGlobalVar("temp.130", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.131", 0) == 0) then local num1 = RandomInt(2) + 205; SetIGlobalVar("temp.131", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.132", 0) == 0) then local num1 = RandomInt(2) + 205; SetIGlobalVar("temp.132", 1); LandReinforcement(num1); break; end; ---- if (GetIGlobalVar("temp.140", 0) == 0) then local num1 = RandomInt(2) + 207; SetIGlobalVar("temp.140", 1); SetIGlobalVar("temp.150", 0); SetIGlobalVar("temp.151", 0); SetIGlobalVar("temp.152", 0); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.141", 0) == 0) then local num1 = RandomInt(2) + 207; SetIGlobalVar("temp.141", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.142", 0) == 0) then local num1 = RandomInt(2) + 207; SetIGlobalVar("temp.142", 1); LandReinforcement(num1); break; end;
---- if (GetIGlobalVar("temp.150", 0) == 0) then local num1 = RandomInt(2) + 209; SetIGlobalVar("temp.150", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.151", 0) == 0) then local num1 = RandomInt(2) + 209; SetIGlobalVar("temp.151", 1); LandReinforcement(num1); break; end; if (GetIGlobalVar("temp.152", 0) == 0) then local num1 = RandomInt(2) + 209; SetIGlobalVar("temp.152", 1); SetIGlobalVar("temp.140", 0); SetIGlobalVar("temp.141", 0); SetIGlobalVar("temp.142", 0); LandReinforcement(num1); break; end; end; Suicide(); end; --------------------------------------------------------------------------------------
function SetIGlobalVars() SetIGlobalVar("temp.010", 0); SetIGlobalVar("temp.011", 0); SetIGlobalVar("temp.012", 0); SetIGlobalVar("temp.020", 0); SetIGlobalVar("temp.021", 0); SetIGlobalVar("temp.022", 0); SetIGlobalVar("temp.030", 0); SetIGlobalVar("temp.031", 0); SetIGlobalVar("temp.032", 0); SetIGlobalVar("temp.040", 0); SetIGlobalVar("temp.041", 0); SetIGlobalVar("temp.042", 0); SetIGlobalVar("temp.050", 0); SetIGlobalVar("temp.051", 0); SetIGlobalVar("temp.052", 0); SetIGlobalVar("temp.110", 0); SetIGlobalVar("temp.111", 0); SetIGlobalVar("temp.112", 0); SetIGlobalVar("temp.120", 0); SetIGlobalVar("temp.121", 0); SetIGlobalVar("temp.122", 0); SetIGlobalVar("temp.130", 0); SetIGlobalVar("temp.131", 0); SetIGlobalVar("temp.132", 0); SetIGlobalVar("temp.140", 0); SetIGlobalVar("temp.141", 0); SetIGlobalVar("temp.142", 0); SetIGlobalVar("temp.150", 0); SetIGlobalVar("temp.151", 0); SetIGlobalVar("temp.152", 0); Suicide(); end;
function Reinf10() if (GetNUnitsInScriptGroup(10) == 0) and (GetIGlobalVar("temp.reinf10",0) == 0) then RunScript("A10", 32000); RunScript("Reinf10",2000); SetIGlobalVar("temp.reinf10",1); Suicide(); end; end; function Reinf11() if (GetNUnitsInScriptGroup(11) == 0) and (GetIGlobalVar("temp.reinf11",0) == 0) then RunScript("A11", 32000); RunScript("Reinf11",2000); SetIGlobalVar("temp.reinf11",1); Suicide(); end; end; function Reinf20() if (GetNUnitsInScriptGroup(20) == 0) and (GetIGlobalVar("temp.reinf20",0) == 0) then RunScript("A20", 32000); RunScript("Reinf20",2000); SetIGlobalVar("temp.reinf20",1); Suicide(); end; end; function Reinf21() if (GetNUnitsInScriptGroup(21) == 0) and (GetIGlobalVar("temp.reinf21",0) == 0) then RunScript("A21", 32000); RunScript("Reinf21",2000); SetIGlobalVar("temp.reinf21",1); Suicide(); end; end;
function Begin() if (IsPlayerPresent(0) == 1) then RunScript("A10", 500); RunScript("A11", 500); RunScript("Reinf10", 5000); RunScript("Reinf11", 5000); end; if (IsPlayerPresent(1) == 1) then RunScript("A20", 500); RunScript("A21", 500); RunScript("Reinf20", 5000); RunScript("Reinf21", 5000); end; Suicide(); end;
function A10() LandReinforcement(10); SetIGlobalVar("temp.reinf10",0); Suicide(); end;
function A11() LandReinforcement(11); SetIGlobalVar("temp.reinf11",0); Suicide(); end; function A20() LandReinforcement(20); SetIGlobalVar("temp.reinf20",0); Suicide(); end; function A21() LandReinforcement(21); SetIGlobalVar("temp.reinf21",0); Suicide(); end;
function EtherealBridge() local num, totalnum = 901, 902; local MaxHP = 1500; while (num <= totalnum) do if ( GetNUnitsInScriptGroup(num) > 0) then HP = GetObjectHPs(num); if ( HP < MaxHP) then DamageObject( num, HP - MaxHP); end; else DamageObject( num, -MaxHP); end; num = num + 1; end; end;
function Init() RunScript("Begin", 1000); RunScript("SetIGlobalVars", 500); -- RunScript( "EtherealBridge", 1000); end;
Edit to add: This script seems to only check whether each player (two player multiplayer map) has at least one flag, and then randomly awards reinforcements? Is there a way to check the Flag point scores for each player and use that to trigger a reinforcement event?
|
|
|
Post by danzig70 on Jun 8, 2010 23:10:01 GMT 1
It seems to be a complex way of landing random reinforcements, within a certain script id range. All the temp variables seem to be used in assigning script id.
Maybe you can just do something like:
function FlagReinforcement (nParty) if ( (nParty == 0) and (GetNUnitsInPartyUF(0) < 18)) then LandReinforcement (#); end; if ( (nParty == 1) and (GetNUnitsInPartyUF(1) < 18)) then LandReinforcement(#); end; end;
|
|
|
Post by Jagged Steel on Jun 8, 2010 23:32:23 GMT 1
Yes, it appears that the FlagReinforcement block seems to only enable reinforcements in this script, which are then chosen by a pretty complex method. When playing this map, it SEEMS like the person with the higher flag count gets more reinforcements, but I can't see anywhere in the script that checks the flag count#. I thought maybe a variable was being added to every cycle according to whether a team has at least one flag,but I don't see anything like that in there either. I also do not see any .lua commands that are specific to BK that could be accessed to give the Flag count #. Are ONLY BK specific .lua commands valid? Or can any of the generic commands be used? I am considering implementing something like you suggested dan, but it doesn't really add a whole lot to a multiplayer game, because you generally have at least one flag until the end, so both side would generally get the same reinforcements, even if one side had a much higher flag point count. I guess I would like the flags to mean a lot more in the game.
|
|
runrum
Zastavnik 1. klase
Posts: 85
|
Post by runrum on Jun 9, 2010 0:25:43 GMT 1
@jagged Steel: Well, you totally caught me on the wrong foot with your multiplayer script question. Never ever have played a multiplayer map in my life not speaking of scripting anything for mp. So I needed some time to acquaint myself somewhat with this whole mp topic... Starting "Lost victory" this message window pops up( please check screen): Well, as it is in German I did translate it for you: "Every team is supposed to capture as much flags as possible – and to defend those captured flags as long as possible. As soon a flag is captured you need to have at least one unit in its direct area.
Every captured flag is rewarded with one point per second holding this flag. Additionally you got one extra point per second, no matter how much flags you're holding. Every 150 points you'll get reinforcements. All teams can call for air support and use depots.
As soon as one side has captured all flags it has won – even if this side hasn't reached enough points. (personal note: in the multiplayer mask you can type in how many points need to be collected for the win condition)"This should explain at least some of your questions. About the "lost victory" script: Haven't totally figured it out yet, still some shady areas.. Seems somewhat "overengineered" to me (not stepping on anyone toes though) But I checked some Mission Kursk Multiplayer maps that look to me more stringent scripted but getting the same results (meaning the pattern is pretty similar)... This from MK Multiplayer map "Mission Kursk 2": function FlagReinforcement( nParty ) if ((nParty == 0) and (GetNUnitsInPlayerUF(0) <= 36)) then RunScript( "FlagReinf0", 1000); end; if ((nParty == 1) and (GetNUnitsInPlayerUF(1) <= 40)) then RunScript( "FlagReinf1", 1000); end; end;
function Begin() --DisplayTrace( "Scriptworking"); SetIGlobalVar( "Panthers", 0); SetIGlobalVar( "Artillery", 0); SetIGlobalVar( "PanzerIV", 0); SetIGlobalVar( "Infantry", 0); SetIGlobalVar( "Stugs", 0); SetIGlobalVar( "PanzerIII", 0); SetIGlobalVar( "Tanks", 0); SetIGlobalVar( "Tanks_2", 0); SetIGlobalVar( "RusArtillery", 0); SetIGlobalVar( "Su85", 0); SetIGlobalVar( "RusInfantry", 0); SetIGlobalVar( "KVTanks", 0); SetIGlobalVar( "Rockets", 0); SetIGlobalVar( "AttackPlanes", 0); SetIGlobalVar( "Bombers", 0); SetIGlobalVar( "RusAttackPlanes", 0); SetIGlobalVar( "RusBombers", 0); DisableAviation(0, 0); DisableAviation(0, 1); DisableAviation(0, 3); DisableAviation(0, 4); DisableAviation(1, 0); DisableAviation(1, 1); DisableAviation(1, 3); DisableAviation(1, 4); RunScript( "GerAviation", 10000); RunScript( "RusAviation", 10000); RunScript( "Tigers", 20000); Suicide(); end;
function Init() --RunScript( "EtherealBridge", 1000); RunScript( "Begin", 500); end;
function GerAviation() if (GetNUnitsInArea(0, "GerAviation") > 0) then EnableAviation(0, 0); EnableAviation(0, 1); Suicide(); end; end;
function RusAviation() if (GetNUnitsInArea(1, "RusAviation") > 0) then EnableAviation(1, 0); EnableAviation(1, 1); Suicide(); end; end;
function Tigers() if ((GetNUnitsInArea(0, "Tigers") > 0) and (GetNUnitsInArea(1, "Tigers") == 0)) then --DisplayTrace( "Tigers are coming"); LandReinforcement( RandomInt(2)+206); RunScript( "AssaultGuns", 5000); Suicide(); end; end; function AssaultGuns() if ((GetNUnitsInArea(0, "AssaultGuns") > 0) and (GetNUnitsInArea(1, "AssaultGuns") == 0)) then LandReinforcement( RandomInt(2)+106); Suicide(); end; end;
function FlagReinf0() local n = RandomInt(8)+1; if ((n == 1) and (GetIGlobalVar( "Panthers", 0) == 0)) then LandReinforcement(200); SetIGlobalVar( "Panthers", 1); Suicide(); end;
if ((n == 2) and (GetIGlobalVar( "Artillery", 0) == 0)) then LandReinforcement(201); SetIGlobalVar( "Artillery", 1); Suicide(); end; if ((n == 3) and (GetIGlobalVar( "PanzerIV", 0) == 0)) then LandReinforcement(202); SetIGlobalVar( "PanzerIV", 1); Suicide(); end; if ((n == 4) and (GetIGlobalVar( "Infantry", 0) == 0)) then LandReinforcement(203); SetIGlobalVar( "Infantry", 1); Suicide(); end; if ((n == 5) and (GetIGlobalVar( "Stugs", 0) == 0)) then LandReinforcement(204); SetIGlobalVar( "Stugs", 1); Suicide(); end; if ((n == 6) and (GetIGlobalVar( "PanzerIII", 0) == 0)) then LandReinforcement(205); SetIGlobalVar( "PanzerIII", 1); Suicide(); end; if ((n == 7) and (GetIGlobalVar( "AttackPlanes", 0) == 0)) then EnableAviation(0, 4); SetIGlobalVar( "AttackPlanes", 1); Suicide(); end; if ((n == 8) and (GetIGlobalVar( "Bombers", 0) == 0)) then EnableAviation(0, 3); SetIGlobalVar( "Bombers", 1); Suicide(); end;
if ((GetIGlobalVar( "PanzerIV", 0) == 1) and (GetIGlobalVar( "Panthers", 0) == 1) and (GetIGlobalVar( "Infantry", 0) == 1) and (GetIGlobalVar( "Artillery", 0) == 1) and (GetIGlobalVar( "Stugs", 0) == 1) and (GetIGlobalVar( "PanzerIII", 0) == 1) and (GetIGlobalVar( "Bombers", 0) == 1) and (GetIGlobalVar( "AttackPlanes", 0) == 0)) then RunScript( "Chk_Win_Conditions", 5000); Suicide(); end; end;
function FlagReinf1() local n = RandomInt(10)+1; if ((n == 1) and (GetIGlobalVar( "Tanks", 0) == 0)) then LandReinforcement(100); SetIGlobalVar( "Tanks", 1); Suicide(); end; if ((n == 2) and (GetIGlobalVar( "RusArtillery", 0) == 0)) then LandReinforcement(101); SetIGlobalVar( "RusArtillery", 1); Suicide(); end; if ((n == 3) and (GetIGlobalVar( "Su85", 0) == 0)) then LandReinforcement(102); SetIGlobalVar( "Su85", 1); Suicide(); end; if ((n == 4) and (GetIGlobalVar( "RusInfantry", 0) == 0)) then LandReinforcement(103); SetIGlobalVar( "RusInfantry", 1); Suicide(); end; if ((n == 5) and (GetIGlobalVar( "KVTanks", 0) == 0)) then LandReinforcement(104); SetIGlobalVar( "KVTanks", 1); Suicide(); end; if ((n == 6) and (GetIGlobalVar( "Rockets", 0) == 0)) then LandReinforcement(105); SetIGlobalVar( "Rockets", 1); Suicide(); end; if ((n == 7) and (GetIGlobalVar( "RusAttackPlanes", 0) == 0)) then EnableAviation(1, 4); SetIGlobalVar( "RusAttackPlanes", 1); Suicide(); end; if ((n == 8) and (GetIGlobalVar( "RusBombers", 0) == 0)) then EnableAviation(1, 3); SetIGlobalVar( "Bombers", 1); Suicide(); end; if ((n == 9) and (GetIGlobalVar( "Tanks_2", 0) == 0) and (GetIGlobalVar( "Tanks", 0) == 1)) then LandReinforcement(100); SetIGlobalVar( "Tanks_2", 1); Suicide(); end; if ((GetIGlobalVar( "Tanks_2", 0) == 1) and (GetIGlobalVar( "Tanks", 0) == 1) and (GetIGlobalVar( "RusTanks_2", 0) == 1) and (GetIGlobalVar( "RusInfantry", 0) == 1) and (GetIGlobalVar( "KVTanks", 0) == 1) and (GetIGlobalVar( "Su85", 0) == 1) and (GetIGlobalVar( "RusArtillery", 0) == 1) and (GetIGlobalVar( "Rockets", 0) == 1) and (GetIGlobalVar( "RusBombers", 0) == 1) and (GetIGlobalVar( "RusAttackPlanes", 0) == 1)) then RunScript( "Chk_Win_Conditions", 5000); Suicide(); end; end;
function Chk_Win_Conditions() if ((GetNUnitsInPlayerUF(0) <= 5) and (GetNUnitsInPlayerUF(1) <= 5)) then Draw(); Suicide(); end;
if ((GetNUnitsInPlayerUF(0) <= 5) and (GetNUnitsInPlayerUF(1) > 5)) then Win(1); Suicide(); end; if ((GetNUnitsInPlayerUF(0) > 5) and (GetNUnitsInPlayerUF(1) <= 5)) then Win(0); Suicide(); end; end;-------------------------- I'll explain it (and what I've figured out from "lost victory" so far) tomorrow or the day after tomorrow. Didn't have that much time today... --------------------------
|
|