Looping in areacode
Posted: Sun Feb 08, 2009 11:01 am
Hi
Here is an event i am having some problems with
0) CHECK: Gameslot_Local guerillas(#2) == 1
1) SETVAR: TempVar1 = CheckMapHeight
2) SETVAR: TempVar2 = CheckMapWidth
3) LOOPER: TempVar3 FROM 0 TO TempVar1
4) LOOPER: TempVar4 FROM 0 TO TempVar2
5) CHECK: CheckSlot(TempVar3, TempVar4, 9) == 8
6) CHECK: CheckSFTypeInArea(9, 8, 126, 1) < 1
7) CHECK: CheckHexOwner(TempVar3, TempVar4) == 1
8) CHECK: CheckRandomPercent < 50
9) EXECUTE: ExecAddUnit(15, TempVar3, TempVar4, 0)
10) END CHECK
11) END CHECK
12) END CHECK
13) END CHECK
14) END CHECK
15) END LOOPER
16) END LOOPER
The purpose of this event is to first check if a certain gamevariant is on. That part works. Then it is supposed to check a certain part of the map, a province, (areaslot 9,8) to see if there is a special SFT (antiguerilla troop) from a special regime there). Then check if that part is owned by said regime. If all conditions are met there would be a % chance of a guerilla unit appearing in any of those hexes. So when i run the event it says there is an error on command line 5. What am i doing wrong?
And is it possible to add a loop that is restricted to a certain are and play the unit in only that area? I am quite sure its possible, just dont know how.
Also is it possible to count the number of antiguerillatroops in the province and let that number affect the chance of an guerillaunit appearing?
Thanks for any help in advance.
Here is an event i am having some problems with
0) CHECK: Gameslot_Local guerillas(#2) == 1
1) SETVAR: TempVar1 = CheckMapHeight
2) SETVAR: TempVar2 = CheckMapWidth
3) LOOPER: TempVar3 FROM 0 TO TempVar1
4) LOOPER: TempVar4 FROM 0 TO TempVar2
5) CHECK: CheckSlot(TempVar3, TempVar4, 9) == 8
6) CHECK: CheckSFTypeInArea(9, 8, 126, 1) < 1
7) CHECK: CheckHexOwner(TempVar3, TempVar4) == 1
8) CHECK: CheckRandomPercent < 50
9) EXECUTE: ExecAddUnit(15, TempVar3, TempVar4, 0)
10) END CHECK
11) END CHECK
12) END CHECK
13) END CHECK
14) END CHECK
15) END LOOPER
16) END LOOPER
The purpose of this event is to first check if a certain gamevariant is on. That part works. Then it is supposed to check a certain part of the map, a province, (areaslot 9,8) to see if there is a special SFT (antiguerilla troop) from a special regime there). Then check if that part is owned by said regime. If all conditions are met there would be a % chance of a guerilla unit appearing in any of those hexes. So when i run the event it says there is an error on command line 5. What am i doing wrong?
And is it possible to add a loop that is restricted to a certain are and play the unit in only that area? I am quite sure its possible, just dont know how.
Also is it possible to count the number of antiguerillatroops in the province and let that number affect the chance of an guerillaunit appearing?
Thanks for any help in advance.