www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
 
Thread Tools
Old 27-08-11, 07:45   #101
Raymond
Archaeologist
 
Join Date: Nov 2007
Posts: 1,689
Default

Underwater puzzle use/key use/switch use:
With the trng-animation scripting underwater puzzle use, key use or switch use is possible.

I post the script for the puzzle use here:

Code:
Animation= 	58, KEY1_ACTION,IGNORE, FAN_PERFORM_TRIGGER_GROUP,ENV_MULT_CONDITION,12,IGNORE, -108
MultEnvCondition=12,ENV_ITEM_TEST_POSITION,4,IGNORE,ENV_CONDITION_TRIGGER_GROUP,60,IGNORE
TestPosition=	4,IGNORE,Puzzle_Hole3,-512,+512,-512-512,-512+512,108-512,108+512,-12000,12000,-12000,12000,-12000,12000

; Exporting: CONDITION(45:62) for PARAMETER(4)
; <#> : Global Byte Beta1
; <&> : Variables. The <#>Numeric Variable has the (E)Bit clear
; (E) : Bit  0  ($00000001 ; 1)
; Values to add in script command: $8000, 4, $2D

; Set Trigger Type - CONDITION 2
; Exporting: CONDITION(2:0) for PARAMETER(177)
; <#> : PUZZLE_ITEM3                    	Slot=177
; <&> : Inventory. Present <#>inventory_item.
; (E) : 
; Values to add in script command: $8000, 177, $2

Triggergroup= 	60,$8000, 4, $2D,$8000, 177, $2

; Set Trigger Type - FLIPEFFECT 306
; Exporting: TRIGGER(2:0) for FLIPEFFECT(306)
; <#> : Inventory-Item. Pop up inventory to select the <&>Item in (E)way
; <&> : PUZZLE_ITEM3                    	Slot=177
; (E) : Silent way
; Values to add in script command: $2000, 306, $2

; Set Trigger Type - FLIPEFFECT 234
; Exporting: TRIGGER(4:0) for FLIPEFFECT(234)
; <#> : Variables. Numeric. Set in <&>Variable the (E)bit
; <&> : Global Byte Beta1
; (E) : Bit  0  ($00000001 ; 1)
; Values to add in script command: $2000, 234, $4

Triggergroup=	58,$2000, 306, $2,$2000, 234, $4
The first part handles the pop up of the inventory, if Lara is in the right position (For this we use the TestPosition-command. The coordinate box is derived from the box, which is used for the uw-switch),is floating in the water (animation 108) and a certain bit in a variable is clear (this is a sign for the engine, that this puzzle wasn´t used yet). In the Animation-command we use the possibility to trigger a Tg instead of a animation with the help of the flag FAN_PERFORM_TRIGGER_GROUP.

Code:
Animation= 	59, IGNORE,IGNORE, FAN_ALIGN_TO_ENV_POS+FAN_PERFORM_TRIGGER_GROUP,ENV_MULT_CONDITION,13,IGNORE, -108
MultEnvCondition=13,ENV_ITEM_TEST_POSITION,4,IGNORE,ENV_CONDITION_TRIGGER_GROUP,56,IGNORE

; Exporting: CONDITION(44:62) for PARAMETER(4)
; <#> : Global Byte Beta1
; <&> : Variables. The <#>Numeric Variable has the (E)Bit set
; (E) : Bit  0  ($00000001 ; 1)
; Values to add in script command: $8000, 4, $2C

Triggergroup=	56,$8000, 4, $2C


; Exporting: TRIGGER(218:0) for FLIPEFFECT(80)
; <#> : Lara. (Animation) Force <&>Animation (256-512) of (E)slot for Lara
; <&> :  474 Animation
; (E) : SLOT_000 LARA
; Values to add in script command: $2000, 80, $DA

; Exporting: TRIGGER(5:0) for FLIPEFFECT(127)
; <#> : Organizer. Enable <&>Organizer
; <&> : Organizer=    5
; (E) : 
; Values to add in script command: $2000, 127, $5

