www.tombraiderforums.com

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

Closed Thread
 
Thread Tools
Old 14-08-15, 10:23   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,493
Default TRNG - Real time compass display

The “real time compass” means you will see a compass on the screen directly during the level, that will be always updated while Lara’s moving – so you don’t need to enter the inventory again and again to study Lara’s actual direction on the compass there.
(But no, it’s not the compass object of the inventory that we’ll use as a base for our real time compass.
It means you can use COMPASS_ITEM as an inventory background, instead of using it as a compass, because you don’t need the inventory compass any more. – See for example TheBloodRed’s background object from TRSearch: Item#3466.)

Maybe you think this real time compass is an animated thing. Unfortunately, that isn’t, I couldn’t achieve that. This real time compass is about eight sprites. Each sprite shows a static state of a compass, showing the main directions.
In our setup, the sprites will be saved in these CUSTOM_SPRITES texture slots:

Lara’s facing exactly north – Texture 0
Lara’s facing exactly south – Texture 1
Lara’s facing exactly west – Texture 2
Lara’s facing exactly east – Texture 3
Lara’s facing exactly northwest – Texture 4
Lara’s facing exactly northeast – Texture 5
Lara’s facing exactly southwest – Texture 6
Lara’s facing exactly southeast – Texture 7

(Each direction in this tutorial is based on the game facing, and not Room Editor facing!)

And this is what you’ll see in the game:
For example, Lara’s facing exactly north when she starts the level, so you will see the static “north” sprite on the screen:



Now Lara turns a bit leftwards. The compass sprite won’t be animated or won’t be replaced, but a “left” arrow (CUSTOM_SPRITES Texture 9) will show up, saying “Lara’s not facing exactly north any more. But she turned left only a bit, so she is still closer to the north direction than the northwest direction, that’s why the compass still indicates north. So the left arrow means Lara’s still facing north, not exactly, but she is close to that, on the left side of that”.



Now Lara turns leftwards a bit more so she gets closer to the northwest direction than the north direction. The “north” static sprite and the “left” arrow will disappear and the “northwest” static sprite and a “right” arrow (CUSTOM_SPRITES Texture 8) will appear now, saying “the closest direction that Lara’s facing now is northwest. But she’s not facing exactly that direction, because she’s on the right side of that”.



(And, yes, as you can see, the needle of the compass is constant, always indicating upwards – forwards – on the screen, and the compass itself is what will be rotated when Lara’s turning. I think it is useful, because now Lara and the needle are always facing the same direction.)

These are the sprites I used:



See this illustration to understand the logic of our setup:



As you see, each main direction has two half-sectors. Each half-sector is 22,5° wide, so a complete sector of a main direction is 45° wide. (So 8 main directions×45° wide sectors=360° full circle.)

That’s what happened in the example above:
Lara faces exactly north (0°) when the level starts. She turns leftwards a bit, getting into the left sector (from 337°,5 to 360°) of the north main direction. The “left” arrow appears. She turns leftwards a bit more, getting into the right sector (from 315° to 337,5°) of the northwest main direction. The “right” arrow appears.

The arrows are controlled by the Local Byte Beta1 (LBB1) variable:

- If LBB1=0 then it means Lara faces exactly a main direction, the game won’t place any arrows on the screen.
- If LBB1=1 then it means Lara faces a right half-sector, the game will place the “right” arrow on the screen – or else (if it is 0 or 2) it will remove that.
- If LBB1=2 then it means Lara faces a left half-sector, the game will place the “left” arrow on the screen – or else (if it is 0 or 1) it will remove that.

The direction textures are controlled by the Local Byte Beta2 (LBB2) variable:

- if LBB2=0 then it means Lara faces from 337,5° to 22,5°, the game will place the “north” sprite on the screen – or else (if it is 1-7) it will remove that.
- if LBB2=1 then it means Lara faces from 157,5° to 202,5°, the game will place the “south” sprite on the screen – or else (if it is 0 or 2-7) it will remove that.
- if LBB2=2 then it means Lara faces from 247,5° to 292,5°, the game will place the “west” sprite on the screen – or else (if it is 0-1 or 3-7) it will remove that.
- if LBB2=3 then it means Lara faces from 67,5° to 112,5°, the game will place the “east” sprite on the screen – or else (if it is 0-2 or 4-7) it will remove that.
- if LBB2=4 then it means Lara faces from 292,5° to 337,5°, the game will place the “northwest” sprite on the screen – or else (if it is 0-3 or 5-7) it will remove that.
- if LBB2=5 then it means Lara faces from 22,5° to 67,5°, the game will place the “northeast” sprite on the screen – or else (if it is 0-4 or 6-7) it will remove that.
- if LBB2=6 then it means Lara faces from 202,5° to 247,5°, the game will place the “southwest” sprite on the screen – or else (if it is 0-5 or 7) it will remove that.
- if LBB2=7 then it means Lara faces from 112,5° to 157,5°, the game will place the “southeast” sprite on the screen – or else (if it is 0-6) it will remove that.

The numbers in the illustration between brackets are memory zone values: the values of “Facing Horizontal (Short)” field of the Item Memory Zone. - The field is used to define the degree values:
The game uses a “from 0 to 65535” sequence to define the degrees of a circle. (So, if 360°=65535, then 1° is about 182 and about 0,005° is 1.)
Unfortunately, sometimes we can’t use a full circle with 65535, because the game will divide that 65535 into two halves, when using some given properties: into a first half from 0 to 32767 and into a second half from 0 to -32768. (32767+32768=65535). As you see in the illustration above, this time we will also use that two half circles, because that’s how “Facing Horizontal (Short)” field will work now.

So this is the method to define the degrees:
We’ll define Lara as the subject of the Item Memory Zone. Then we’ll put the actual value of the “Facing Horizontal (Short)” field into Local Long Alfa (LLA) variable. Lara is the actual subject of the Item Memory Zone now, so the “Facing Horizontal (Short)” value is the actual horizontal facing of Lara. It means we have from 0 to 32767 or from 0 to -32768 values in LLA now, as the horizontal facing values of her.
So, for example: if LLA value is between somewhere 20480 (112,5°) and 24576 (135°) now, then we’ll know that Lara is just facing southeast, a bit leftwards from that, so the game will set LBB1 as 2 and set LBB2 as 7, putting the “southeast” and “left arrow” sprites on the screen, removing any other sprites off that.

Notes:

1. As you’ll see below, in our setup we’ll use condition triggers to study the facing values in LLA. They have five digits sometimes so they are huge numbers sometimes. It means we need the PARAM_BIG_NUMBERS method to define those values for the condition triggers. But, unfortunately, PARAM_BIG_NUMBERS values sometimes can’t be negative numbers. And this is an unfortunate case like that now.
So, if we have values from -1 to -32768 in LLA, then we’ll use a trigger that will invert the sign of that LLA value. So now the condition is able to study that positive value in LLA, because that positive value can be defined in PARAM_BIG_NUMBERS now, as a value from 1 to 32768.
(As you see, this time we use “Facing Horizontal (Short)” field to study the value of a field. But what if we want to force a new value into the field, to force a new facing on Lara? Well, that will work in PARAM_BIG_NUMBERS both with negative/positive value from the two half intervals and from the 0-65535 interval. – But it’s just an interesting information, we won’t do that now.)
2. Yes, we used a “long” variable for the “Facing Horizontal (Short)” field, and not a “short” variable. It’s because “short” variables are useable only from Value -32768 to Value 32767. And if I invert the sign of -32768 then “short” variables can’t take Value 32768.
3. I decided that the “border values” always belong to the left half-sectors in this setup. So, for example -4096 belongs to the north/left half-sector (and not to northwest/right half-sector), but 4096 belongs to the northeast/left half sector (and not to north/right half-sector) etc.
4. Flyby sequences and other cameras will always show this compass. If you don’t want that then disable the GlobalTriggers of the compass, temporarily, while the camera is working.
5. Disable the GlobalTriggers of the compass, temporarily, if you want to use Item Memory Zone for somebody/something else, instead of Lara. (Naturally you won’t see the compass while that is disabled.)

And this is what goes to the Script:

(Note: copy it into your script, without reading and understanding the description below, if you want. But if you do that then don’t forget:

- You can’t use LBB1, LBB2 and LLA variables for other purposes in your level.
- You need to use the “north” sprite in CUSTOM_SPRITES Texture 0 slot, use the “south” sprite in CUSTOM_SPRITES Texture 1 slot etc., as I wrote above.
- The Value 46 in $5000, 46, $36 triggers is the actual object ID of Lara, i.e. you should use your own Lara ID there.)

Parameters= PARAM_BIG_NUMBERS, >
0, 4096, 4097, 8192, 12288, 12289, >
16384, 20480, 20481, 24576, 28672, 28673, 32768
GlobalTrigger= 1, IGNORE, GT_CONDITION_GROUP, IGNORE, 1, 2, IGNORE
TriggerGroup= 1, $5000, 46, $36, $2000, 256, $1D70, $8000, 112, $26
TriggerGroup= 2, $8000, 112, $28, $2000, 232, $44, $2000, 232, $45, >
$8000+TGROUP_ELSE, 112, $127, $2000, 232, $144, $2000, 232, $45, >
$8000+TGROUP_ELSE, 112, $327, $2000, 232, $244, $2000, 232, $545, >
$8000+TGROUP_ELSE, 112, $328, $2000, 232, $44, $2000, 232, $545, >
$8000+TGROUP_ELSE, 112, $427, $2000, 232, $144, $2000, 232, $545, >
$8000+TGROUP_ELSE, 112, $627, $2000, 232, $244, $2000, 232, $345, >
$8000+TGROUP_ELSE, 112, $628, $2000, 232, $44, $2000, 232, $345, >
$8000+TGROUP_ELSE, 112, $727, $2000, 232, $144, $2000, 232, $345, >
$8000+TGROUP_ELSE, 112, $927, $2000, 232, $244, $2000, 232, $745, >
$8000+TGROUP_ELSE, 112, $928, $2000, 232, $44, $2000, 232, $745, >
$8000+TGROUP_ELSE, 112, $A27, $2000, 232, $144, $2000, 232, $745, >
$8000+TGROUP_ELSE, 112, $A26, $2000, 232, $244, $2000, 232, $145
GlobalTrigger= 2, IGNORE, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup= 3, $5000, 46, $36, $2000, 256, $1D70, $8000, 112, $27
TriggerGroup= 4,$2000, 284, $70, $8000, 112, $227, $2000, 232, $244, $2000, 232, $45, >
$8000+TGROUP_ELSE, 112, $327, $2000, 232, $144, $2000, 232, $445, >
$8000+TGROUP_ELSE, 112, $328, $2000, 232, $44, $2000, 232, $445, >
$8000+TGROUP_ELSE, 112, $527, $2000, 232, $244, $2000, 232, $445, >
$8000+TGROUP_ELSE, 112, $627, $2000, 232, $144, $2000, 232, $245, >
$8000+TGROUP_ELSE, 112, $628, $2000, 232, $44, $2000, 232, $245, >
$8000+TGROUP_ELSE, 112, $827, $2000, 232, $244, $2000, 232, $245, >
$8000+TGROUP_ELSE, 112, $927, $2000, 232, $144, $2000, 232, $645, >
$8000+TGROUP_ELSE, 112, $928, $2000, 232, $44, $2000, 232, $645, >
$8000+TGROUP_ELSE, 112, $b27, $2000, 232, $244, $2000, 232, $645, >
$8000+TGROUP_ELSE, 112, $c27, $2000, 232, $144, $2000, 232, $145, >
$8000+TGROUP_ELSE, 112, $c28, $2000, 232, $44, $2000, 232, $145
GlobalTrigger= 3, IGNORE, GT_CONDITION_GROUP, IGNORE, 5, 6, 7
TriggerGroup= 5, $8000, 69, $2B
TriggerGroup= 6, $2000, 357, $1
TriggerGroup= 7, $2000, 358, $1
Parameters= PARAM_SHOW_SPRITE, 1, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 0, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 4, IGNORE, GT_CONDITION_GROUP, IGNORE, 8, 9, 10
TriggerGroup= 8, $8000, 69, $12B
TriggerGroup= 9, $2000, 357, $2
TriggerGroup= 10, $2000, 358, $2
Parameters= PARAM_SHOW_SPRITE, 2, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 1, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 5, IGNORE, GT_CONDITION_GROUP, IGNORE, 11, 12, 13
TriggerGroup= 11, $8000, 69, $22B
TriggerGroup= 12, $2000, 357, $3
TriggerGroup= 13, $2000, 358, $3
Parameters= PARAM_SHOW_SPRITE, 3, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 2, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 6, IGNORE, GT_CONDITION_GROUP, IGNORE, 14, 15, 16
TriggerGroup= 14, $8000, 69, $32B
TriggerGroup= 15, $2000, 357, $4
TriggerGroup= 16, $2000, 358, $4
Parameters= PARAM_SHOW_SPRITE, 4, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 3, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 7, IGNORE, GT_CONDITION_GROUP, IGNORE, 17, 18, 19
TriggerGroup= 17, $8000, 69, $42B
TriggerGroup= 18, $2000, 357, $5
TriggerGroup= 19, $2000, 358, $5
Parameters= PARAM_SHOW_SPRITE, 5, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 4, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 8, IGNORE, GT_CONDITION_GROUP, IGNORE, 20, 21, 22
TriggerGroup= 20, $8000, 69, $52B
TriggerGroup= 21, $2000, 357, $6
TriggerGroup= 22, $2000, 358, $6
Parameters= PARAM_SHOW_SPRITE, 6, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 5, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 9, IGNORE, GT_CONDITION_GROUP, IGNORE, 23, 24, 25
TriggerGroup= 23, $8000, 69, $62B
TriggerGroup= 24, $2000, 357, $7
TriggerGroup= 25, $2000, 358, $7
Parameters= PARAM_SHOW_SPRITE, 7, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 6, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 10, IGNORE, GT_CONDITION_GROUP, IGNORE, 26, 27, 28
TriggerGroup= 26, $8000, 69, $72B
TriggerGroup= 27, $2000, 357, $8
TriggerGroup= 28, $2000, 358, $8
Parameters= PARAM_SHOW_SPRITE, 8, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 7, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 11, IGNORE, GT_CONDITION_GROUP, IGNORE, 29, 30, 31
TriggerGroup= 29,$8000, 68, $12B
TriggerGroup= 30,$2000, 357, $9
TriggerGroup= 31,$2000, 358, $9
Parameters= PARAM_SHOW_SPRITE, 9, IGNORE, 117, 765, 38, 51, CUSTOM_SPRITES, 8, IGNORE, >
IGNORE, IGNORE, IGNORE
GlobalTrigger= 12, IGNORE, GT_CONDITION_GROUP, IGNORE, 32, 33, 34
TriggerGroup= 32,$8000, 68, $22B
TriggerGroup= 33,$2000, 357, $A
TriggerGroup= 34,$2000, 358, $A
Parameters= PARAM_SHOW_SPRITE, 10, IGNORE, 60, 765, 38, 51, CUSTOM_SPRITES, 9, IGNORE, >
IGNORE, IGNORE, IGNORE

The script is long but the main reason of that is not because it’s hard. The main reason is (as you’ll see below) it has repetitive sections:

- GlobalTrigger#1 defines the LBB1 and LBB2 values, using the positive (or 0) LLA values.
- GlobalTrigger#2 defines the LBB1 and LBB2 values, using the negative LLA values.
- GlobalTrigger#3, 4, 5, 6, 7, 8, 9 and 10 place/remove the proper main direction sprite on/off the screen.
- GlobalTrigger#11 and 12 place/remove the proper arrow sprite on/off the screen.

Let’s see GlobalTrigger#1 first:
It says if the condition in TriggerGroup#1 is true then TriggerGroup#2 will be executed.
The condition in TriggerGroup#1 is:

; Set Trigger Type - ACTION 54
; Exporting: TRIGGER(54:0) for ACTION(46)
; <#> : LARA ID 46
; <&> : Variables. Set the index of <#>moveable as Selected Item
; (E) :
; Values to add in script command: $5000, 46, $36

; Set Trigger Type - FLIPEFFECT 256
; Exporting: TRIGGER(7536:0) for FLIPEFFECT(256)
; <#> : Variables. Memory. Copy to <&> Numeric Variable the (E)Selected Item Memory
; <&> : Local Long Alfa
; (E) : Facing Horizontal (Short)
; Values to add in script command: $2000, 256, $1D70

; Set Trigger Type - CONDITION 38
; Exporting: CONDITION(38:62) for PARAMETER(112)
; <#> : Local Long Alfa
; <&> : Variables. The <#>Numeric Variable is >= than (E)Big Number value
; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index= 0
; Values to add in script command: $8000, 112, $26

So, the game sets Lara as the actual subject of the Item Memory Zone, then copies “Facing Horizontal (Short)” Item Memory Zone field actual value into LLA. Then it studies if LLA is bigger than PARAM_BIG_NUMBERS Position#0 value (i.e. 0) or is equal with that.

And these are the triggers I used in TriggerGroup#2:

; Set Trigger Type - CONDITION 38
; Exporting: CONDITION(38:…) for PARAMETER(112)
; <#> : Local Long Alfa
; <&> : Variables. The <#>Numeric Variable is >= than (E)Big Number value
; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index=
X
; Values to add in script command: $8000, 112, $
X26

; Set Trigger Type - CONDITION 40
; Exporting: CONDITION(40:…) for PARAMETER(112)
; <#> : Local Long Alfa
; <&> : Variables. The <#>Numeric Variable is = than (E)Big Number value
; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index=
X
; Values to add in script command: $8000, 112, $
X28

; Set Trigger Type - CONDITION 39
; Exporting: CONDITION(39:…) for PARAMETER(112)
; <#> : Local Long Alfa
; <&> : Variables. The <#>Numeric Variable is < than (E)Big Number value
; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index=
X
; Values to add in script command: $8000, 112, $
X27

X is a PARAM_BIG_NUMBERS position whose value the trigger will use. The value in PARAM_BIG_NUMBERS Position#0 is 0 now, the value in PARAM_BIG_NUMBERS Position#1 is 4096 now etc.
If X is A then that is Position#10. B is Position#11, C is Position#12.

; Set Trigger Type - FLIPEFFECT 232
; Exporting: TRIGGER(…:0) for FLIPEFFECT(232)
; <#> : Variables. Numeric. Set <&>Variable with (E)value
; <&> : Local Byte Beta1
; (E) : Value
Y
; Values to add in script command: $2000, 232, $
Y44

Y is 0, 1 or 2.

; Set Trigger Type - FLIPEFFECT 232
; Exporting: TRIGGER(…:0) for FLIPEFFECT(232)
; <#> : Variables. Numeric. Set <&>Variable with (E)value
; <&> : Local Byte Beta2
; (E) : Value
Z
; Values to add in script command: $2000, 232, $
Z45

Z is 0, 1, 2, 3, 4, 5, 6 or 7.

I will only describe the first part of TriggerGroup#2, because if you read that then you will understand the other parts of it:

TriggerGroup= 2, $8000, 112, $28, $2000, 232, $44, $2000, 232, $45, >
$8000+TGROUP_ELSE, 112, $127, $2000, 232, $144, $2000, 232, $45, >
$8000+TGROUP_ELSE, 112, $327, $2000, 232, $244, $2000, 232, $545, >

So, if LLA is PARAM_BIG_NUMBERS Position#0 value (i.e.0) ($8000, 112, $28) then Lara faces exactly the north direction, so the game will set LBB1 as 0 ($2000, 232, $44) and set LBB2 as 0 ($2000, 232, $45).
If that is not right, then see the next condition (TGROUP_ELSE).
So, if LLA is smaller than PARAM_BIG_NUMBERS Position#1 value (i.e.4096) ($8000, 112, $127) then Lara faces the right half-sector of the north direction, so the game will set LBB1 as 1 ($2000, 232, $144) and set LBB2 as 0 ($2000, 232, $45).
If that is not right, then see the next condition (TGROUP_ELSE).
So, if LLA is smaller than PARAM_BIG_NUMBERS Position#3 value (i.e.8192) ($8000, 112, $327) then Lara faces the left half-sector of the northeast direction, so the game will set LBB1 as 2 ($2000, 232, $244) and set LBB2 as 5 ($2000, 232, $545).

GlobalTrigger#2 says if the condition in TriggerGroup#3 is true then TriggerGroup#4 will be executed.
The condition in TriggerGroup#3 is: the game sets Lara as the actual subject of the Item Memory Zone ($5000, 46, $36), then copies “Facing Horizontal (Short)” Item Memory Zone field actual value into LLA ($2000, 256, $1D70). Then it studies if LLA is smaller than PARAM_BIG_NUMBERS Position#0 value (i.e. 0) ($8000, 112, $27).

I will only describe the first part of TriggerGroup#4, because if you read that then you will understand the other parts of it:

TriggerGroup= 4,$2000, 284, $70, $8000, 112, $227, $2000, 232, $244, $2000, 232, $45, >
$8000+TGROUP_ELSE, 112, $327, $2000, 232, $144, $2000, 232, $445, >
$8000+TGROUP_ELSE, 112, $328, $2000, 232, $44, $2000, 232, $445, >

; Set Trigger Type - FLIPEFFECT 284
; Exporting: TRIGGER(112:0) for FLIPEFFECT(284)
; <#> : Variables. Numeric. Invert the sign of <&>Numeric Variable
; <&> : Local Long Alfa
; (E) :
; Values to add in script command: $2000, 284, $70

So, first of all, the game will invert the sign in LLA.
Then (see the similar triggers from TriggerGroup#2) the game will study LLA. If that is smaller than PARAM_BIG_NUMBERS Position#2 value (i.e.4097) ($8000, 112, $227) then Lara faces the left half-sector of the north direction, so the game will set LBB1 as 2 ($2000, 232, $244) and set LBB2 as 0 ($2000, 232, $45).
If that is not right, then see the next condition (TGROUP_ELSE).
So, if LLA is smaller than PARAM_BIG_NUMBERS Position#3 value (i.e.8192) ($8000, 112, $327) then Lara faces the right half-sector of the northwest direction, so the game will set LBB1 as 1 ($2000, 232, $144) and set LBB2 as 4 ($2000, 232, $445).
If that is not right, then see the next condition (TGROUP_ELSE).
So, if LLA is PARAM_BIG_NUMBERS Position#3 value (i.e.8192) ($8000, 112, $328) then Lara faces exactly the northwest direction, so the game will set LBB1 as 0 ($2000, 232, $44) and set LBB2 as 4 ($2000, 232, $445).

GlobalTrigger#3, 4, 5, 6, 7, 8, 9 and 10 use the same triggers:

; Set Trigger Type - CONDITION 43
; Exporting: CONDITION(43:…) for PARAMETER(69)
; <#> : Local Byte Beta2
; <&> : Variables. The <#>Numeric Variable is = than (E)Value
; (E) : Value=
X
; Values to add in script command: $8000, 69, $
X2B

X is 0, 1, 2, 3, 4, 5, 6 or 7.

; Set Trigger Type - FLIPEFFECT 357
; Exporting: TRIGGER(Y:0) for FLIPEFFECT(357)
; <#> : Sprite. Show sprite with data in <&>Parameters for (E)Durate
; <&> : Parameters=PARAM_SHOW_SPRITE,
Y
; (E) : Forever (use other action/effect to disable it)
; Values to add in script command: $2000, 357, $
Y

; Set Trigger Type - FLIPEFFECT 358
; Exporting: TRIGGER(Y:0) for FLIPEFFECT(358)
; <#> : Sprite. Remove from the screen the sprite with data in <&>Parameters
; <&> : Parameters=PARAM_SHOW_SPRITE,
Y
; (E) :
; Values to add in script command: $2000, 358, $
Y

Y is 1, 2, 3, 4, 5, 6, 7 or 8.

Let’s see for example GlobalTrigger#6:

GlobalTrigger= 6, IGNORE, GT_CONDITION_GROUP, IGNORE, 14, 15, 16
TriggerGroup= 14, $8000, 69, $32B
TriggerGroup= 15, $2000, 357, $4
TriggerGroup= 16, $2000, 358, $4
Parameters= PARAM_SHOW_SPRITE, 4, IGNORE, 30, 800, 152, 204, CUSTOM_SPRITES, 3, IGNORE, >
IGNORE, IGNORE, IGNORE

The GlobalTrigger says if the condition in TriggerGroup#14 is true then TriggerGroup#15 will be executed. But if that is not true then TriggerGroup#16 will be executed.
The condition in TriggerGroup#14 is if LBB2 is 3. (So, if Lara faces east exactly, or the left/right half-sector of it.)
If LBB2 is 3 then a sprite – that is defined in “Parameters= PARAM_SHOW_SPRITE, 4” Script command – will be put on the screen.
If LBB2 is not 3 then a sprite – that is defined in “Parameters= PARAM_SHOW_SPRITE, 4” Script command – will be taken off the screen.
“Parameters= PARAM_SHOW_SPRITE, 4” Script command defines the Texture 3 of CUSTOM_SPRITES (i.e. the “east” main direction sprite) and its screen coordinates.

GlobalTrigger#11 and 12 use the same triggers:

; Set Trigger Type - CONDITION 43
; Exporting: CONDITION(43:…) for PARAMETER(68)
; <#> : Local Byte Beta1
; <&> : Variables. The <#>Numeric Variable is = than (E)Value
; (E) : Value=
X
; Values to add in script command: $8000, 68, $
X2B

X is 1 or 2.

$2000, 357, $
Y
$2000, 358, $
Y

Y is 9 or 10. (But 10 is “A” as a hexadecimal value, so $Y is $A now.)

Let’s see for example GlobalTrigger#12:

GlobalTrigger= 12, IGNORE, GT_CONDITION_GROUP, IGNORE, 32, 33, 34
TriggerGroup= 32,$8000, 68, $22B
TriggerGroup= 33,$2000, 357, $A
TriggerGroup= 34,$2000, 358, $A
Parameters= PARAM_SHOW_SPRITE, 10, IGNORE, 60, 765, 38, 51, CUSTOM_SPRITES, 9, IGNORE, >
IGNORE, IGNORE, IGNORE

The GlobalTrigger says if the condition in TriggerGroup#32 is true then TriggerGroup#33 will be executed. But if that is not true then TriggerGroup#34 will be executed.
The condition in TriggerGroup#32 is if LBB1 is 2. (So, if Lara faces a left sector.)
If LBB1 is 2 then a sprite – that is defined in “Parameters= PARAM_SHOW_SPRITE, 10” Script command – will be put on the screen.
If LBB1 is not 2 then a sprite – that is defined in “Parameters= PARAM_SHOW_SPRITE, 10” Script command – will be taken off the screen.
“Parameters= PARAM_SHOW_SPRITE, 10” Script command defines the Texture 9 of CUSTOM_SPRITES (i.e. the “left” arrow sprite) and its screen coordinates.



Made using TRNG 1.2.2.6
AkyV is online now  
Closed Thread

Bookmarks

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 17:42.


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