Join Date: Nov 2007
Raymondīs "features you could already have"-thread
In this thread I want to show some features, which are possible by effectively using the trng. I played around a lot with different things, but Iīm not up to build a complete level yet. I may do so, but I donīt want to hold back the features any more. So everybody is invited to use these features, if you are able to do so. As itīs the same like releasing objects I expect to be credited then.
I donīt give tuts here. You have to know the trng-basics already by studying, the NG_Center reference, Paolones tutorial projects, tuts here and on Skribblerz etc.
reusable puzzle item: post 4, page 1
horizontally moving platform: post 16, page 2
turnswitch: post 26, page 3 and also post 32-48 on pages 4/5 (especially post 45), see also 86-96, page 9/10
intelligent hints in game: post 53, page 6
animation commands: post 59, page 6
enemy HP-counter (similar to TREP-patch): post 60, page 6
Lara on retracting parallel bar: post 67, page 7
Using several switches in a certain order: page 10, post 98
Avoiding Magical Boboon death: page 10,post 99
underwater puzzle/key/switch: post 101, page 11
multiple Pressure Plates, which move down a half a click, as Lara steps on them and moves up again to the original position, if Lara leaves them: post 108, page 11
Object interaction via an inventory item: post 110, page 11
Last edited by Raymond; 08-10-11 at 13:27.
Join Date: Nov 2007
The reusable puzzle item
Letīs start with this. With the normal puzzle hole slot you can only insert a puzzle item and trigger things by it. But why you shouldnīt be able to take the puzzle item back and use again?
You wonīt be able to use the puzzlehole-slot to accomplish this, because the hardcoded stuff interferes with our idea. This also means, that you canīt use the usual trigger setup with the switch-trigger. So I place the puzzle hole/puzzle done-objects in "blank" animating mip-slots. Both objects area placed on the same square on the same place. The puzzle done-object is made invisible with the action trigger "Perform (E) flipeffect on <#>object; (E) : 21: Hide object. Makes #ANIMATING invisible" before Lara approaches the puzzle hole.
So what we have to do, so that Lara does the same stuff, as she would do on a normal puzzle hole: First on pressing action in front of it, the inventory pops up at the puzzle item, she aligns itself to an ideal position and the inserting animation is played? Then second at the appropriate frame all, what has to be triggered, is triggered: the puzzle-done object appears, the puzzle item is removed from the inventory, doors are opened or whatever else you want to trigger. You have to study especially Paolones animation tutorial project to understand all of this. The Animation-script command together with TestPosition-command is needed to accomplish the first part, and the use of an animcommand gives us the means to accomplish the triggering. There are always more than one solution to a problem, but this solution is relatively effective and works for sure.
And now the script entries. Iīll add later on more and more explanations!
;reusable puzzle item
;1.part: Inserting the Puzzleitem
Animation= 59, KEY1_ACTION,IGNORE, FAN_ALIGN_TO_ENV_POS + FAN_PERFORM_TRIGGER_GROUP,ENV_MULT_CONDITION,12 ,IGNORE, 2
Very important to understand the Animation-command above is, that I use the Fan-flag FAN_PERFORM_TRIGGER_GROUP. So the first argument 59 isnīt a number of an animation here, but itīs the number of a triggergroup (TG). This TG will be executed under the conditions given in the Animation command. First you have to press the Action-key. Some more conditions are given in the multiple environmental condition with the number 12 (see below). The last condition given by the last argument is, that Lara has stateID 2 (standing).
The Fan-flag FAN_ALIGN_TO_ENV_POS causes the alignment of Lara in front of the puzzle hole to an ideal position, in which she can execute the animation.
Triggergroup= 59,$2000, 306, $101,$2000, 77, $86;pop up inventory on puzzleitem2, perform animation 134
This is the TG, which is exexcuted under the conditions given in the Animation-command. It causes the popup of the inventoy at the puzzle item and the execution of the animation.
Inventory-Item. Pop up inventory to select the <&>Item in (E)way
; <&> : PUZZLE_ITEM2 Slot=176
; (E) : If item si missing play LARA_SAY_NO sound
Lara. (Animation) Force <&>Animation (0-255) of (E)slot for Lara
; <&> : 134 Animation
; (E) : SLOT_000 LARA
MultEnvCondition=12,ENV_ITEM_TEST_POSITION,4,IGNOR E,ENV_FREE_HANDS,IGNORE,IGNORE,ENV_CONDITION_TRIGG ER_GROUP,60,IGNORE
This is the multiple environmental condition used in the Animation-command. It consist of three part: first, that Lara is in a position given by TestPosition-command 4 (see below), second that she has free hands and third that she fulfills some more conditions, stored in the Condition-TG 60.
TestPosition= 4, IGNORE, Animating8_Mip,-300,+300,-100,+100,200-200,200+200,-$1000,$1000,-$1000,$1000,-$1000,$1000
In this command the position of Lara relative to the puzzle hole in the Animating8_Mip-slot is defined. It conatains three room-coordinates and three facing-coordinates. Basically it defines a box of possible positions in the room, fromwhere lara is aligned to the ideal position and then the animation (or here the TG 59) is then executed. The given coordinates can be used for every puzzle hole-situation.
Triggergroup= 60,$8000, 0, $2D,$8000, 176, $2; GBA1 bit0 clear?,puzzleitem2 present?
In this condition-TG there are two conditions stored, which are used in the MultEnvCondition 12 above. In the first condition it checks, if in variable GlobalByteAlpha1 the bit0 is clear. This is a sign for the engine, that the puzzle hole is currently unused. In the second condition is checks, if the Puzzle Item2 is present in the inventory.
Global Byte Alfa1
; <&> : Variables. The <#>Numeric Variable has the (E)Bit clear
; (E) : Bit 0 ($00000001 ; 1)
; <&> : Inventory. Present <#>inventory_item.
Triggergroup= 62,$9000, 117, $236,$5000, 116, $160D,$5000, 117, $150D,$2000, 234, $0,$2000, 47, $1, ....
; TG 62 (exported Animcommandtrigger): animating8mip 117 closer then 2 clicks?,116 visible, 117 invisible,set gba1 bit 0, remove puzzleitem2 from inventory...- add the exported triggers for the stuff you want to trigger
The execution of TG 62 is exported as an animcommand to frame 76 of animation 134:
Add a SetPosition anim command with following values:
Set Position [-24500]  
Infos about exported trigger
Exporting: TRIGGER(62:0) for FLIPEFFECT(118)
<#> : TriggerGroup. Perform <&>TriggerGroup from script.dat in (E)way
<&> : TriggerGroup= 62
(E) : Mutiple performing (to use when in TriggerGroup there is some condition)
You go then to wadmerger, open animation 134 of Lara in the AnimationEditor in insert the Animcommand Set Position [-24500]   to this animation of Lara, which is the puzzle-insert-animation.
The TG 62 contains the following triggers:
The first one is a condition which checks for the distance of Lara relative to the puzzle hole. So we are sure, that the triggers are only executed in front of this puzzle hole and not at other times, if Lara executes the animation.
Lara. Distance. Lara is distant by <#>Moveable less or even than (E)Clicks
; (E) : Value= 2
The next to triggers make the puzzle hole invisible and the puzzle done visible.
Perform (E) flipeffect on <#>object
; (E) : 21: Hide object. Makes #ANIMATING invisible
Perform (E) flipeffect on <#>object
; (E) : 22: Show object. Makes #ANIMATING visible
Then we have the flipeffect Variables. Numeric. Set in <&>Variable the (E)bit; <&> : Global Byte Alfa1; (E) : Bit 0 ($00000001 ; 1). This bit is set to give the engine a sign, that the puzzle hole is currently used.
We have to remove the puzzle item from the inventory, too:
Inventory-Item. Remove <&>inventory-item from inventory
; <&> : PUZZLE_ITEM2 Slot=176
Finally you would add your exported triggers for the things, which you want to achieve by all the action, like opening doors etc..
;2.part: Getting back the puzzle item
Animation= 469, KEY1_ACTION,IGNORE, FAN_ALIGN_TO_ENV_POS, ENV_MULT_CONDITION,11,IGNORE, 2;multiple puzzle
This time the animation command trigges animation 469, the puzzle item take away-animation. I only mirrored animation 134 to create this one. It works good enough.
MultEnvCondition=11,ENV_CONDITION_TRIGGER_GROUP,58 ,IGNORE,ENV_ITEM_TEST_POSITION, 4,IGNORE,ENV_FREE_HANDS,IGNORE,IGNORE
In this case we use three environmental conditions, which are stored in this MultEnvCondition-command as conditions, inder which animations 469 should be executed. Again we have another condition-TG 58, which contains the condition, if the bit in GlobalByteAlpha1 is set as a sign, that the puzzle item is inserted and can be taken out (see also below). As second condition we have again the TestPosition. Itīs the same as above for the inserting of the puzzle item, of course. As third condition Lara mus have free hands.
Triggergroup= 58,$8000, 0, $2C; gba1 bit0 set?
Triggergroup= 61,$9000, 117, $236,$2000, 48, $101,$5000, 116, $150D,$5000, 117, $160D,$2000, 235, $0, ...
; TG 61 (exported Animcommandtrigger): animating8mip 117 closer then 2 clicks?, Add puzzleitem2 to inventory,116 invisible, 117 visible,clear gba1 bit 0,...- add the exported trigger, if you want to trigger something
The execution of this TG is exorted as animcommand (Set Position -24552,118,61) into animation 469, frame 32.
In this TG we have triggers to add puzzle item2 to the inventory again, making puzzle done invisble and puzzle hole visible, clearing bit 0 in the variable GlobalByteAlpha1 as a sign for the engine, that we have a free puzzle hole again and then you should add your triggers for what you want to achieve like closing the door again or whatever else.
Last edited by Raymond; 12-08-10 at 19:26.
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Great idea Raymond!
If it walks like a duck and if it quacks like a duck, it is a duck.
Join Date: Apr 2009
Location: Salem, Oregon
Thanks Raymond! Gonna watch this thread now!
If it walks like a quack and if it ducks like a quack, it is a quack.
Join Date: Mar 2009
Location: France, Paris
Oh thank you Raymond!
I'm planning to use a puzzle like that and I tried some things with NGLE but I didn't search to much (thinking of makin' it latter )... but you did it. For sure I'll credit you (because you avoid me some headache ).
Btw, I though about some condition triggers with global triggers associated to flipmaps and so on : a real mess ! I'm not good at scripting
LNG as known as Kentin ;)
Join Date: Aug 2003
Great Idea Raymond this is very useful, pretty much like the TREP flipcodes
I'm planning on using such a puzzle system, however I'd like to ask if someone knows how to make Lara's scream mesh works through script since I've done everything, but the model does not support the scream object.