AI Script for AI

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
rmelvin
Posts: 222
Joined: Wed Apr 06, 2022 1:41 am
Location: Tucson, Arizona

AI Script for AI

Post by rmelvin »

There have been several times I had to write two scripts for an "or" condition or like partisan script to cover either Allies or Axis occupier of the same location in different games.
If this is not the right location, please inform me there to post this thought.

Add to the script "AI = 5" being trigger under AI control only, and maybe "AI = 6" for human only, both sides.

Old frat from
Tucson, AZ :idea:
User avatar
BillRunacre
Posts: 6650
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

Re: AI Script for AI

Post by BillRunacre »

Do you mean Guard scripts so Partisan locations are guarded?

It might be difficult to have a universal setting as they are country specific.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
rmelvin
Posts: 222
Joined: Wed Apr 06, 2022 1:41 am
Location: Tucson, Arizona

Re: AI Script for AI

Post by rmelvin »

Here where I was going is having an AI setting to make an Event Script to trigger for either Allies or Axis if that player is AI.
Now like Partisans need to write two scripts to handle both Allies and Axis. Mobilization like # 2 or # 3 I need to write two scripts to handle the same situation. I do use Guarded script to garrison Partisan locations.

Could #CONDITION_POSITION be added to Supply Event. This then can be used to force a garrison.

Side notes about Partisans, I find having a unit showing up deep inside opponents is really more of a hassle and AI's response time at times is very slow. That was the reason of the thought of AI triggering only a human turn, then can make Partisans for human as a Hex event without a unit. A whole lot easier for AI to handle.
User avatar
Hubert Cater
Posts: 6011
Joined: Mon Jul 22, 2013 11:42 am
Contact:

Re: AI Script for AI

Post by Hubert Cater »

Thanks for this, it is an interesting idea for sure, I'll add it to my list, thanks
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: AI Script for AI

Post by El_Condoro »

In partisan.txt, you can set #AI= 3 or 4, so that the partisans will only appear for the human player and not the AI, which simplifies things. They still appear for MP games.

So, if I want partisans appear in the SU for an Axis player, I would set them as #AI= 4. If it were an Axis AI, the partisans would not appear.

3 = Event fires whenever all fields are satisfied, for AI and Multiplayer games only, and only on the Axis AI or on the Allied Multiplayer turns
4 = Event fires whenever all fields are satisfied, for AI and Multiplayer games only, and only on the Allied AI or on the Axis Multiplayer turns
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
Lothos
Posts: 1261
Joined: Tue May 23, 2006 8:22 pm

Re: AI Script for AI

Post by Lothos »

rmelvin wrote: Tue Apr 22, 2025 11:37 pm Here where I was going is having an AI setting to make an Event Script to trigger for either Allies or Axis if that player is AI.
Now like Partisans need to write two scripts to handle both Allies and Axis. Mobilization like # 2 or # 3 I need to write two scripts to handle the same situation. I do use Guarded script to garrison Partisan locations.

Could #CONDITION_POSITION be added to Supply Event. This then can be used to force a garrison.

Side notes about Partisans, I find having a unit showing up deep inside opponents is really more of a hassle and AI's response time at times is very slow. That was the reason of the thought of AI triggering only a human turn, then can make Partisans for human as a Hex event without a unit. A whole lot easier for AI to handle.
Look at TRP, I have ways of getting around the issue by using a flag system. I set a hex to USA controlled etc... which tells the system what flags are set

Code: Select all

{
#NAME= Flag Indicator - Axis AI
#POPUP= 
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 1
#AI= 1
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 0
#RECIPIENT_ID= 115
#REMOVE= 0
#TRIGGER= 100
#DATE= 1939/09/01
#VARIABLE_CONDITION= 5 [0] [0] [0]
; - 3,111 to prevent centering of the screen on Flag Hex
#MAP_POSITION= 3,111
#MAP_POSITION= 5,252
}

{
#NAME= Flag Indicator - Allied AI
#POPUP= 
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 1
#AI= 2
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 0
#RECIPIENT_ID= 115
#REMOVE= 0
#TRIGGER= 100
#DATE= 1939/09/01
#VARIABLE_CONDITION= 5 [0] [0] [0]
; - 3,111 to prevent centering of the screen on Flag Hex
#MAP_POSITION= 3,111
#MAP_POSITION= 5,253
}
rmelvin
Posts: 222
Joined: Wed Apr 06, 2022 1:41 am
Location: Tucson, Arizona

Re: AI Script for AI

Post by rmelvin »

Thank you for your comment. I will get back with you this fall.
Given what happened this spring I think maybe a little bit more time to do thing.
I do have three questions so see you in the fall.
Thanks, I appreciate this.
Post Reply

Return to “Scenario Design and Modding”