Triggergroup=	59,$2000, 80, $DA,$2000, 127, $5
In the second part Lara is drawn to the ideal position, the insert-animation is triggered and a Organizer is triggered, which is used to delay all the triggers to the appropriate point. This delay can be achieved also by other methods like for instance exporting the triggers in a TG and exporting the execution of this TG as animcommand into the appropriate frame of the puzzle insert animation. Unfortunately I couldn´t supress Lara saying NO with the use of the puzzle item. Lara also wouldn´t say No, if she comes to the hole without a puzzle item. If Paolone expands the use of GT_USED_INVENTORY_ITEM on another animation than the standing animation, then you could create exactly the usual puzzle use routine.


Code:
Organizer=   5,FO_TICK_TIME,IGNORE,124,61

; Exporting: TRIGGER(5389:0) for ACTION(51)
; <#> : PUZZLE_HOLE3               ID:51     in sector:(3,2) of Room1
; <&> : Perform (E) flipeffect on <#>object
; (E) :  21: Hide object. Makes #ANIMATING invisible
; Values to add in script command: $5000, 51, $150D

; Exporting: TRIGGER(5645:0) for ACTION(49)
; <#> : PUZZLE_DONE3               ID:49     in sector:(3,2) of Room1
; <&> : Perform (E) flipeffect on <#>object
; (E) :  22: Show object. Makes #ANIMATING visible
; Values to add in script command: $5000, 49, $160D
; Exporting: TRIGGER(2:0) for FLIPEFFECT(49)
; <#> : Inventory-Item. Decrease (-1) number of <&>inventory-item in inventory
; <&> : PUZZLE_ITEM3                    	Slot=177
; (E) : 
; Values to add in script command: $2000, 49, $2
; Exporting: TRIGGER(43:0) for ACTION(26)
; <#> : FLAME_EMITTER              ID:26     in sector:(10,12) of Room0
; <&> : Trigger. (Moveable) Activate <#>Object with (E)Timer value
; (E) : Timer= +00
; Values to add in script command: $5000, 26, $2B
Triggergroup= 	61,$5000, 49, $160D,$5000, 51, $150D,$2000, 49, $2,$5000, 53, $2B
In the organizer you trigger all stuff, which has to be triggered: the puzzle done-object becomes visible, the puzzle item is removed from the inventory and finally the stuff you want to achieve is triggered, in this case a flame emitter.

The underwater key use follows exatly the same principles.
The underwater use of a push button is much easier. You only need one Animation-command to trigger Laras push button-animation and the Organizer (the second part above). In the Organizer you trigger the right animation for the push-button (should be usually animation 1) and the stuff you want to trigger.
Raymond is offline  
Old 06-10-11, 04:28   #102
!Lara Croft!
Inactive
 
Join Date: Apr 2008
Posts: 6,368
Default

I wonder if a first person mode is a feature we could already have...



A quick test i did with the lasersight graphics, the camera position seems to work nicely with lara's animations. I just wonder if there is something which could force this camera on permanently.

Last edited by !Lara Croft!; 06-10-11 at 09:21.
!Lara Croft! is offline  
Old 06-10-11, 21:23   #103
Raymond
Archaeologist
 
Join Date: Nov 2007
Posts: 1,689
Default

Sorry, I don´t see a possibility.
Raymond is offline  
Old 06-10-11, 21:27   #104
ggctuk
Relic Hunter
 
ggctuk's Avatar
 
Join Date: Mar 2005
Location: England, the NSUK
Posts: 9,181
Default

TREP did something similar, but it would involve recreating the weapons and probably deactivating the Look button animations to achieve a decent approximation.
__________________
Don't buy rifles from T-Rexes - they're small arms dealers!
ggctuk is offline  
Old 07-10-11, 01:49   #105
laralives
Professor
 
laralives's Avatar
 
Join Date: Aug 2005
Location: Boston, MA
Posts: 4,103
Default

