Jump to content

Multiple use of TriggerOverride in EE


c4_angel

Recommended Posts

Hello folks,

 

I want to check no party member got enemy in sight. My script is

IF
  !TriggerOverride(Player1,See([ENEMY]))
  OR(2)
    !InParty(Player2)
    !TriggerOverride(Player2,See([ENEMY]))
  OR(2)
    !InParty(Player3)
    !TriggerOverride(Player3,See([ENEMY]))
  OR(2)
    !InParty(Player4)
    !TriggerOverride(Player4,See([ENEMY]))
  OR(2)
    !InParty(Player5)
    !TriggerOverride(Player5,See([ENEMY]))
  OR(2)
    !InParty(Player6)
    !TriggerOverride(Player6,See([ENEMY]))
THEN
  RESPONSE #100
    do something
END

It works in vanilla game like BGT, but not in EE (v2.3), if there is no other party member

And if remove Player3 to Player6 parts of the block, if works. Even keep only Player2 and 3 parts, if fails.

 

Anything wrong? Or TriggerOverride is not able to check to many different objects?

Link to comment

Hello folks,

 

I want to check no party member got enemy in sight. My script is

IF
  !TriggerOverride(Player1,See([ENEMY]))
  OR(2)
    !InParty(Player2)
    !TriggerOverride(Player2,See([ENEMY]))
  OR(2)
    !InParty(Player3)
    !TriggerOverride(Player3,See([ENEMY]))
  OR(2)
    !InParty(Player4)
    !TriggerOverride(Player4,See([ENEMY]))
  OR(2)
    !InParty(Player5)
    !TriggerOverride(Player5,See([ENEMY]))
  OR(2)
    !InParty(Player6)
    !TriggerOverride(Player6,See([ENEMY]))
THEN
  RESPONSE #100
    do something
END

It works in vanilla game like BGT, but not in EE (v2.3), if there is no other party member

And if remove Player3 to Player6 parts of the block, if works. Even keep only Player2 and 3 parts, if fails.

 

Anything wrong? Or TriggerOverride is not able to check to many different objects?

Just to understand what you want to check

Either Player1 is solo and sees no enemy or he has party members but there are no enemies about?

Link to comment

Hello folks,

 

I want to check no party member got enemy in sight. My script is

IF
  !TriggerOverride(Player1,See([ENEMY]))
  OR(2)
    !InParty(Player2)
    !TriggerOverride(Player2,See([ENEMY]))
  OR(2)
    !InParty(Player3)
    !TriggerOverride(Player3,See([ENEMY]))
  OR(2)
    !InParty(Player4)
    !TriggerOverride(Player4,See([ENEMY]))
  OR(2)
    !InParty(Player5)
    !TriggerOverride(Player5,See([ENEMY]))
  OR(2)
    !InParty(Player6)
    !TriggerOverride(Player6,See([ENEMY]))
THEN
  RESPONSE #100
    do something
END

It works in vanilla game like BGT, but not in EE (v2.3), if there is no other party member

And if remove Player3 to Player6 parts of the block, if works. Even keep only Player2 and 3 parts, if fails.

 

Anything wrong? Or TriggerOverride is not able to check to many different objects?

 

 

I stumbled over this issue myself when I created my Golem Construction mod. NextTriggerObject/TriggerOverride appears to return 'false' when the specified object does not exist.

For NextTriggerObject the IESDP says that it does not work in OR triggers - I suspect TriggerOverride has the same limitation

Quote

This trigger does not evaluate and does not count as a trigger in an OR() block. If the object cannot be found, the next trigger will evaluate to false.
Link to comment

TriggerOverride() is just an alternate notation of NextTriggerObject(), added for convenience by WeiDU (and more recent versions of NI). It's not directly supported by the game engine (i.e. you won't find it listed in TRIGGER.IDS).

NextTriggerObject() can be used in OR() constructs, but it doesn't count as separate trigger for the OR parameter. It shouldn't really matter if you use the alternate notation "TriggerOverride()" instead, as it always contains a regular trigger that is counted by OR.

Link to comment

I stumbled over this issue myself when I created my Golem Construction mod. NextTriggerObject/TriggerOverride appears to return 'false' when the specified object does not exist.

TriggerOverride() is just an alternate notation of NextTriggerObject(), added for convenience by WeiDU (and more recent versions of NI). It's not directly supported by the game engine (i.e. you won't find it listed in TRIGGER.IDS).

 

NextTriggerObject() can be used in OR() constructs, but it doesn't count as separate trigger for the OR parameter. It shouldn't really matter if you use the alternate notation "TriggerOverride()" instead, as it always contains a regular trigger that is counted by OR.

 

Yes, I think either of it considers same, so I normally use TriggerOverride for it's more readable to me.

I use !InParty() in OR() to prevent it result to a false if e.g. Player2 doesn't exists, as Player3, 4...,

But if I use more than one OR(), the block never work.

 

Your solution make sense to me. Thank you very much.

Link to comment

Just to understand what you want to check

Either Player1 is solo and sees no enemy or he has party members but there are no enemies about?

 

My kit has some buffs and debuffs which last in the whole battle. I want to check if the battle really end - since ActuallyInCombat() is not good enough - then clear the buffs and debuffs.

