Making Partisans: A sample event

Discuss and post your mods and scenarios here for others to download.

Moderator: Vic

User avatar
ernieschwitz
Posts: 4610
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Making Partisans: A sample event

Post 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
Attachments
A020FinalFunction.jpg
A020FinalFunction.jpg (78.97 KiB) Viewed 634 times
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
ernieschwitz
Posts: 4610
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Making Partisans: A sample event

Post 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.
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
ernieschwitz
Posts: 4610
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Making Partisans: A sample event

Post 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. [;)]
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
Jabod
Posts: 26
Joined: Wed Jun 23, 2004 2:33 pm

RE: Making Partisans: A sample event

Post 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)




User avatar
ernieschwitz
Posts: 4610
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Making Partisans: A sample event

Post 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.
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
Ormand
Posts: 835
Joined: Tue Feb 17, 2009 1:31 am

RE: Making Partisans: A sample event

Post by Ormand »

BTW, AreaSlot 0 is also used by the event "check inundate" as part of the officer inundate action card.
One man alone can be pretty dumb sometimes, but for real bona fide stupidity, there ain't nothin' can beat teamwork -- Edward Abbey
User avatar
ernieschwitz
Posts: 4610
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Making Partisans: A sample event

Post 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 :)
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
lion_of_judah
Posts: 2330
Joined: Mon Jan 08, 2007 6:36 pm
Location: somewhere over the rainbow

RE: Making Partisans: A sample event

Post 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.

User avatar
ernieschwitz
Posts: 4610
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Making Partisans: A sample event

Post 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?
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
lion_of_judah
Posts: 2330
Joined: Mon Jan 08, 2007 6:36 pm
Location: somewhere over the rainbow

RE: Making Partisans: A sample event

Post by lion_of_judah »

It works now, had to erase and start the event from scratch.
Post Reply

Return to “Mods and Scenarios”