Why would you want FPS in TR? That's a horrible idea! >.<
__________________
Bleh.
laralives is offline  
Old 07-10-11, 04:19   #106
!Lara Croft!
Inactive
 
Join Date: Apr 2008
Posts: 6,368
Default

Im inquiring about First Person TR, like mirrors edge. In the TR engine.

Nothing to do with shooters...(though guns ofcourse would be present)
!Lara Croft! is offline  
Old 07-10-11, 14:53   #107
Raymond
Archaeologist
 
Join Date: Nov 2007
Posts: 1,689
Default

Please no discussion here anymore about this. Next time such question should be asked in a seperate thread and if something interesting comes up for here, I´ll add it myself.
Raymond is offline  
Old 08-10-11, 12:49   #108
Raymond
Archaeologist
 
Join Date: Nov 2007
Posts: 1,689
Default

Script solution for 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
This was created by me for Mulf, wo wanted to make Pressure Plates with sloped platforms in the same way, which you can do easily with flat twoblock-platforms. For the sloped platforms you can use BRIDGE_TILT2-objects.

Code:
TestPosition=1,-1,BRIDGE_TILT2,-512,512,-16,16,-512,512,-32768,32767,0,0,-2000,2000

MultEnvCondition=1,ENV_ITEM_TEST_POSITION,1,-1

; Set Trigger Type - CONDITION 16
; Exporting: CONDITION(16:62) for PARAMETER(1)
; <#> : MultEnvCondition=    1
; <&> : Multiple condition of <#>MultEnvCondition script command in (E)way
; (E) :  In AND way. (All ENV conditions have to be true)
; Values to add in script command: $8000, 1, $10

TriggerGroup=4,$8000, 1, $10

; Set Trigger Type - ACTION 64
; Exporting: TRIGGER(3904:0) for ACTION(22)
; <#> : BRIDGE_FLAT ID 1
; <&> : Move. Move down <#>animating for (E)units (one sector = 1024)
; (E) : Units =  128 
; Values to add in script command: $5000, 1, $F40
; Set Trigger Type - FLIPEFFECT 109
; Exporting: TRIGGER(1536:0) for FLIPEFFECT(109)
; <#> : GlobalTriggers. <&>Enable/Disable the (E)GlobalTrigger
; <&> :  Disable global trigger
; (E) : GlobalTrigger=    4
; Values to add in script command: $2000, 109, $400

TriggerGroup=6,$5000+TGROUP_USE_FOUND_ITEM_INDEX, 1, $F40,$2000, 109, $400;

GlobalTrigger= 4,-1,GT_CONDITION_GROUP,-1,4,6,-1

TriggerGroup=7,$8000+TGROUP_NOT, 1, $10

; Set Trigger Type - ACTION 63
; Exporting: TRIGGER(3903:0) for ACTION(22)
; <#> : BRIDGE_FLAT ID 1
; <&> : Move. Move up <#>animating for (E)units (one sector = 1024)
; (E) : Units =  128 
; Values to add in script command: $5000, 1, $F3F

TriggerGroup=9,$5000+TGROUP_USE_FOUND_ITEM_INDEX, 1, $F3F,$2000, 109, $401;$2000, 109, $401=enable GT 4

GlobalTrigger= 3,FGT_SINGLE_SHOT_RESUMED,GT_CONDITION_GROUP,-1,7,9,-1
First some explanations, then something about the "in principle":
The Testposition covers the position of Lara relative to a bridge flat (for you bridge tilt2). The x- uind z-coordinate (-512,512) cover obviously the whole sector of the bridge. The y(height coordinate) leaves some difference in the height, but it also works with 0,0. The difference in the horizontal orientation can obviously cover the whole circle, which is covered with -32768,32767.
Thois environmenatal condition has to be used in a condition triggergroup and the way to do it is to refer to it in MultEnvCondition-command and then use the condition 16.In the GT 4 with this condition I trigger than the downward movement. I used action 64 to move it half a click down (128 units). You can´t use your Move-flipeffect here, because you can´t use the nice flag TGROUP_USE_FOUND_ITEM_INDEX with a flipeffect. This is only possible with action trigger and it allows the engine to expand the working of the triggers for every moveable of a slot, given by a condition, which is here found in the TestPosition. So it works for every bridge in the level and not for one.
IN GT 3 the bridge is moved up again, if Lara isn´t on the tile with a bridge. If you want to add a puzzle of some kind to it (open some specific doors by using some of the plates for instance), then you would have to add it yourself.

