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 27-07-14, 11:14   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,377
Default TRNG Light effects

Note:
Fires, electric arcs and fogs are also emitting light, but they are not included in the tutorial, because their main purpose is not emitting light.

1. Inner light effects

The Moveable objects have outer lights. It means all the light sources in the room (ambience light, light bulbs, shadow bulbs, gunflash etc.) will affect the object.
The Static objects usually have inner lights. It means there is no light source in the room that will affect the object, you need to adjust the individual light of the selected object, using Object Tint buttons of Room Editor. (The shadow on these Static objects is also static, constant, and will be visible only if you placed the object in the map. The static shadow can be edited eg. with StrPix.)

A Static object will have the outer light with an easy procedure: in StrPix, save (export) the given one-meshed Static object as a DXF file, then load (import) it again, to overwrite the original object, not editing anything. Then save the WAD and refresh it at your level. (The method is not perfect, though. Eg. this Static still declines the light bulb lights.)

These are the TRNG inner light effects:

a, If you keep the inner light attribute for a Static object, then an F191 TRNG trigger will be able to start a special light/color effect on the object. The effect must be defined in a Parameters Script command, with a PARAM_COLOR_ITEM constant.

The effect types are:

- COLTYPE_SET_COLOR: new inner light.
- COLTYPE_SET_PULSE: pulsing new inner light (between new color and black).
- COLTYPE_SHADE_COLORS: pulsing new inner light (between new color#1 and new color#2). (Note: color#2 is “weaker” than you define it, probably only the half of the adjusted ColorRGB values will be used.)

The effect will stop only if you activate another PARAM_COLOR_ITEM with another F191 for that object.

b, You can use an inner light even for a Moveable object.
That will always be a pulsing light (between the new and the original light), because the game will always try to restore the original (outer) lights, at once, continuously. (Note: this time you cannot adjust the pulsing rhythm, that is automatic.)
The pulse will start if you force a variable value (containing a ColorRGB color code) on the object, which object is the actual subject of the Item Memory Zone.

You need to activate a TriggerGroup to start pulsing on an object:

TriggerGroup= 1, A54, F291, F257

A54: define the object.
F291: add a ColorRGB Script command to a “long” variable.
F257: force the value of that variable into “Light on object. RedGreenBlue ambience (Long)” Item Memory Zone field.

The inner light effect needs a continuous force. If you stop forcing then the original color will be restored “forever”.

Note:
"Light on object. RedGreenBlue ambience (Long)" Item Memory Zone field was called "Unknown (Light_D) (Long)" before TRNG 1.2.2.7.
Quote:
When you force values into memory zone fields, then you can force the values in a “single” or a “continuous” way. You need to use a “continuous” way if the effect is not permanent (but you want a permanent one), because, if you force it in a “single” way, then the effect will be performed only for a moment.
If you force in a “continuous” way then you need to stop forcing to stop the effect.

Force in the single way:
Activate that TriggerGroup with a “single” F118.

Start forcing (for the continuous way):
- activating the TriggerGroup with a “multiple” or "continuous" F118, or
- activating a disabled Global Trigger with F109 to activate the TriggerGroup.

Stop forcing (for the continuous way):
- a condition of the “multiple” TriggerGroup will go false (which mostly means Lara leaves the trigger zone of F118), or
- the “continuous” TriggerGroup will be deactivated with an F192, or
- that Global Trigger will be deactivated with F109 to deactivate the TriggerGroup, or
- the condition of that GlobalTrigger will go false, or
- maybe in some special way. (For example, if the object is a pickable item with the inner light effect, then the continuous force will stop even if Lara picks up the object.)
2. Light emitter nullmeshes

These light emitters are nullmeshes, so they are invisible in the game. It means they work like light bulbs: we can’t see them, we only can see the light they emit. – The differences are:

a, The light bulbs can be switched on only if the bulb is in a flipped room, not being in the “original” room, and you activate the flipmap. (Or: if the bulb is in an “original” room of a flipmap, not being in the flipped room, when you just see the flipped room, and now you deactivate the flipmap.)
The light bulbs can be switched off only if the bulb is in an “original” room of a flipmap, not being in the flipped room, and you activate the flipmap. (Or: if the bulb is in a flipped room, not being in the “original” room, when you just see the flipped room, and now you deactivate the flipmap.)
But the nullmeshes are objects so they can be activated/deactivated with triggers.

b, The action sphere shape of the light bulbs could be different. (See eg. the shape of a Light or a Spot bulb.)
The action sphere of the nullmeshes is always globe shaped.

c, The color and the action sphere size of the light bulbs are constant in the game – but you can customize them in the Room Editor.
On the other hand:

- The color and the action sphere size of RED_LIGHT, GREEN_LIGHT and BLUE_LIGHT nullmeshes are constant in the game – and you can’t customize them anyhow.
- The color and the action sphere size of the AMBER_LIGHT, WHITE_LIGHT, BLINKING_LIGHT nullmeshes are constant in the game – but you can customize them in the Script or with numbers typed in the OCB window.

d, The light effect of the light bulbs, RED_LIGHT, GREEN_LIGHT and BLUE_LIGHT nullmeshes are static in the game.
The light effect of the AMBER_LIGHT, WHITE_LIGHT, BLINKING_LIGHT nullmeshes are changing in the game.

e, The nullmeshes are objects, so you can do several things with them that are impossible with light bulbs. (Eg. you can move nullmeshes up/down with ACTION triggers.)

Perhaps you cannot find some of these nullmeshes in any WAD. - It doesn’t matter, nullmeshes always look the same.
So eg. if you copy an AI_FOLLOW nullmesh in WADMerger into RED_LIGHT slot, that will work as a perfect RED_LIGHT nullmesh.


So the light emitter nullmesh types are:

a, RED_LIGHT nullmesh emits some average red static light in a globe with about a 3 square sized radius, when activated, till deactivated.

b, GREEN_LIGHT nullmesh emits some average green static light in a globe with about a 3 square sized radius, when activated, till deactivated.

c, BLUE_LIGHT nullmesh emits some average blue static light in a globe with about a 3 square sized radius, when activated, till deactivated.

d, AMBER_LIGHT nullmesh emits not some amber, but some light green light, that pulsing in a rhythmical way, when activated, till deactivated.
Use a Customize= CUST_LIGHT_OBJECT Script command to customize its values:

- The light color. (Usually the amber light color is light green, which is the stronger at the maximum intensity of the pulse and the weaker at the minimum intensity. If you customize the color, then the light will be pulsing between the customized color and white.)
- The action sphere size.
- The speed (rhythm) of the pulse. (It is -2048 by default. Between -2048 and 0 the rhythm will be lower, with a bigger negative number than -2048 the rhythm will be faster. Always use the power of 2: -2, -4, -8, -16 etc.)

Note:
The effect of an AMBER_LIGHT could be more special with numbers typed in the OCB window (working even in TRLE):

1 – the first activation of the nullmesh starts with a noisy (106 EXPLOSION2_VOLWAS80 sound slot) “light explosion”, colored light green.
2 – an additional effect also works when the nullmesh is active: all the outside rooms of the level (i.e. rooms marked by the O button) will be filled up with a light green fog. (But you can’t see that fog of the outside rooms if you are not in them!)
Till the object is active, it plays a 355 MAPPER_PYRAMID_OPEN sound slot continuously, as if it were a sound icon.

e, WHITE_LIGHT nullmesh emits some light in a globe with about a 3 square sized radius, when activated, till deactivated. - See in NG Center/Reference how you can adjust the light color with OCB values.
When activated, the light starts blinking in a random-like way – as if a neon lamp had just been switched on. After some seconds, the blinking stops, and the light will be almost static, vibrating only a bit.
Use a Customize= CUST_LIGHT_OBJECT Script command to customize its values:

- A static light color. It is not to customize the blinking-vibrating color, but it is another color, that tries to override that blinking-vibrating color. –The RGB values of the static light are useful if they are a bit larger than the RGB values of the blinking-vibrating color. In this case, the object will emit the static light in the short moments during the blink-vibration procedure, when the blinking-vibration is just not performing its light. (So this time the object emits two colors: a static and a changing one.)
- The action sphere size.
- The time (in tick frames) that elapses between the activation and the end of the blink. (It is 160 by default. Recommended customized values are from 96 to about 200.)

f, BLINKING_LIGHT nullmesh emits some yellow light in a globe with about a 3 square sized radius, when activated, till deactivated.

The object will be seeable in the game this time. However, you can’t use Invisible button at the object, to prevent the visibility, because that causes malfunction: the object can’t be activated. Instead of that, hit Empty button in WADMerger – that makes the object invisible even in WADMerger and Room Editor.

The light flashes only for a moment, again and again, with 1 second pause between the flashes.
Use a Customize= CUST_LIGHT_OBJECT Script command to customize its values:

- The light color.
- The action sphere size.
- The length of the pause.

Note:
Type some value in the OCB window. About 25 seems 1 second. – It means a negative timer for the object. (But, as opposed to “real” negative timers in triggers, it will work only for the very first activation of the object.)
It works even in TRLE.

Variable-based customization of light emitter nullmeshes:

1. A pause (at a given light intensity, not deactivating the light) in the pulse of the AMBER_LIGHT.

You need a TriggerGroup:

TriggerGroup= 1, A54, F263, F257

A54: define the object.
F263: adjust a PARAM_BIG_NUMBERS value in a “short” variable.
F257: force the value of that variable into “Custom_A (Different usage in according with type of item) (Short)” Item Memory Zone field.

The number of PARAM_BIG_NUMBERS must be between 0 and 16384. The bigger the value is the bigger the intensity is.
You need a continuous force this time, as I said above at the inner light effect. If you stop forcing then the pulse will restart from the forced intensity.

Notes:

- The actual intensity doesn’t matter now. So eg. if the actual intensity is 4096 when you start a pause with 256 intensity, then the pulse will “freeze”, jumping from 4096 to 256 intensity.
- If the light object hasn’t been activated when you activate the TriggerGroup, then the effect “really” starts when the object has been activated. (So now the amber light starts with the constant, forced light intensity, and starts pulsing only if you stop the forced effect.)
- If you customized the color, then the intensity is constant, but two colors will dissolve to each other rhythmically. One is the customized color – this is what you see at the values that were the minimum intensity values previously –, and the other color is white - this is what you see at the values that were the maximum intensity values previously.
- If you want to study if the amber light (paused or not) is just at a given light intensity, then use this condition: see “Hidden Triggers” tutorial, Chapter 1.56.1. (The word “formula” in the text means you need to type the triggers in a TriggerGroup.)
The easiest solutions to use the conditions:

= The TriggerGroup ID is referred by a C15 trigger. There is a TRIGGER placed in the map, overlapped with the CONDITION trigger. The TRIGGER will be executed if Lara is in the trigger zone when the CONDITION is true.
= The TriggerGroup ID is referred by the IdConditionTriggerGroup field of a GlobalTrigger.

2. Adjusting the life cycle of the blinking-vibrating WHITE_LIGHT to a given moment.

I mean, as I said, when the white light has been triggered then it starts blinking with different intensities. After 160 (or customized) tick frames it becomes (more or less) calm, vibrating a bit. – This is the life cycle.

You need a TriggerGroup:

TriggerGroup= 1, A54, F263, F257

A54: define the object.
F263: adjust a PARAM_BIG_NUMBERS value in a “short” variable.
F257: force the value of that variable into “Custom_A (Different usage in according with type of item) (Short)” Item Memory Zone field.

Some examples how to use this customization (with the default 160 maximum now):

- Start the light then force 100 (in a single way) into the field. The intensity jumps to the intensity value of the 100th frame, and the light becomes calm in 60 frames (160-100=60).
- Start the light then force 60 (in a continuous way) into the field. The intensity jumps to the intensity value of the 60th frame, and keeps that intensity. If you stop forcing then the light becomes calm in 100 frames (160-60=100).
- Force 80 (in a single way) into the field and start the light. The light will show up with the intensity of the 80th frame, and the light becomes calm in 80 frames (160-80=80).
- If the light has become calm then force 40 (in a single way) into the field. The light starts blinking again, and then it becomes calm again in 120 frames (160-40=120).

Note:
If you want to study if the life cycle of the white light is at a given tick frame, then use this condition: see “Hidden Triggers” tutorial, Chapter 1.57.1. See more about the formula at the start of Page3 of that tutorial.
You can use even „bigger” or „smaller” conditions in the TriggerGroup, instead of “equals”, if you want, but don’t forget: we need to be careful with the “less” condition, because 0 is less than any value, so the condition will also be true if the light has not started yet. That is why you also need a “>=1” condition in the TriggerGroup now.

Some useful workarounds:

1. Static light nullmeshes with customized colors.


So the problem is what if we want to (de)activate light emitters having (only) static lights, with triggers, but we want to use customized colors (and maybe with customized action sphere size as well)?

- So we can’t use light bulb, because they cannot be (de)activated with triggers.
- So we can’t use RED_LIGHT, GREEN_LIGHT or BLUE_LIGHT nullmeshes, because they have constant red, green, blue colors (and constant action sphere sizes).

We can have maximum three customized colors (and action sphere sizes) in each level, to solve the problem:

a, If you don’t want to use a pulsing AMBER_LIGHT in a level, then make a pause for the light, just as I said before, never stopping the pause effect, so the emitter will always emit a static light.
You can also use a Customize= CUST_LIGHT_OBJECT Script command to customize the action sphere size as well, if you want.

b, If you don’t want to use a blinking-vibrating WHITE_LIGHT in a level, then use a Customize= CUST_LIGHT_OBJECT Script command to customize the static light color value (and maybe the action sphere size as well) of the WHITE_LIGHT.
This time the RGB values of the static light must be much larger than the RGB values of the blinking-vibrating color. In this case, the blinking-vibrating color will be totally overridden, the WHITE_LIGHT will emit a totally static light.
(The recommended OCB value for the object is 0 now: “no blinking-vibrating color”. So this time the scripted color code could be anything, because the “any color code” is always “much larger” than 0.)

c, If you don’t want to use a flashing BLINKING_LIGHT in a level, then use a Customize= CUST_LIGHT_OBJECT Script command to customize the length of the pause (and maybe the action sphere size as well) of the BLINKING_LIGHT.
The pause must be 0, so the light will be static, not flashing.

2. Using some possibilities of TRNG.

Only two examples:

a, You want two flashing light colors in your level. One color is used by the BLINKING_LIGHT, but the other color is used by the WHITE_LIGHT.
The WHITE_LIGHT must have a clearly static light, as I just said, with 0 OCB color code, plus controlled by this Script:

Organizer= 1, FO_LOOP, IGNORE, 1, 1, 1, 2
TriggerGroup= 1, A43 to activate WHITE_LIGHT
TriggerGroup= 2, A44 to deactivate WHITE_LIGHT

Now, in each 1 second, the light will be turned on/off, continuously, when you start the Organizer with F127.

b, Or: you want to move a BLINKING_LIGHT up and down continuously, which is something totally new, that is why you activate the light and then activate an A36 trigger to move it up/down.

3. Lights with AddEffect Script command

AddEffect Script command will define a visual effect (including some light types) you can attach to a given object (even Lara).
There are some ACTION/FLIPEFFECT triggers that use an AddEffect ID as a parameter. If you activate that trigger then that AddEffect will be placed/removed on/off the given object:

- A48 will place the effect on the given Moveable object.
- A49 will remove the effect off the given Moveable object.
- A83 will place the effect on the given Static object.
- A84 will remove the effect off the given Static object.
- F87 AnimCommand will place the effect on the given Moveable object, at that frame, for a given time. (Or, in infinite case, you can abort it by A49.)
- Not a trigger: with DRT_ADD_EFFECT constant in a Customize= CUST_DARTS Script command, the effect will be attached to the darts.

You can create maximum 99 AddEffect commands for each level, choosing ID’s for them:

- from a 1, 2, 3,… 126, 127 interval, if they are controlled by ACTION triggers or
- from a 1, 2, 3,… 254, 255 interval, if they are controlled by FLIPEFFECT triggers or DRT_ADD_EFFECT.

See more in NG Center/Reference.


4. Flare light customization

See Customize= CUST_FLARE Script command, where you can customize the flare lights.

And I also recommend this tutorial:

http://www.tombraiderforums.com/show...ghlight=flares

Or if you’d like to use a PLS instead of flares:

http://www.tombraiderforums.com/showthread.php?t=205573

5. Screen light effects

F355 will create a colorful “burst of light” on the screen for a given time. (If the burst is infinite then remove it by activating F356.)

6. Vehicle headlights

Motorbike: OCB 1 disables the headlight when Lara is on the bike.
Jeep, motorboat, rubberboat: OCB 1 enables the headlight when Lara is in the jeep/boat.

Made using TRNG 1.2.2.7.

Last edited by AkyV; 16-10-15 at 14:49.
AkyV is offline  
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 04:18.


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