Page 1 of 1
Code Help Please
Posted: Tue Aug 01, 2017 11:48 pm
by JWRussell
Can someone write a code snippet for me?
Check each Hex for location type X
Does location type X belong to AI or Human
If location type X belongs to AI then change to location type Y
if it belongs to human then no action
I have come close but cant get it...
THANKS!!
RE: Code Help Please
Posted: Wed Aug 02, 2017 9:40 am
by ernieschwitz
Curious:
What have you done so far to make the code? Can you post you code here... it might be easier to tell then where you stumbled.
RE: Code Help Please
Posted: Wed Aug 02, 2017 9:29 pm
by JWRussell
OK, here is what I have,,,,
I know I need to put in a CheckfiAI somewhere..but I have no idea where! or how to set it up
Also when it changes the Loctype from x to Z how do I set it ti keep the same people as it was?
0) LOOPER: TempVar0 FROM 0 TO CheckMapWidth
1) LOOPER: TempVar1 FROM 0 TO CheckMapHeight
2) CHECK: CheckLocTypeXY(TempVar0, TempVar1) == 0
3) EXECUTE: ExecChangeLocationType(TempVar0, TempVar1, 9, 0)
4) END CHECK
5) END LOOPER
6) END LOOPER
7) EXECUTE: BlockEvent
RE: Code Help Please
Posted: Thu Aug 03, 2017 3:01 am
by ernieschwitz
Ok, I see where you are having trouble.
I made this little attempt at coding it (See image). I can't remember if CheckIfAI is supposed to = 0 or = 1 if the regime is AI. I guess that will be for you to find out

RE: Code Help Please
Posted: Thu Aug 03, 2017 11:59 pm
by JWRussell
Beautiful!! Thank you!!
RE: Code Help Please
Posted: Sat Aug 05, 2017 6:24 am
by ernieschwitz
No problem
