Page 2 of 2

RE: Making Partisans: A sample event

Posted: Sat Mar 09, 2019 3:10 am
by ernieschwitz
We forgot to check who is the owner of the hex, and who was the original owner.

Time to do that.

CheckHexOwner is a condition that allows us to compare the owner of the hex, with a number, a regime. The opponents regime was 0 so, lets input that, after we input the coordinates in the check function itself.

CheckSlot is a similar function, it checks what the value is in the coordinates of the AreaSlot (3 not 0) and then asks what value it should be to go further in checking this hex.

Image

RE: Making Partisans: A sample event

Posted: Sat Mar 09, 2019 3:13 am
by ernieschwitz
Now we are done. Or so I thought. (That will teach me to code during the day, instead of the night, when I am tired). There is still one more step. I forgot something you see.

You need to add the line Check: CheckTurn == 1 before the first line. So add a line there, and type it in.

You also need an End Check at the very end of the code.

This will make the Event run only during regime 1s turn.

RE: Making Partisans: A sample event

Posted: Sat Mar 09, 2019 3:15 am
by ernieschwitz
I hope this has been a good little sample, of how and what to do... and also the process that goes into doing it. Not being afraid to admit you've forgotten something, and adding it in, once you realize it is gone. We don't all make perfect code on the first try, neither do I. Keep on hanging in there.. :)

And happy coding. [;)]

RE: Making Partisans: A sample event

Posted: Sat Mar 09, 2019 1:03 pm
by Jabod
Thanks for this!

Instead of
SETVAR: TempVar10 = CheckRandomPercent
SETVAR: TempVar10 - 1
SETVAR: TempVar10/ 5
CHECK: CheckHexOwner (TempVar0, TempVar1) == 0
CHECK: CheckSlot (TempVar0, TempVar1, 3) == 1
CHECK: TempVar10 == 0
EXECUTE: ExecAddUnit (5, TempVar0, TempVar1, 1)

Why not just

CHECK: CheckHexOwner (TempVar0, TempVar1) == 0
CHECK: CheckSlot (TempVar0, TempVar1, 3) == 1
CHECK: CheckRandomPercent < 6
EXECUTE: ExecAddUnit (5, TempVar0, TempVar1, 1)





RE: Making Partisans: A sample event

Posted: Sat Mar 09, 2019 1:19 pm
by ernieschwitz
Sure you could do that too.

I just prefer to do it the other way. :) There is no real reason I guess. Other than I got to show off how to use the SetVar option of the editor, and talk about how there is no decimal point in ATG.

RE: Making Partisans: A sample event

Posted: Sun Mar 10, 2019 9:50 pm
by Ormand
BTW, AreaSlot 0 is also used by the event "check inundate" as part of the officer inundate action card.

RE: Making Partisans: A sample event

Posted: Sun Mar 10, 2019 9:57 pm
by ernieschwitz
ORIGINAL: Ormand

BTW, AreaSlot 0 is also used by the event "check inundate" as part of the officer inundate action card.

:) If you have read the text, you will notice that I checked for usage of AreaSlot 0, and then did AreaSlot 3 instead . But yeah, as a designer you really need to label those AreaSlots for other designers to find out what is going on. As would have it, I am not using New Dawn with officers, but Default.at2 as masterfile :)

RE: Making Partisans: A sample event

Posted: Fri May 24, 2019 8:52 pm
by lion_of_judah
Ernie
I wonder if the problem maybe that the partisan unit for Hyderabad is the same people as India, could that be the problem or is it in the coding. Because if it's the people then I see no way around it as both nations are comprised of Indians.


RE: Making Partisans: A sample event

Posted: Wed May 29, 2019 5:32 pm
by ernieschwitz
ORIGINAL: lion_of_judah

Ernie
I wonder if the problem maybe that the partisan unit for Hyderabad is the same people as India, could that be the problem or is it in the coding. Because if it's the people then I see no way around it as both nations are comprised of Indians.

For the sake of clarity for everyone reading, and myself: What problem?

RE: Making Partisans: A sample event

Posted: Wed May 29, 2019 10:33 pm
by lion_of_judah
It works now, had to erase and start the event from scratch.