And some skills are only available if no danger around.

Those are all active no matter the AI mod was turned on or off, so dplayer2/3 is not an option to me.

Link to comment

 

Just to understand what you want to check

Either Player1 is solo and sees no enemy or he has party members but there are no enemies about?

 

My kit has some buffs and debuffs which last in the whole battle. I want to check if the battle really end - since ActuallyInCombat() is not good enough - then clear the buffs and debuffs.

And some skills are only available if no danger around.

Those are all active no matter the AI mod was turned on or off, so dplayer2/3 is not an option to me.

 

I see your intention but I think that conditions like ActuallyInCombat() or CombatCounter(0) or !See([ENEMY]) would not trigger any actions for themself, unless there is another trigger, e.g you set a local and a timer when you get into combat. Then when the local is set and the timer has expired you would check again if you are still in combat. If not your buffs continue.

Or you use NumCreatureVsParty or NumCreatureVsPartyLT even my own experience with this trigger is that it is not very reliable.

Link to comment

 

 

Just to understand what you want to check

Either Player1 is solo and sees no enemy or he has party members but there are no enemies about?

 

My kit has some buffs and debuffs which last in the whole battle. I want to check if the battle really end - since ActuallyInCombat() is not good enough - then clear the buffs and debuffs.

And some skills are only available if no danger around.

Those are all active no matter the AI mod was turned on or off, so dplayer2/3 is not an option to me.

 

I see your intention but I think that conditions like ActuallyInCombat() or CombatCounter(0) or !See([ENEMY]) would not trigger any actions for themself, unless there is another trigger, e.g you set a local and a timer when you get into combat. Then when the local is set and the timer has expired you would check again if you are still in combat. If not your buffs continue.

Or you use NumCreatureVsParty or NumCreatureVsPartyLT even my own experience with this trigger is that it is not very reliable.

 

Yes, there are other triggers e.g. check if kit matches, though I have not ever tested/found what you mentioned.

I have changed my script using Agent77's idea, split 1 block to 6.

Besides, I think NumCreatureVsParty does not support a negative value.

Link to comment

 

 

 

Just to understand what you want to check

Either Player1 is solo and sees no enemy or he has party members but there are no enemies about?

 

My kit has some buffs and debuffs which last in the whole battle. I want to check if the battle really end - since ActuallyInCombat() is not good enough - then clear the buffs and debuffs.

And some skills are only available if no danger around.

Those are all active no matter the AI mod was turned on or off, so dplayer2/3 is not an option to me.

 

I see your intention but I think that conditions like ActuallyInCombat() or CombatCounter(0) or !See([ENEMY]) would not trigger any actions for themself, unless there is another trigger, e.g you set a local and a timer when you get into combat. Then when the local is set and the timer has expired you would check again if you are still in combat. If not your buffs continue.

Or you use NumCreatureVsParty or NumCreatureVsPartyLT even my own experience with this trigger is that it is not very reliable.

 

Yes, there are other triggers e.g. check if kit matches, though I have not ever tested/found what you mentioned.

I have changed my script using Agent77's idea, split 1 block to 6.

Besides, I think NumCreatureVsParty does not support a negative value.

 

Would not NumLT 1 trigger if there is no one. Splitting your code into 6 is another possibility,

Link to comment

I think it refuses to compile. Or at least used to.

I've seen !TriggerOverride() die on non-existing objects too, fwiw.

More specifically, the SoD's "return to the camp" kick out dialog. In this example, the !TO had to be bundled together with !Range to allow for missing ff_camp trigger in the current area, and also it wouldn't work in reverse order, e.g. TO first and Range second.

GlobalGT("bd_npc_camp_chapter","global",1) GlobalLT("bd_npc_camp_chapter","global",5) OR(2) !Range("ff_camp",999) !TriggerOverride("ff_camp",IsOverMe("corwin"))

Link to comment

What happens if you write TriggerOverride(Player2,!See([ENEMY])) ?

As from Wisp, syntax error.

 

 

I think it refuses to compile. Or at least used to.

 

I've seen !TriggerOverride() die on non-existing objects too, fwiw.

 

More specifically, the SoD's "return to the camp" kick out dialog. In this example, the !TO had to be bundled together with !Range to allow for missing ff_camp trigger in the current area, and also it wouldn't work in reverse order, e.g. TO first and Range second.

GlobalGT("bd_npc_camp_chapter","global",1) GlobalLT("bd_npc_camp_chapter","global",5) OR(2) !Range("ff_camp",999) !TriggerOverride("ff_camp",IsOverMe("corwin"))

 

Yes, so I used !InParty(PlayerX) with an OR() to prevent that, and I happen write that before !TO.

I wonder why it's fine in BGT, maybe took benefit from ToBEx?

Link to comment
And if remove Player3 to Player6 parts of the block, if works. Even keep only Player2 and 3 parts, if fails.

 

Ah. This actually makes sense, now that I've looked up my own case. The problem, afaict, is that !TO("missing_object") must be the last in the scripting block to be properly caught by OR (don't ask me why, I've no idea). In case of players, the !TO(Player2) is followed by other Player3-6 checks.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...