NGLE question. Conditions and Globaltrigger question

builders help builders

Moderator: eTux

Post Reply
leonvdn
Newbie
Newbie
Posts: 40
Joined: 01 Oct 2010 19:56

NGLE question. Conditions and Globaltrigger question

Post by leonvdn » 06 Apr 2014 19:54

Hello folks. Need some help. I have been trying to get an addeffect to activate on Lara when the letter L is pressed on the keyboard. This works fine with a globaltrigger (GlobalTrigger=8, IGNORE, GT_CONDITION_GROUP, IGNORE, 25, 26, IGNORE). But then I wanted the same letter to deactivate the addeffect. My intended solution was to get the initial globaltrigger to activate a flame emmiter and then have a second globaltrigger which would use the flame emmiters on and off status to trigger a different triggergroup. Confused? here's what I've got so far.

The first portion is all exported triggers which arent part of the final script but I've included them for clarity. The stuff between the ;-------------------------------------- lines are the actual script parts.

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:54) for OBJECT(607)
; <#> : FLAME_EMITTER ID 607 in sector (1,6) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is not active
; Values to add in script command: $9000, 607, $40E

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:56) for OBJECT(607)
; <#> : FLAME_EMITTER ID 607 in sector (1,6) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is active
; Values to add in script command: $9000, 607, $30E

; Set Trigger Type - ACTION 49
; Exporting: TRIGGER(1073:0) for ACTION(0)
; <#> : LARA ID 0 in sector (8,8) of Room41
; <&> : Effect. Remove from <#>Enemy the (E)AddEffect from script.txt
; (E) : AddEffect= 4
; Values to add in script command: $5000, 0, $431

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:58) for OBJECT(607)
; <#> : FLAME_EMITTER ID 607 in sector (1,6) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is living
; Values to add in script command: $9000, 607, $20E

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:62) for OBJECT(607)
; <#> : FLAME_EMITTER ID 607 in sector (1,6) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is dead
; Values to add in script command: $9000, 607, $E

; Set Trigger Type - ACTION 43
; Exporting: TRIGGER(43:0) for ACTION(603)
; <#> : FLAME_EMITTER ID 603 in sector (1,9) of Room1
; <&> : Trigger. (Moveable) Activate <#>Object with (E)Timer value
; (E) : Timer= +00
; Values to add in script command: $5000, 603, $2B

; Set Trigger Type - ACTION 44
; Exporting: TRIGGER(44:0) for ACTION(603)
; <#> : FLAME_EMITTER ID 603 in sector (1,9) of Room1
; <&> : Trigger. (Moveable) Untrigger <#>Object with (E)Timer value
; (E) : Timer= +00
; Values to add in script command: $5000, 603, $2C

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:58) for OBJECT(603)
; <#> : FLAME_EMITTER ID 603 in sector (1,9) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is living
; Values to add in script command: $9000, 603, $20E

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:62) for OBJECT(603)
; <#> : FLAME_EMITTER ID 603 in sector (1,9) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is dead
; Values to add in script command: $9000, 603, $E

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:56) for OBJECT(603)
; <#> : FLAME_EMITTER ID 603 in sector (1,9) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is active
; Values to add in script command: $9000, 603, $30E

; Set Trigger Type - CONDITION 14
; Exporting: CONDITION(14:54) for OBJECT(603)
; <#> : FLAME_EMITTER ID 603 in sector (1,9) of Room1
; <&> : Creature. <#>Creature is currently (E)
; (E) : Enemy is not active
; Values to add in script command: $9000, 603, $40E

;--------------------------------------
;L for light

AddEffect=4, ADD_LIGHT_FLAT, FADD_IGNORE_STATUS+FADD_CONTINUE_EMIT, JOINT_SINGLE_MESH, 0, 0, 0, IGNORE, IGNORE, 40, IGNORE, MIST_COL_AZURE

Triggergroup=25, $8000, 38, $10C, $9000, 603, $40E
Triggergroup=26, $5000, 0, $430, $5000, 603, $2B
GlobalTrigger=8, IGNORE, GT_CONDITION_GROUP, IGNORE, 25, 26, IGNORE

Triggergroup=27, $8000, 38, $10C, $9000, 603, $30E
Triggergroup=28, $5000, 0, $431, $5000, 603, $2C
GlobalTrigger=9, IGNORE, GT_CONDITION_GROUP, IGNORE, 27, 28, IGNORE
;--------------------------------------

User avatar
Titak
Member
Member
Posts: 880
Joined: 04 Sep 2003 10:47
Location: Drenthe, The Netherlands

Re: NGLE question. Conditions and Globaltrigger question

Post by Titak » 10 Apr 2014 18:43

Instead of using the flame-emitters I'd use setting a bit is some variable and using this as a condition.
By default all bits are cleared in a given variable.
For example we are going to use variable Local Short Delta2

-----------------------------------------------------------------------------------------------------
AddEffect=4, ADD_LIGHT_FLAT, FADD_IGNORE_STATUS+FADD_CONTINUE_EMIT, JOINT_SINGLE_MESH, 0, 0, 0, IGNORE, IGNORE, 40, IGNORE, MIST_COL_AZURE

TriggerGroup=25, $8000, 38, $10C, $8000, 85, $2D ; condition that L is pressed AND condition that bit0 is cleared in LSD2
; Set Trigger Type - CONDITION 45
; Exporting: CONDITION(45:62) for PARAMETER(85)
; <#> : Local Short Delta2
; <&> : Variables. The <#>Numeric Variable has the (E)Bit clear
; (E) : Bit 0 ($00000001 ; 1)
; Values to add in script command: $8000, 85, $2D

