Page 1 of 1
#AI= ?? Can someone explain this to me
Posted: Sat Jun 11, 2022 10:52 pm
by Lothos
Description says
; #AI= Values range [0, 4]
; 0 = Event fires whenever all fields are satisfied for any game type
; 1 = Event fires whenever all fields are satisfied, for AI games only, and only on the Axis AI turn
; 2 = Event fires whenever all fields are satisfied, for AI games only, and only on the Allied AI turn
; 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
But if I am reading this exactly as written if you choose 1 or 2 then the event will never fire for multiplayer games and what I am confused about is if you choose 1 or 2 "AI Games only" does it matter which side the AI controls then?
Also if you choose 3 or 4 then if you want an event to fire on the Axis turn for Multiplayer (and Single player) then their is no way to ever do that.
Re: #AI= ?? Can someone explain this to me
Posted: Tue Jun 14, 2022 1:45 pm
by BillRunacre
If you use the same settings as these then the Pop Up will appear for the Axis player in both single player and Multiplayer:
I've emboldened two settings that we use so that it appears on the Axis turn:
{
#NAME= ALLIED AI: Axis At Start Message
#POPUP= <<TAG_1>>
#MESSAGE=
#IMAGE= germanystartmessage.png
#SOUND= teletype_1.ogg, teletype_2.ogg
#FLAG= 1
#TYPE= 0
#AI= 4
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 45
#TRIGGER= 100
#PRIVATE= 1
#DISPLAY_ORDER= 1
#DISPLAY_TURN= 1
#DISPLAY_STYLE= 1
#MESSAGE_STYLE= 0
#TEXT_RGB= 0,0,0
#SHADOW_RGB= 0,0,0
#MAP_POSITION=
#DATE= 1939/09/01
; Berlin is in Axis hands
#ALIGNMENT_POSITION= 173,74 [1]
; 1st Line - Germany politically aligned with Axis and not surrendered
#VARIABLE_CONDITION= 45 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
Re: #AI= ?? Can someone explain this to me
Posted: Tue Jun 14, 2022 2:07 pm
by Lothos
BillRunacre wrote: Tue Jun 14, 2022 1:45 pm
If you use the same settings as these then the Pop Up will appear for the Axis player in both single player and Multiplayer:
I've emboldened two settings that we use so that it appears on the Axis turn:
{
#NAME= ALLIED AI: Axis At Start Message
#POPUP= <<TAG_1>>
#MESSAGE=
#IMAGE= germanystartmessage.png
#SOUND= teletype_1.ogg, teletype_2.ogg
#FLAG= 1
#TYPE= 0
#AI= 4
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 45
#TRIGGER= 100
#PRIVATE= 1
#DISPLAY_ORDER= 1
#DISPLAY_TURN= 1
#DISPLAY_STYLE= 1
#MESSAGE_STYLE= 0
#TEXT_RGB= 0,0,0
#SHADOW_RGB= 0,0,0
#MAP_POSITION=
#DATE= 1939/09/01
; Berlin is in Axis hands
#ALIGNMENT_POSITION= 173,74 [1]
; 1st Line - Germany politically aligned with Axis and not surrendered
#VARIABLE_CONDITION= 45 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
I am still not understanding because of what was written. Will try and explain
; 0 = Event fires whenever all fields are satisfied for any game type
-- This is straight forward and always fires
; 1 = Event fires whenever all fields are satisfied, for AI games only, and only on the Axis AI turn
--- This is confusing, when it says AI games only? What AI? The Allied or Axis? and if it is Allied does that mean it will never fire since the Axis side is human controlled?
; 2 = Event fires whenever all fields are satisfied, for AI games only, and only on the Allied AI turn
--- Same as my response to AI=1 except reverse everything between Axis and Allies as its the same question
; 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
--- So if I read this right if its a Multiplayer game and no countries are controlled by the AI this would never fire because it only fires on the Axis AI turn (which does not exist)?
; 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
--- Same as my response to AI=3 except reverse everything between Axis and Allies as its the same question
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 6:32 pm
by Hubert Cater
Hi Lothos,
We've reviewed the headers and you are right they are not as clear as they should be, the following are cleaned up a bit and hopefully clearer?
; #AI= Values range [0, 4]
; 0 = Event fires whenever all fields are satisfied for any game type
; 1 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Axis
; 2 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Allied
; 3 = Event fires whenever all fields are satisfied, for any game type, and only when the AI is Axis in Single Player, or on Allied Multiplayer turns
; 4 = Event fires whenever all fields are satisfied, for any game type, and only when the AI is Allied in Single Player, or on Axis Multiplayer turns
For UNIT scripts it should read like this:
; #AI= Values range [0, 6]
; 0 = Event fires whenever all fields are satisfied for any game type
; 1 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Axis
; 2 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Allied
; 3 = Event fires whenever all fields are satisfied, for any game type, and only when the AI is Axis in Single Player, or on Allied Multiplayer turns
; 4 = Event fires whenever all fields are satisfied, for any game type, and only when the AI is Allied in Single Player or on Axis Multiplayer turns
; 5 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Axis in Single Player, or for AI controlled Axis majors on Axis human player turns
; 6 = Event fires whenever all fields are satisfied, for Single Player games only, and only when the AI is Allied in Single Player, or for AI controlled Allied majors on Allied human player turns
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 6:32 pm
by Hubert Cater
Here are a few more explanations and examples that will hopefully help as well:
AI= 0; this event will fire for any type of game, no other considerations or restrictions
AI=1; Single Player specific event, and will only fire when the Axis is AI controlled, e.g. let's say you want to give UNIT scripted bonuses to the Axis AI, this is a way to achieve this
AI= 2; Single Player specific event, and will only fire on the Allies are AI controlled, e.g. Allied AI UNIT scripted bonuses etc.
AI= 3; Single Player or Multiplayer games, e.g. any game type, but will only fire when the Axis are AI controlled, or on Allied Multiplayer turns.
Let's say you want a message to appear for any game type, but only for Allied players, this will achieve this, e.g. an opening of game suggested strategy message for Allied players only
AI= 4; Single Player or Multiplayer games, e.g. any game type, but will only fire when the Allies are AI controlled, or on Axis Multiplayer turns.
Let's say you want a message to appear for any game type, but only for Axis players, this will achieve this, e.g. an opening of game suggested strategy message for Axis players only
AI=3 and AI=4 still required you to ensure your date was correct so that it would only show on the right dates for let's say when Allied players had their turn against the Axis AI, but since then for at least I believe the POPUP events we added a new field called #DISPLAY_TURN=
; #DISPLAY_TURN= On what turn do we display this popup event? (values range [0, 2]; Any= 0; Axis Turn= 1; Allied Turn= 2)
But since we didn't want or need to re-write older POPUP events, and to have it all backwards compatible with custom mods, both options can be used, and really it is up to you how you want to use the options and it can give you some flexibility, e.g. you might want an AI=1 event but to only trigger/show on an Allied turn and so on.
Hope this clears things up a bit,
Hubert
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 6:38 pm
by Lothos
Awesome, great explanation. Will update the headers on the files I am working on.
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 6:47 pm
by Lothos
These are my notes, does this seem right?
; #AI= Values range [0, 4] (Axis/Allies refers to the countries, in the event, current faction)
; 0 = Event will fire when all conditions are met
; 1 = Event will fire when all conditions are met and AI is Axis (ignored if Axis human)
; 2 = Event will fire when all conditions are met and AI is Allies (ignored if Allies human)
; 3 = Event will fire when all conditions are met and (AI is Axis OR Allied Multiplayer human controlled)
; 4 = Event will fire when all conditions are met and (AI is Allies OR Axis Multiplayer human controlled)
I am still a little confused with 3 and 4, what happens if both conditions are true?
Lest say it = 3 and AI is Axis and it is a Multiplayer game and Allies are human. Does the event fire twice?
Also what happens if you get a game where a player is playing a specific country instead of all the countries in a faction. So for example lets say a player is playing Russia only and all other countries in the game are AI controlled. How do these events handle that?
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 6:57 pm
by Hubert Cater
Read 3 as if it is an AI game, then the AI needs to be Axis. If it is a multiplayer game then it must be an Allied turn in that multiplayer game.
e.g. imagine a POPUP event that you only want to show to Allied human players.
If it is an AI game it will only show to an Allied human player if the AI is Axis controlled. Otherwise it will not show in an AI game, e.g. it will not show when the AI is Allied.
Read 4 the same way but in reverse.
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 7:01 pm
by Hubert Cater
Also what happens if you get a game where a player is playing a specific country instead of all the countries in a faction. So for example lets say a player is playing Russia only and all other countries in the game are AI controlled. How do these events handle that?
Only UNIT events have extra handling for AI controlled friendlies on your side.
Otherwise the game engine just considers which side is human controlled and which side is AI controlled, not the extra nuance of your side is human controlled but some friendlies on your side you've given up control to the AI.
So just think of the human selected side as
not AI when it comes up to the AI= fields and options.
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 7:03 pm
by Hubert Cater
Lest say it = 3 and AI is Axis and it is a Multiplayer game and Allies are human. Does the event fire twice?
To further clarify this is an either or option, it is either an AI selected game, e.g. Single Player game, or a Multiplayer game, e.g. Hotseat or PBEM.
It cannot be both and have the possibility of firing twice as you are only playing one type of game or the other, but the event can be designed in a way that it can work for either a Single Player game or a Multiplayer game.
Hope that clears it up.
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 7:08 pm
by Hubert Cater
I just edited the updated headers one more time to hopefully provide further clarity
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 7:16 pm
by Lothos
Hubert Cater wrote: Wed Jun 15, 2022 7:08 pm
I just edited the updated headers one more time to hopefully provide further clarity
New descriptions are very clear, thank you!
Re: #AI= ?? Can someone explain this to me
Posted: Wed Jun 15, 2022 7:26 pm
by Lothos
Sorry you mentioned something else
; #DISPLAY_TURN= On what turn do we display this popup event? (values range [0, 2]; Any= 0; Axis Turn= 1; Allied Turn= 2)
Is that command available on all files in the Scripts\Event folder or is it just for some specific txt files?
When I did a global search I only found it in popup.txt and units.txt and there was a description only in those two files
Re: #AI= ?? Can someone explain this to me
Posted: Thu Jun 16, 2022 5:56 pm
by Hubert Cater
Just for UNIT and POPUP events