Jump to content

Normal Dude's Decision Scripts


Recommended Posts

I am posting some of Normal Dude's decision scripts as they show modders how to use the garrison script to create a decision tree.

Essentially - these scripts garrison a tile. Other Plan scripts check for the presence of a unit in these tiles. If a unit is found the plan (offensive or amphibious) activates.

; Axis garrison in decision position

#ACTIVATE_POSITION= 95,12 [0,0] [1,1] [1]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; AXIS SCRIPTS - After France: Decision Scripts

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;

; Garrison script

{

#NAME= Germany Garrison - Decision Maker - Sealion

#POPUP=

#FLAG= 1

#TYPE= 0

#COUNTRY_ID= 5

#TRIGGER= 10

#LEVEL= 0

#PLAN_ID= 0

#SIZE= 0

#LENGTH= 1

#GOAL_POSITION= 81,19

#DATE= 1940/07/01

#STEAL= 3

; Set friendly positions:

#FRIENDLY_POSITION= 84,16

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

; Set tactical conditions:

; 1st Line - Berlin not tactically threatened

#TACTICAL_CONDITION= 84,16 [1]

; Set dummy activate position (no units at position 0,0)

#ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0]

; Set dummy cancel position (single neutral unit at position 0,0). This is not possible as no

; unit can occupy tile 0,0 so event will not be cancelled due to #CONDITION_POSITION

#CANCEL_POSITION= 0,0 [0,0] [1,1] [0]

}

; Garrison script

{

#NAME= Germany Garrison - Decision Maker - Scandinavia

#POPUP=

#FLAG= 1

#TYPE= 0

#COUNTRY_ID= 5

#TRIGGER= 50

#LEVEL= 0

#PLAN_ID= 0

#SIZE= 0

#LENGTH= 1

#GOAL_POSITION= 95,12

#DATE= 1940/07/01

#STEAL= 3

; Set friendly positions:

#FRIENDLY_POSITION= 84,16

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

; Set tactical conditions:

; 1st Line - Berlin not tactically threatened

#TACTICAL_CONDITION= 84,16 [1]

; Set dummy activate position (no units at position 0,0)

#ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0]

; Set dummy cancel position (single neutral unit at position 0,0). This is not possible as no

; unit can occupy tile 0,0 so event will not be cancelled due to #CONDITION_POSITION

#CANCEL_POSITION= 0,0 [0,0] [1,1] [0]

}

; Garrison script

{

#NAME= Germany Garrison - Decision Maker - Mediteranean

#POPUP=

#FLAG= 1

#TYPE= 0

#COUNTRY_ID= 5

#TRIGGER= 50

#LEVEL= 0

#PLAN_ID= 0

#SIZE= 0

#LENGTH= 1

#GOAL_POSITION= 88,18

#DATE= 1940/07/01

#STEAL= 3

; Set friendly positions:

#FRIENDLY_POSITION= 84,16

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

; Set tactical conditions:

; 1st Line - Berlin not tactically threatened

#TACTICAL_CONDITION= 84,16 [1]

; Set dummy activate position (no units at position 0,0)

#ACTIVATE_POSITION= 0,0 [0,0] [0,0] [0]

; Set dummy cancel position (single neutral unit at position 0,0). This is not possible as no

; unit can occupy tile 0,0 so event will not be cancelled due to #CONDITION_POSITION

#CANCEL_POSITION= 0,0 [0,0] [1,1] [0]

}

; Germany prepares to attack Norway:

{

#NAME= Germany Build Up Amphibious - Oslo

#POPUP=

#FLAG= 1

#TYPE= 0

#COUNTRY_ID= 5

#TRIGGER= 100

#LEVEL= 0

#PLAN_ID= 2

#SIZE= 4

#LENGTH= 1

; Oslo

#GOAL_POSITION= 80,8

#DATE= 1940/07/15

#STEAL= 2

; Set friendly positions:

; 1st Line - Copenhagen

#FRIENDLY_POSITION= 81,12

; Set variable conditions:

; 1st Line - Germany politically aligned with Axis and not surrendered

#VARIABLE_CONDITION= 5 [1] [100] [0]

; Set tactical conditions:

; 1st Line - Copenhagen not tactically threatened

#TACTICAL_CONDITION= 81,12 [3]

; Axis garrison in decision position

#ACTIVATE_POSITION= 95,12 [0,0] [1,1] [1]

; Axis unit already in Norway (Due to possible Allied DoW)

#CANCEL_POSITION= 80,8 [0,0] [1,1] [1]

#CANCEL_POSITION= 74,7 [0,0] [1,1] [1]

#CANCEL_POSITION= 80,4 [0,0] [1,1] [1]

}

[ June 08, 2006, 06:12 AM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

They work fairly well for limited situations, a good interim measure until we get global variables.

These decision scripts can even be two-tiered. I have an Axis med attack plan on hold where a second set of decision scripts are activated from a garrison occupying the Med decision tile. These allow the AI to randomly choose between a land attack, or an amphib hit on Syria, but ONLY if the first tile was activated. That one is on hold though, as the AI doesnt know how to protect the amphibs yet.

And of course, the inevitable question, "what if someone accidently moves on that tile?" smile.gif I haven't had that happen yet, I just choose remote tiles near a city that the AI never sends troops to, or plops down purchases. Since the scripts are Type 0 and are only checked once, past the given date the tile is free for occupying.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...