TriggerGroup= 26, $5000, 0, $430, $2000, 234, $55 ; add Addeffect4 to Lara, set bit0 in LSD2
; Set Trigger Type - FLIPEFFECT 234
; Exporting: TRIGGER(85:62) for FLIPEFFECT(234)
; <#> : Variables. Numeric. Set in <&>Variable the (E)bit
; <&> : Local Short Delta2
; (E) : Bit 0 ($00000001 ; 1)
; Values to add in script command: $2000, 234, $55

GlobalTrigger=8, IGNORE, GT_CONDITION_GROUP, IGNORE, 25, 26, IGNORE



Triggergroup=27, $8000, 38, $10C, $8000, 85, $2C ; condition that L is pressed AND condition that LSD2 has bit0 set
; Set Trigger Type - CONDITION 44
; Exporting: CONDITION(44:62) for PARAMETER(85)
; <#> : Local Short Delta2
; <&> : Variables. The <#>Numeric Variable has the (E)Bit set
; (E) : Bit 0 ($00000001 ; 1)
; Values to add in script command: $8000, 85, $2C

Triggergroup=28, $5000, 0, $431, $2000, 235, $55 ; remove AddEffect4 from Lara, clear bit in LSD2
; Set Trigger Type - FLIPEFFECT 235
; Exporting: TRIGGER(85:62) for FLIPEFFECT(235)
; <#> : Variables. Numeric. Clear in <&>Variable the (E)bit
; <&> : Local Short Delta2
; (E) : Bit 0 ($00000001 ; 1)
; Values to add in script command: $2000, 235, $55

GlobalTrigger=9, IGNORE, GT_CONDITION_GROUP, IGNORE, 27, 28, IGNORE
-----------------------------------------------------------------------------------------------------

I haven't tested this but it's what I would try first.
As you can see, the system is basically the same, only variable is used instead of a flame-emitter.

You can ofcourse use any other variable, if LSD2 is already used for something else.
Nothing is in contradiction with nature,
only in contradiction with what we know of it.


Image

leonvdn
Newbie
Newbie
Posts: 40
Joined: 01 Oct 2010 19:56

Re: NGLE question. Conditions and Globaltrigger question

Post by leonvdn » 11 Apr 2014 22:10

Thanks Titak. I'm going to try that later! :2thumbsup:

leonvdn
Newbie
Newbie
Posts: 40
Joined: 01 Oct 2010 19:56

Re: NGLE question. Conditions and Globaltrigger question

Post by leonvdn » 12 Apr 2014 16:29

No joy, the key input apparently likes to be the only condition. Ah well, no problem, I'll just use flares :D

User avatar
Titak
Member
Member
Posts: 880
Joined: 04 Sep 2003 10:47
Location: Drenthe, The Netherlands

Re: NGLE question. Conditions and Globaltrigger question

Post by Titak » 15 Apr 2014 23:54

I just checked my own scripts in which I'm also using a setup that involves a keyboard key (the T key) and some conditions.
Turns out I used a GT_KEYBOARD_CODE GT instead of a GT_CONDITION_GROUP.

Like this:
TriggerGroup= 61, *several condition triggers*
TriggerGroup= 35, *several activating triggers*
GlobalTrigger= 28, IGNORE, GT_KEYBOARD_CODE, 20, 61, 35, IGNORE


So this setup is using both conditions in the form of exported triggers and the condition that a certain key is pressed. :D
20 stands for the T key. You can find the list of keys and the corresponding values in NG-Center Reference.
Nothing is in contradiction with nature,
only in contradiction with what we know of it.


Image

leonvdn
Newbie
Newbie
Posts: 40
Joined: 01 Oct 2010 19:56

Re: NGLE question. Conditions and Globaltrigger question

Post by leonvdn » 22 Apr 2014 03:33

Oo, very nice. Going to test tomorrow. Thanks Titak :2thumbsup:

leonvdn
Newbie
Newbie
Posts: 40
Joined: 01 Oct 2010 19:56

Re: NGLE question. Conditions and Globaltrigger question

Post by leonvdn » 27 Apr 2014 11:56

Update. L key turns the effect on fine with your script but refuses to turn it off. Its like each key can only have one globaltrigger despite the conditions being different. Using a different key to deactivate the effect just seems sloppy, meh :(

User avatar
Titak
Member
Member
Posts: 880
Joined: 04 Sep 2003 10:47
Location: Drenthe, The Netherlands

Re: NGLE question. Conditions and Globaltrigger question

Post by Titak » 28 Apr 2014 15:32

I'm using the T button to take the torch out of the inventory AND to stow it back in there when Lara has the torch (either burning or not burning 8) ) in her hand.
Wait... I just checked my scripts again and I see I failed to put in the second set of conditions and triggers: the second set of triggers have to do with putting away the torch when pressing T are using a GT with GT_CONDITION_GROUP instead of GT_KEYBOARD_CODE.

So my script for the torch is like this:
TriggerGroup= 61, condition that variable*** has bit0 cleared, perhaps other conditions
TriggerGroup= 35, activating triggers (turn effect on), set bit0 in variable***
GlobalTrigger= 28, IGNORE, GT_KEYBOARD_CODE, 20, 61, 35, IGNORE

TriggerGroup= 42, condition that variable*** has bit0 set, condition that key L is pressed, perhaps other conditions
TriggerGroup= 43, activating triggers (turn effect off), clear bit0 in variable***
GlobalTrigger= 21, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 42, 43, -1


I'm not using a variable in my torch setup but I'm using the conditions that have to do with whether or not Lara has a torch in her hand instead.
It works like a charm.
The variable should be used to distinguish between the conditions, since the conditions are basically the same (pressing L button).
Nothing is in contradiction with nature,
only in contradiction with what we know of it.


Image

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests