Events and AI triggers
Posted: Fri Oct 05, 2007 3:20 am
I want to have an event triggered only if the nation is played by the AI. I am aware of this set of commands, but, have not had any success using them.
CheckAILevel command, syntax is: CheckAILevel = AILevel
// AI Level
_aiHuman = 0;
_aiLvlEasy = 1;
_aiLvlNormal = 2;
_aiLvlHard = 3;
_aiLvlVHard = 4;
Here's an event I created based on the above (done as a place holder, if the event triggers, that means the player is human, and 'blocks' other AI specific events, if the player is the AI, then the event should not trigger, thereby allowing AI events to take place).
I created an event that looked to see if the AI level was zero (human according to the above), and then this event would deactivate other AI specific events (as I didn't want to have to do a series of events for each level). However, here's what I got in the script report with the CSA as AI...
Looking at line 2411. Even though the player was AI, and the selection was Zero, it still triggered this as True (even though it should not). I want the event to trigger, if and only if, the player is human (thereby, if this event is triggered, all other events tagged on will not fire). If the player is any AI (i.e., not player 0), then the event should not trigger, thereby allow all of the other AI events to fire.
Here's the event that should have triggered, but didn't (even though the AI was playing the CSA). Note that line 2423 says False (that the above event actually did trigger).
Any help as to what is wrong in my event?
CheckAILevel command, syntax is: CheckAILevel = AILevel
// AI Level
_aiHuman = 0;
_aiLvlEasy = 1;
_aiLvlNormal = 2;
_aiLvlHard = 3;
_aiLvlVHard = 4;
Here's an event I created based on the above (done as a place holder, if the event triggers, that means the player is human, and 'blocks' other AI specific events, if the player is the AI, then the event should not trigger, thereby allowing AI events to take place).
Code: Select all
SelectFaction = $CSA
StartEvent = evt_nam_AIonEvent|1|1|NULL|NULL|NULL|NULL
Conditions
MinDate = 1861/05/01
CheckAILevel = 0
Actions
EndEvent
I created an event that looked to see if the AI level was zero (human according to the above), and then this event would deactivate other AI specific events (as I didn't want to have to do a series of events for each level). However, here's what I got in the script report with the CSA as AI...
Code: Select all
Line 2405: SelectFactions, 1 Faction selected: Confederate States of America
Line 2406: Started processing event: evt_nam_AIonEvent
Line 2406: This event is not yet referenced, base number of allowed occurences 1
Line 2409: Min date evaluated: 1861/05/01 converted to turn 2673 current turn 2678 True
Line 2411: CheckAILevel: Checking AI Level of faction Confederate States of America at least equal to 0 True
Line 2413: Entering triggered actions for event evt_nam_AIonEvent
Line 2415: Finished processing event: evt_nam_AIonEvent
Looking at line 2411. Even though the player was AI, and the selection was Zero, it still triggered this as True (even though it should not). I want the event to trigger, if and only if, the player is human (thereby, if this event is triggered, all other events tagged on will not fire). If the player is any AI (i.e., not player 0), then the event should not trigger, thereby allow all of the other AI events to fire.
Here's the event that should have triggered, but didn't (even though the AI was playing the CSA). Note that line 2423 says False (that the above event actually did trigger).
Code: Select all
Line 2417: SelectFactions, 1 Faction selected: Confederate States of America
Line 2418: Started processing event: evt_nam_CSA_Beauregard1
Line 2418: This event is not yet referenced, base number of allowed occurences 1
Line 2421: Min date evaluated: 1861/07/01 converted to turn 2677 current turn 2678 True
Line 2422: Max date evaluated: 1861/08/01 converted to turn 2679 current turn 2678 True
Line 2423: EvalEvent evaluated: Checking evt_nam_AIonEvent 1 equal to 0 False
Line 2431: Finished processing event: evt_nam_CSA_Beauregard1
Any help as to what is wrong in my event?