Jump to content


Photo

Discussion about script triggers

triggers bgee bg2ee pstee

9 replies to this topic

#1 argent77

argent77
  • Modders
  • 804 posts
  • Gender:Male

Posted 30 September 2017 - 01:49 AM

IESDP does not yet provide descriptions for a number of script triggers. This topic is intended to present and discuss descriptions for new or existing script triggers, so that they can be added to IESDP eventually.

The following BG(2)EE triggers are still lacking a meaningful description:
Spoiler

The following PSTEE triggers are not listed on IESDP yet:
Spoiler

Edited by argent77, 30 September 2017 - 02:12 PM.


#2 Roxanne

Roxanne

    Modder

  • Modders
  • 2041 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 30 September 2017 - 03:07 AM

I used these on occasions in my mods:

 

0x40C6 G(S:ResRef*,I:Num*)
Shorthand for Global

0x40C7 GGT(S:ResRef*,I:Num*)
Shorthand for GlobalGT

0x40C8 GLT(S:ResRef*,I:Num*)
Shorthand for GlobalLt

 

I never saw this one used anywhere

0x40F1 ModalStateObject(O:Object*,I:ModalState*Modal)
No description yet.

 

Only ever used

0x40C9 ModalState(I:State*MODAL)
Returns true only if the active CRE is in the state/mode specified. e.g. detecting traps.

e.g.

IF
    ActionListEmpty()
    AreaType(DUNGEON)
    CombatCounter(0)
    !See([ENEMY])
    !ModalState(DETECTTRAPS)
    OR(2)
        !StateCheck(Myself,STATE_INVISIBLE)
        !StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
THEN
    RESPONSE #100
        FindTraps()
END


The Sandrah Saga!

another piece of *buggy, cheesy, unbalanced junk*

 

 

 


#3 argent77

argent77
  • Modders
  • 804 posts
  • Gender:Male

Posted 30 September 2017 - 03:40 AM

I assume G/GGT/GLT are all using GLOBAL scope implicitly (same as the SG() action counterpart)?

#4 argent77

argent77
  • Modders
  • 804 posts
  • Gender:Male

Posted 30 September 2017 - 04:00 AM

Looks like ModalStateObject() does exactly what the name suggests:

0x40F1 ModalStateObject(O:Object*,I:ModalState*Modal)
Returns true only if the specified object is in the state/mode specified. e.g. detecting traps.



#5 Roxanne

Roxanne

    Modder

  • Modders
  • 2041 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 30 September 2017 - 04:07 AM

I assume G/GGT/GLT are all using GLOBAL scope implicitly (same as the SG() action counterpart)?

Yes.

I found no equivalent for LOCALS or Area references.


The Sandrah Saga!

another piece of *buggy, cheesy, unbalanced junk*

 

 

 


#6 Avenger

Avenger
  • Modders
  • 3794 posts
  • Gender:Male
  • Location:Hungary

Posted 30 September 2017 - 04:15 AM

Yeah, nothing uses modalstateobject.  It was originally made for the shaman dance but now that feature uses an effect 

It remained in the engine because it might be useful later. 



#7 argent77

argent77
  • Modders
  • 804 posts
  • Gender:Male

Posted 30 September 2017 - 05:16 AM

This info is based on the GiveOrder() action description and verified by a quick test in BG1EE:

0x0006 ReceivedOrder(O:Object*,I:Order ID*)
This trigger is used in conjunction with the GiveOrder action, and works in a similar way to the Heard trigger. Only one creature at a time responds to an order, and creatures do not detect their own orders. The creature must be in visual range for this trigger to work.



#8 argent77

argent77
  • Modders
  • 804 posts
  • Gender:Male

Posted 30 September 2017 - 09:27 AM

The following triggers appear to be related to the unselectable state from script action MakeUnselectable() or effect opcode 365:

0x406D UnselectableVariable(I:Num*)
Returns true only if the active creature is for exactly the specified number of ticks (1/15th seconds) left under the effect of the script action MakeUnselectable() or opcode 365.
Note: By default in BG2EE creatures stop processing scripts while under effect of the script action MakeUnselectable().

0x406E UnselectableVariableGT(I:Num*)
Returns true only if the active creature is for more than the specified number of ticks (1/15th seconds) left under the effect of the script action MakeUnselectable() or opcode 365.
Note: By default in BG2EE creatures stop processing scripts while under effect of the script action MakeUnselectable().

0x406F UnselectableVariableLT(I:Num*)
Returns true only if the active creature is for less than the specified number of ticks (1/15th seconds) left under the effect of the script action MakeUnselectable() or opcode 365.
Note: By default in BG2EE creatures stop processing scripts while under effect of the script action MakeUnselectable().



#9 argent77

argent77
  • Modders
  • 804 posts
  • Gender:Male

Posted 30 September 2017 - 10:57 AM

0x40F8 CanEquipRanged()
Returns true only if the active creature can switch to a ranged weapon that is ready for use (e.g. a throwing weapon, such as darts, or a launcher with corresponding ammo, such as bow and arrow).

0x40F9 ImmuneToSpellLevel(O:Object*,I:Level*)
Returns true if the specified object is immune to spells of the level specified by the 2nd parameter.

0x40FB IsForcedRandomEncounterActive(S:Area*)
Returns true only if a random encounter to the specified area has been initialized by a preceding call of ForceRandomEncounter() or ForceRandomEncounterEntry().

0x4103 CheckItemSlot(O:Object*,S:Item*,I:Slot*SLOTS)
Returns true only if the item specified in the 2nd parameter can be found in the inventory slot (taken from SLOTS.IDS) of the specified object.

0x4104 CurrentAmmo(S:ResRef*,O:Object*)
Returns true only if the specified object has a ranged weapon with the ammo specified by ResRef equipped.

Edited by argent77, 30 September 2017 - 02:12 PM.


#10 lynx

lynx
  • Modders
  • 3093 posts
  • Gender:Male
  • Location:Ljubljana, Slovenija

Posted 11 November 2017 - 09:03 AM

Info up to this point has been merged into iesdp, thanks Argent!


GemRB - IE anywhere.
Mages needed! Looking for Planescape: Torment testers
Market android version IS NOT SUPPORTED ANYMORE: reported bugs will be ignored! Still looking for builders ...



Reply to this topic



  



Also tagged with one or more of these keywords: triggers, bgee, bg2ee, pstee

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users