And now two pecularities (the "in principle):
1. I also wanted to use FGT_SINGLE_SHOT_RESUMED for GT 4, as I did for GT 3, but for a strange reason, it didn´t work, as it should. The flag should allow the execution of the move-action trigger only once, every time the conditions becomes true, but it was executed several times. So I just resorted to another solution and disabled the GT immediatly and reenabled it with the other GT 3 and it worked. This is no problem, because it works exactly the same way as it should.
2. We can customize the speed of moving with Customize=CUST_SPEED_MOVING,... I found out, that it only works for the Move-action trigger, which use clicks and not the ones, which use units for the distance of moving. This should be a kind of bug. So far you can only with unit-precision and standard speed or with click-precision and adjusted slow speed.
Raymond is offline  
Old 08-10-11, 13:13   #109
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 32,762
Default

Good one!
Thank you!

*info saved in a Word document.*

After my first MoA levels have been released I'm planning to first start a new testlevel in which I'll try out some things from this thread and some other TRNG stuff I haven't used yet but which I'd like to use in my next levels.
This sure is one of the things I'm going to try.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.
Titak is online now  
Old 08-10-11, 13:16   #110
Raymond
Archaeologist
 
Join Date: Nov 2007
Posts: 1,689
Default

Object interaction via an inventory item

You have to study Paolones docu for his Animation tutorial project first and know the Animation scripting basics.
The first step would be to find the right values for the TestPostion-command, which defines the area, in which Lara can interact with the wished object.
Here is one example, which you can use, if Lara should interact with an object in the Animating8_Mip-slot like she interacts with an puzzle hole:
TestPosition= 4, IGNORE, Animating8_Mip,-300,+300,-100,+100,200-200,200+200,-$1000,$1000,-$1000,$1000,-$1000,$1000
The interaction should follow the same principles of interaction with puzzle/key-holes, i.e. if Lara is in the right position, you start the interaction via pressing action and then the inventory object pops up and you choose it (first) or second, you choose the inventory object directly.

1. Using action

The script here was created by me for an specific example, given to me by Isis.

Code:
Animation= 2, KEY1_ACTION,IGNORE, FAN_SET_FREE_HANDS+FAN_PERFORM_TRIGGER_GROUP+FAN_ALIGN_TO_ENV_POS, ENV_MULT_CONDITION,1,IGNORE, -103

MultEnvCondition= 1,ENV_ITEM_TEST_POSITION,1,IGNORE, ENV_FREE_HANDS, ignore, ignore,ENV_CONDITION_TRIGGER_GROUP,11,IGNORE

; Set Trigger Type - CONDITION 2
; Exporting: CONDITION(2:62) for PARAMETER(182)
; <#> : PUZZLE_ITEM8                    	Slot=182
; <&> : Inventory. Present <#>inventory_item.
; (E) : 
; Values to add in script command: $8000, 182, $2

; Set Trigger Type - CONDITION 45
; Exporting: CONDITION(45:58) for PARAMETER(0)
; <#> : Global Byte Alfa1
; <&> : Variables. The <#>Numeric Variable has the (E)Bit clear
; (E) : Bit  2  ($00000004 ; 4)
; Values to add in script command: $8000, 0, $22D

Triggergroup=11,$8000, 182, $2,$8000, 0, $22D
TestPosition= 1, ..., ANIMATING5,...

; Set Trigger Type - FLIPEFFECT 234
; Exporting: TRIGGER(0:0) for FLIPEFFECT(234)
; <#> : Variables. Numeric. Set in <&>Variable the (E)bit
; <&> : Global Byte Alfa1
; (E) : Bit  0  ($00000001 ; 1)
; Values to add in script command: $2000, 234, $0

TriggerGroup= 2, $2000, 234, $0,$2000, 306, $7 ; puzzle item pops up

Globaltrigger=1,FGT_SINGLE_SHOT,GT_USED_INVENTORY_ITEM,182,10,1,-1

; Set Trigger Type - CONDITION 44
; Exporting: CONDITION(44:62) for PARAMETER(0)
; <#> : Global Byte Alfa1
; <&> : Variables. The <#>Numeric Variable has the (E)Bit set
; (E) : Bit  0  ($00000001 ; 1)
; Values to add in script command: $8000, 0, $2C

TriggerGroup= 10,$8000, 0, $2C

; Set Trigger Type - FLIPEFFECT 342
; Exporting: TRIGGER(32523:0) for FLIPEFFECT(342)
; <#> : Variables. Memory. Set in <&>Code Memory the (E)Negative number
; <&> : Inventory Item just chosen from inventory (example a key to open a door) (Long)
; (E) : Value -1
; Values to add in script command: $2000, 342, $7F0B

; Set Trigger Type - FLIPEFFECT 234
; Exporting: TRIGGER(512:0) for FLIPEFFECT(234)
; <#> : Variables. Numeric. Set in <&>Variable the (E)bit
; <&> : Global Byte Alfa1
; (E) : Bit  2  ($00000004 ; 4)
; Values to add in script command: $2000, 234, $200

TriggerGroup= 1,$2000, 342, $7F0B,$2000, 234, $200,...
In this example Lara interacts with an object in the animating5-slot via an puzzle_item8 (slot 182).
In TG 1 you trigger all the things you need to trigger. The best way is to use an Organizer, to time all the triggers rightly. You need to use f342 here. This flipeffect prevent Lara from saying No, if she uses the puzzle rightly. Another way would be to force in TG 1 the wished Animation, in which Lara interacts with the given object and you export the triggers, you want to use, as animcommands to the right frames of the animation.


2. Using the inventory object in the inventory

Code:
Globaltrigger=2,FGT_SINGLE_SHOT,GT_USED_INVENTORY_ITEM,182,9,6,-1

; Set Trigger Type - CONDITION 16
; Exporting: CONDITION(16:62) for PARAMETER(1)
; <#> : MultEnvCondition=    1
; <&> : Multiple condition of <#>MultEnvCondition script command in (E)way
; (E) :  In AND way. (All ENV conditions have to be true)
; Values to add in script command: $8000, 1, $10
TriggerGroup= 9, $8000, 1, $10

; Set Trigger Type - FLIPEFFECT 234
; Exporting: TRIGGER(256:0) for FLIPEFFECT(234)
; <#> : Variables. Numeric. Set in <&>Variable the (E)bit
; <&> : Global Byte Alfa1
; (E) : Bit  1  ($00000002 ; 2)
; Values to add in script command: $2000, 234, $100
TriggerGroup=6,$2000, 234, $100


Animation= 1, ignore,IGNORE, FAN_PERFORM_TRIGGER_GROUP+FAN_ALIGN_TO_ENV_POS, ENV_MULT_CONDITION,2,IGNORE, -103

MultEnvCondition= 2,ENV_ITEM_TEST_POSITION,1,IGNORE, ENV_FREE_HANDS, ignore, ignore,ENV_CONDITION_TRIGGER_GROUP,12,-1

; Set Trigger Type - CONDITION 44
; Exporting: CONDITION(44:60) for PARAMETER(0)
; <#> : Global Byte Alfa1
; <&> : Variables. The <#>Numeric Variable has the (E)Bit set
; (E) : Bit  1  ($00000002 ; 2)
; Values to add in script command: $8000, 0, $12C
TriggerGroup=12,$8000, 0, $12C

Last edited by Raymond; 10-10-11 at 14:32.
Raymond is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 19:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.