Surface commands
 
These are the commands which control brush surfaces: texture translation speed, angle, bounciness, waves, animated textures, etc. (gameX86 source code reference: surface.cpp)

Surface commands are colored in blue in my custom SinScript syntax coloring wordfile for UltraEdit32.


damage
 
Function
 
This inflicts the amount of damage specified in the command argument to the brush face. Inflicting damage to a brush face can make it trigger events if its "group" name is set to certain special characters. These events include things like changing the surface's lightstyle, switching to the next animated texture frame, triggering an entity or calling a thread. The inflicted damage is cumulative.

Syntax
 
@<group_name> damage <value>

Notes & examples
 
In order for a brush face to respond to damage, you first have to set the damage surface flag. Second, you have to set either the weak or normal surface flag. This is the minimum requirement. Afterwards, you can set other surface flags and fields to set what events will occur when the brush face is damaged.

What follows is a suite of 3 mini-tutorials. Each one describes with a practical example the 3 kinds of thing a brush face can do when damaged. In order of complexity, these are:
  • Make the brush face switch to the texture specified in the brush face's Next Animation field.
  • Make a brush face previously set to emit light change the amount or style of light it emits.
  • Make a brush face trigger an entity OR call a script thread (but not both at the same time).
  • Any combination of the above 3 effects.
Damage induced texture change mini-tutorial:

First, make a small rectangular room any size you want (256 x 256 x 256 is good). Load the biomech texture folder and select the texture 0wl_techwall1cpu. Draw a 128 wide by 128 high by 8 thick brush anywhere in the room. Align the texture if necessary.

Select one of the tall faces of the brush in the Camera view and do a Middle-Click on that face to grab it (this makes sure all the alignment values are stored in surf inspector). Open the surf inspector window and move it so it doesn't hide your texture selection window as seen in Figure 1 below:

Fig. 1
Figure 1: SinEd: Setting the parameters in surf inspector

Set the damage and weak surface flags and do a Ctrl-LeftClick on the texture named 0wl_techwall1cpu_brk in the texture selection window as show in steps 2 and 3 of Figure 1. Hit Apply or OK. That's it. That's all you need to do to make a brush face change to the next texture when damaged.

Save your map and compile it. Launch the game and load the map. Walk up to the brush face and shoot it. The texture will change from 0wl_techwall1cpu to 0wl_techwall1cpu_brk. Also, the brush face will tesselate (shed fragments of itself) so it looks like it shattered as can be seen in Figures 2 and 3 below:


Fig. 2
Fig. 3
Figure 2: The original texture

Figure 3: Shoot! - Next texture

So as you can see, it's not complicated at all to make a brush face switch to the next texture when damaged. So now you know what the damage surface flag is for. But what about the weak and normal surface flags? What are those for?

Very simple: they set the amount of damage required to make the brush face trigger the texture change (and all the other possible events as we will see later). The values are:
  • weak    : 11 points of damage or more must be inflicted to trigger events
  • normal : 91 points of damage or more must be inflicted to trigger events
  • both weak & normal set : 201 points of damage or more must be inflicted to trigger events
Well that's all good and fine but what does the damage script command have to do with all this? Here again, very simple: you can use the command to inflict damage to the brush face and make it trigger the events instead of requiring that the player shoots the brush face to inflict the required damage. This would be most useful in the case where you want the brush face to change textures as above but without player intervention. Here's an example:

In the same room as the above example, you want the "computer panel" brush face to switch to the "broken panel" texture at some point in the game without player intervention (when a scripted explosion goes off in the room for example). The damage command then comes in handy. But to be able to use it, you first have to name your brush face so you can refer to it in the script. This is what the group field in surf inspector is for.

Select the brush face and bring up surf inspector. Type the name panel1 in the group field as shown in Figure 4 below and click the Apply or OK button.


Fig. 4
Figure 4: SinEd: Setting the group field in surf inspector

Save your map and compile it. Now, all you need to do is write this simple script:

waitForPlayer
wait 5
@panel1 damage 11
end


Launch the game and load the map. Don't shoot the brush face, just wait for 5 seconds and the brush face's "computer panel" texture will change to the "broken panel" automatically.

Note:
A brush face does not tesselate when damaged by the script.


A few things to keep in mind when using this effect:
  • For best results, the "Next Animation" texture should be the same size as the original texture. If it isn't, it will be scaled to fit the brush face size.
  • If the "Next Animation" texture is the same size as the original texture, the alignment, scale and rotation values of the original texture are preserved in the next texture.
  • Do not make the "Next Animation" field of the original texture point to a texture which has its own "Next Animation" field set by default otherwise QBSP3 will refuse to compile.
With what you learned above about damage and group names, you should be ready to learn how to make a brush face produce other cool effects in the following mini-tutorials.


Damage induced light change mini-tutorial:

What's in a name right?... Well for group names, it can make a difference. In the previous tutorial, you learned that group names are used to give a brush face a name you can refer to in a script. But there's more to group names than just that.

By using certain special letters at the beginning of the group name followed by a number, you can make a light emitting brush face blink and change its amount of emitted light when damaged.

First, here's the list of the special letters and the effect they produce:

Special
Letter
Effect
O  turn emitted light Off
Q  reduce emitted light to a Quarter of its original value
H  reduce emitted light to Half of its original value
S  make emitted light blink Slowly
F  make emitted light blink Fast
Info courtesy of Mark Dochterman, Ritual Entertainment.


Then, the letter or combination of letters must be followed by a number*. This number has no particular meaning other than to signify the end of light control character string and give the brush face a unique group name. Please note that I used upper-case letters in the table above only to make them stand out visually: case doesn't matter at all for special letters in the group name.

*Note:
You can also use any letter other than O, Q, H, S or H to terminate the control string but using numbers is simpler, more convenient and avoids confusion. So I recommend sticking with numbers to terminate these special letters in group names.


So an actual example of a group name using this naming convention could be something like:

qo1

qo : are the light control letters portion of the group name (quarter light, then light off).

1   : is the unique ID number in the group name for that particular brush face.

The most current and obvious use for this feature is, of course, a wall or ceiling light fixture that goes out when shot. This, combined with a texture change on the brush face makes for an interesting effect, not to mention fun for the player. So let's make one.

First, make a small rectangular room any size you want (256 x 256 x 256 is good). Load the chemical texture folder and select the texture li_chem01. Draw a 32 wide by 64 long by 8 high brush and move it so it's flush with the ceiling. Align the texture if necessary.

Open the surf inspector window and move it so it doesn't hide your texture selection window as seen in Figure 5 below:

Fig. 5
Figure 5: SinEd: Setting the parameters in surf inspector

Do the following steps as illutrated in Figure 5 above:
  1. Select the bottom face of the brush in the Camera view and do a Middle-Click on that face to grab it (this makes sure all the alignment values are stored in surf inspector).
  2. Ctrl-LeftClick on the texture named li_chem01_brk in the texture selection window.
  3. Set the damage, weak and light surface flags.
  4. Set the Radiosity field (or the Direct Value field if you prefer) to 5000.
  5. Set the Group name to sq1 (slow blink, quarter light, unique ID no: 1).
Hit Apply or OK. Those are the flags and fields that must be set to make a brush face change to the next texture and change its emitted light when damaged.

Note:
You don't have to set a "Next Animation" to make a brush face change its light level or style. I chose to combine both effects for this tutorial because it looks more realistic for a light fixture to "break" with a light level change.


Save your map and compile it. Launch the game and load the map. Walk up to the light fixture, look up and shoot it once. Then shoot it a second time.

Fig. 6
Fig. 7
Figure 6: First shot - texture change & slow blink

Figure 7: Second shot - quarter light level

The first time you shoot the fixture, the texture will change from li_chem01 to li_chem01_brk and the light will blink slowly as represented in Figure 6 above.

The second time you shoot the fixture, the light will stop blinking and the emitted light level will step down to a quarter or its original value (thus 1250) as represented in Figure 7 above.

So even though these special letters might seem complicated at first, once you understand the basic principle, they are really easy and fun to use. There's a few things you should keep in mind though:
  • Brush faces with the same group name are all tied together. If you shoot one of them, they will all change states.
  • The unique ID number after the control letters is not required as such for the effect to work: if I had given the brush face the group name sq instead of sq1, it would have worked just the same. It is simply a safety measure to keep your lights separate.
  • Keep track of all the light fixtures that use the same control letters which you want to keep separate. Name them in sequence as you create them (for example: fo1, fo2, fo3, etc.).
Now there's another important thing to mention here. The damage inflicted to a brush face is cumulative. Why is this important? Because in principle, you can use as many control letters as you want in any possible combination. BUT... remember, the weak surface flag sets the required amount of damage to inflict 11 points of damage for each event. AND... The Magnum pistol inflicts more than 11 points of damage per shot. I'm not sure exactly how much but let's say it's 20.

The consequence of this is that the second and third pistol shots will trigger 2 events at once if the weak flag is used:
  • First pistol shot: 20 points damage. 11 points are used to trigger the first event, 9 points cumulated.
  • Second pistol shot: 20 points damage + 9 cumulated = 29. 22 points are taken to trigger 2 events at the same time, 7 points cumulated.
  • So on and so forth...
This is why using more than 2 control letters for light fixtures doesn't work well with player induced damage. Using the normal flag might seem like the solution but having a light fixture that needs 5 or 6 pistol shots to break is rather silly.

So for light fixtures, the solution is to limit yourself to group names with 2 control letters maximum which should cover most of your needs anyway. For more sophisticated needs, you would have to make the light fixture brush a func_scriptobject, make it respond to damage with the ondamage command and include a "@groupname damage 11" command in the scriptobject's thread after the pause command. But this is way beyond the scope of this tutorial.


Damage induced triggering and thread calling mini-tutorial:

In the previous tutorial, you learned that using special letters in the group name enables a brush face to trigger any number of lightstyle changes to its own surface. But, as if that weren't enough, there's even more to to the naming scheme than special letters.

By adding an underscore at the end of the [control letters - unique ID no.] combination, you signify to the group name that what follows the underscore is either the targetname of an entity or the name of a script thread.

Ironically enough, of all 3 possible brush face damage features, this one is the simplest to use but knowledge of how to use the previous features was necessary to get to this one. Why? Because in order for this feature to work, the light* surface flag must be set (in addition to the mandatory damage and weak or normal surface flags) and the group name must begin with a special letter.

*Note:
In the case where you want the brush face to trigger an entity or call a thread when damaged but you don't want a lightstyle change, just don't set any Radiosity or Direct Value for that face in surface inspector.


The most typical and simplest use of this feature is a ceiling light fixture that throws sparks after it goes out when shot. This, combined with a texture change on the brush face and a lightstyle change as illustrated in the previous tutorials makes for an really cool effect. Just keep in mind that this is only one example of this feature and that the possibilities are really endless.

So for this, let's start from the map we made in the previous example and add a few things to create this effect. First, add a trigger_randomparticles entity and place it right underneath the light fixture's bottom face as shown in Figure 8 below:

Fig. 8
Figure 8: SinEd: Inserting and placing the sparks generator entity

To optimize the realism of the effect, move the trigger_randomparticles entity 4 map units into the light fixture brush. This will locate the actual origin of the sparks so they look like they're really coming from the surface of the fixture. Then, set the entity's key/value pairs and spawnflags to the same values as seen in Figure 8 above:
  • angles = 180 0 0 : Orients the particles to be thrown downward.
  • count = 50 : Sets the amount of thrown particles to 50. Not essential but looks better.
  • targetname = sparks1 : This is essential to be able to trigger the entity.
  • BRIGHT spawnflag set : Makes sparks brighter. Not essential but looks better.
Now we have to change the group name of the light fixture's brush face so it will trigger the trigger_randomparticles entity when shot. Select the brush face and bring up surf inspector:

Fig. 9
Figure 9: SinEd: Setting the group name to target the sparks generator entity

All you have to do now is change the group name to s1_sparks1 as seen in Figure 9 above. Don't change anything else! Hit Apply or OK. Everything is now ready for the effect to work. But did we just do here? Let's take it step by step:
  • First, we changed the special control string from its previous value sq1 to s1. As we've seen before, the letters sq would cause 2 events to be triggered. The first pistol shot triggers the first event (slow blink) and the second shot triggers the second event (quarter light). Here, we don't want this because the second event would re-trigger the trigger_randomparticles entity thereby turning it off. So the control string was reduced to only one event: s for slow blink).
  • Second, we added a "_" (underscore) character right after the control string s1. This is essential: it signifies that what comes next is either the targetname of an entity to trigger or the name of a script thread to call.
  • Third, we added sparks1 after the underscore which is the targetname of the trigger_randomparticles entity.
Note:
Here again, assigning a unique ID number in the control string is not essential to make this work. If I had used the group name s_sparks1, this would have worked just the same. But not assigning ID numbers is an extremely bad habit to get into because chances are you'll want more than one fixture of the same type in a map. Remember: if they all have the same group name, they will all go out and make sparks when you shoot one. So always add an ID number to your group name's control characters.


Save your map and compile it. Launch the game and load the map. Walk up to the light fixture and shoot it.

Fig. 10
Fig. 11
Figure 10: Sparks thrown from light

Figure 11: Sparks expanding

When you shoot the light fixture, the texture will change to li_chem01_brk, the brush face will blink slowly and sparks will be thrown from it at random time intervals as you can see in the actual game screenshots in Figure 10 and 11 above. One of the nice things about the trigger_randomparticles entity is that it produces a matching electrical spark sound by default.

Now you can also make the brush face call a thread instead of triggering an entity. The syntax of the naming scheme for the group name is exactly the same for this. So, for the next example, all you need to do is change the sparks1 part of the group name to the name of the thread to call.

Select the brush face of the light fixture once again, bring up the surf inspector and change the group name from s1_sparks1 to s1_sparkthread1. Hit Apply or OK. Save your map and compile it. Write the following script:

waitForPlayer
end

sparkthread1:
trigger $sparks1
end


Launch the game and load the map again. Shoot the light fixture. You will get exactly the same result as in the previous example. I just used another method to do the same thing simply to demonstrate the ability for the brush face to call a thread when damaged.

So that's about it for this feature. Just a few things you should keep in mind though:
  • You can make a brush face trigger an entity or call a script thread when damaged but not both at the same time.
  • If you have an entity and a script thread which both have the same name and the group name is set so it points to that name, the entity will take precedence and will be triggered when the brush face is damaged but the thread will not be called.
  • If you have several tasks to have accomplished when the brush face is damaged (such as triggering several different entities), make the group name point to a script thread and trigger those entities from within the thread like in the above example. You'll save yourself a lot of headaches that way. Let the script work for you.
Hopefully by now, "damageable" brush faces hold no secret for you anymore. Have fun making those fixtures and don't forget that experimentation is the road to know-how. If you like, you can download an example map which contains samples of all the things I covered in the tutorials.



frame
 
Function
 
Changes the texture on brush faces which have the "next Animation" field set. The "group" field must also be set.

Syntax
 
@<group_name> frame <frame_number>

Notes & examples
 
The <frame_number> texture corresponds to the brush face's sequence of textures in the animation. Here's how it works:
  • Frame 0 is always the brush face's original texture.
  • Frame 1 is the texture set in the first one's "Next Animation" field.
  • Frame 2 is the texture set in the second one's "Next Animation" field.
  • So on and so forth up to the last one in the set.
Here's a mini-tutorial to help you in the use of this command:

Frame command mini-tutorial:

An example of a set of textures for which 4 animation frames are set by default is the biomech/0cp_mech1 to biomech/0cp_mech3 textures. Draw a 128 x 128 x 8 thick brush and texture one of the 128 x 128 faces with the 0cp_mech1 texture. Set the group name to faceanim. The frame order will be as follows when using the corresponding frame command underneath the picture:

0cp_mech1
1cp_mech1
2cp_mech1
3cp_mech1
0cp_mech1
@faceanim frame 0


1cp_mech1
@faceanim frame 1


2cp_mech1
@faceanim frame 2


3cp_mech1
@faceanim frame 3


It's important to note that if you change the texture of that same brush face to the 2cp_mech1 texture for example, the frame order is changed and will be as follows:

2cp_mech1
3cp_mech1
0cp_mech1
1cp_mech1
2cp_mech1
@faceanim frame 0


3cp_mech1
@faceanim frame 1


0cp_mech1
@faceanim frame 2


1cp_mech1
@faceanim frame 3


Now I used a set of textures which have their Next Animation field set by default so you can use the frame command on those right away provided you uncheck the animate surface flag (also set by default) on the texture you chose to set your brush face to. This will prevent the texture from animating automatically.

Of course, if you want to use the frame command with textures which don't have their Next Animation field set by default, you'll have to set it yourself. This can be done in a very quick and convenient way with a Ctrl-LeftClick on the texture in the texture selection window as illustrated in the Damage induced texture change mini-tutorial in the notes of the damage command.

Here's a practical example on how to set up the face of a brush so the frame command can be used to make one of those typical LOCKED/OPEN security card buttons in Sin:
  • Load the generic/comp_panel texture folder and select the cp_card_locked(yel) texture.
  • Draw a brush 32 wide by 32 high by 4 thick and move the brush so it's flush with a wall.
  • Select the front face of the brush, bring up surf inspector and set the Next Animation field to the cp_card_open(yel) texture (Ctrl-LeftClick on it in the texture selection window).
  • Do NOT set the animate flag
  • Set the group name to lockbut1. Click on Apply or OK.
Next, make your brush a func_scriptobject and set the following key/value pairs:
  • targetname = button1 : the button's name in the script.
  • key = yellowcard : this makes it so the player needs the yellow card to use the scriptobject.
Now save and compile your map. Write the following script:

thread security_button1
waitForPlayer
wait 10
*1 give yellowcard 1
*1 playsound dialog/general/blade/gotit.wav 1 2
end

security_button1:
$button1 onuse unlock_button1
pause

unlock_button1:
$button1 playsound environment/computer/beeps/trek7.wav 1 2
@lockbut1 frame 1
end


Start the game and load your map. Try to use the button right away. You will notice that for 10 seconds, the button doesn't change and a Yellow card icon with the message "You need this item" is displayed on the screen as can be seen in Figure 1 below:

Fig. 1
Fig. 2
Figure 1: cp_card_locked(yel)
frame 0


Figure 2: cp_card_open(yel)
@lockbut1 frame 1


After those 10 seconds, the script will give you the Yellow security card and you will hear Blade say "Got it!". You will also see a yellow card icon appear in your iventory on the left side of the player's HUD. Now if you use the button, you will hear a computer beep and the texture of the button face will change to cp_card_open(yel) upon the execution of the @lockbut1 frame 1 command as can be seen in Figure 2 above.

Of course, if you wanted the button face to go back to the original texture, all you would need to do is issue the command @lockbut1 frame 0. The example above is the simplest and most frequent usage of the frame command. But what if you want to have more than 2 frames of texture to choose from on your button face? This is where the map's surface file comes into play.

The surface file enables you to change a texture's default flags and field values without modifying the SWL texture itself. This file is read by QBSP3 at compile time and changes a texture's default values for that map only. Once the map is compiled into a .bsp file, the surface file is not required for the game itself because the information was merged into the .bsp itself.

I will now demonstrate how you create and set new defaults for a surface file with another practical example. Save the map you created in the previous example as secbutton.map and do the following steps in SinEd:
  • Click on the Misc menu and select Set Surface File.
  • In the dialog that appears, replace sample.txt (default) for secbutton.srf*. Leave the path that precedes the file name intact. Click OK.
  • Please note that the surface file is not created yet. All you did in the previous step is to tell the editor in what file to save new surface info when you'll do a Set Default in surf inspector.
  • Make sure nothing is selected in your map. Go to the texture selection window and select the texture cp_card_open(yel).
  • Open the surf inspector and set the Next Animation field to cp_card_idel(yel) (use the regular Ctrl-LeftClick method).
  • Click on the Set Default button in surf inspector. You have just created and saved the surface file secbutton.srf. You have also just set the frame 2 texture of your button face.
Note:
The file extension can be anything you want for a surface file. I chose the .srf extension in this example because I find it logical and convenient but you use .txt if you prefer.


Now compile your map again. Also, change the previous script to this one:

thread security_button1
waitForPlayer
*1 give yellowcard 1
end

security_button1:
$button1 onuse unlock_button1
pause

unlock_button1:
$button1 playsound environment/computer/beeps/trek7.wav 1 2
cycle_button:
@lockbut1 frame 1
wait 0.2
@lockbut1 frame 2
wait 0.2
goto cycle_button
end


Launch the game, load the map, walk up to the button and use it. You don't have to wait 10 seconds until you get the Yellow security card this time. What happens next is that the button face's texture will first change to cp_card_open(yel) and blink between the cp_card_open(yel) and cp_card_idel(yel) textures (frame 1 and frame 2) continuously as represented in Figures 3 and 4 below:

Fig. 3
Fig. 4
Figure 3: Before using button
frame 0


Figure 4: After using button
frame 1 <--> frame 2


The 2 examples used in this tutorial represent the most elementary way to use this command. But if you understand the principle, you can quickly see that the frame command along with custom surface files provide the map designer with an absolutely limitless and unprecedented level of control over texture frame animation on brush faces.


frequency
 
Function
 
This command actually has 2 possible functions. The first is to set the bounciness of the brush faces of normal brushes. This will determine how bouncy the surface is when the player collides with it. The second is to set the speed of oscillation of waves on the face of a water textured brush with the "wavy" surface flag set. In both cases, a "group" name must be assigned to the brush face.

Syntax
 
@<group_name> frequency <value>

Notes & examples
 
1. Setting the bounciness of a regular brush face:

If the brush is a not a water brush (IOW, as long as the water content flag is not set), giving the brush face a non-zero value will make the brush bouncy when the player jumps on it (in the case of a horizontal surface) or runs into it (in the case of a vertical surface). The higher the value, the more bouncy the brush face will be. A typical example of a bouncy brush face is the couch in Levelord's Spry map.

2. Setting the speed of waves on a brush face of a water brush:

First, the wavy surface flag must be set in order to enable waves on the face of a water textured brush. Water type textures have the water content flag set by default. This is what really makes them water and not the texture as such. So you can also have waves on non-water textured brushes as long as you set the water content flag for that brush and the wavy surface flag on the brush face which you want to make waves. The higher the value, the faster the waves will oscillate. You can download an example map of waves here.

Note:
bounciness or speed of waves can also be set in SinEd by the value of the Restitution field in the surface inspector. The default value is 0 which means no bounciness at all or a wave speed 0 for water brushes. This command enables you to alter the value during the game. Figure 1 below shows the location of the Restitution field in surf inspector:


Fig. 1
Figure 1: Restitution field


magnitude
 
Function
 
This command actually has 2 possible functions. The first is to set the friction coefficient of the brush faces of normal brushes. This will determine how slippery the surface is when the player walks on it. The second is to set the amplitude or height of waves on the face of a water textured brush with the "wavy" surface flag set. In both cases, a "group" name must be assigned to the brush face.

Syntax
 
@<group_name> magnitude <value>

Notes & examples
 
1. Setting the friction coefficient of a regular brush face:

If the brush is a not a water brush (IOW, as long as the water content flag is not set), giving the brush face a value lower than 1.0 will make the brush slippery when the player walks on it. The lower the value, the more slippery the brush face will be. This property could be used to simulate a wet floor or ice for example.

2. Setting the amplitude or height of waves on a brush face of a water brush:

First, the wavy surface flag must be set in order to enable waves on the face of a water textured brush. Water type textures have the water content flag set by default. This is what really makes them water and not the texture as such. So you can also have waves on non-water textured brushes as long as you set the water content flag for that brush and the wavy surface flag on the brush face which you want to make waves. The higher the value, the higher the waves will oscillate. You can download an example map of waves here.

Note:
friction or height of waves can also be set in SinEd by the value of the Friction field in the surface inspector. The default value is 1.0 which means normal friction or an average wave amplitude for water brushes. This command enables you to alter the value during the game. Figure 1 below shows the location of the Friction field in surf inspector:


Fig. 1
Figure 1: Friction field


trans_angle
 
Function
 
In SiN, textures can be made to scroll or translate on a brush face. This command sets the angle at which the texture will translate on the brush face. The "group" name must be set.

Syntax
 
@<group_name> trans_angle <angle_value>

Notes & examples
 
The effective angle of translation of a texture is affected by a these factors:
  • Giving the texture a rotation value in surf inspector
  • Giving the texture a negative horizontal or vertical stretch to mirror the texture.
Fortunately, you can rely on the white arrows that are displayed on selected brush faces in SinEd's camera view most of the time to predict in what direction the texture will translate. You can then note the results and use the information to determine the angle argument(s) you will need to use with this command if you intend to change the angle of translation of a brush face during the course of the game.

Unfortunately, you can't rely on the white arrows that are displayed on selected brush faces in SinEd's camera view all of the time. Here's how this works:
  • Rotating the texture will rotate the white arrow along with it. If you then set the Translation Angle field, the white arrow will again rotate to add the angle offset and the final orientation of the arrow is reliable (IOW, it points in the right direction).
  • If you scale the texture either horizontally or vertically with a negative value to mirror the texture, that's when things go sour and you cannot rely on the direction of the white arrow anymore.
  • If you scale the texture both horizontally and vertically with a negative value to mirror the texture, then everything goes back to normal and you can rely on the direction of the white arrow.
  • If you scale the texture both horizontally and vertically with a positive value, then scaling doesn't affect anything at all and you can rely on the direction of the white arrow.
The angle of texture translation can also be set in SinEd by the value of the Translation Angle field in the surface inspector. The default value is 0.0 which means 0 degrees relative to the current rotation value of the texture. This command enables you to alter the value during the game. Figure 1 below shows the location of the Translation Angle field in surf inspector:

Fig. 1
Figure 1: Translation Angle field

Note:
In order for a texture to be able to translate in the game, either automatically or through the use of the actual texture translation commands (transOn, transToggle and transOff), the translate surface flag must be set. The Translation Magnitude and Translation Angle fields however, don't absolutely have to be set in surf inspector because they can be set with the trans_mag command and this command respectively.



translucence
 
Function
 
This sets the translucence of the texture on a brush face. The "group" name must be set.

Syntax
 
@<group_name> translucence <value>

Notes & examples
 
The translucence <value> ranges from 0.0 - 1.0 (0 is opaque, 1 is 100% translucent).

The translucence can also be set in SinEd by the value of the Translucent field in the surface inspector. The default value is 0.0 which means not translucent at all. This command enables you to alter the value during the game. Figure 1 below shows the location of the Translucent field in surf inspector:

Fig. 1
Figure 1: Translucent field

Note:
In order for this command to work, the translucent content flag must be set for all the faces of the brush. Therefore, the same group name must also be assigned to all the faces of the brush. The Translucent field however, doesn't absolutely have to be set in surf inspector because it can be set with this command.



trans_mag
 
Function
 
In SiN, textures can be made to scroll or translate on a brush face. This command sets the speed at which the texture will translate on the brush face. The "group" name must be set.

Syntax
 
@<group_name> trans_mag <speed_value>

Notes & examples
 
The <speed_value> at which the texture will translate is in map units per second.

The speed of texture translation can also be set in SinEd by the value of the Translation Magnitude field in the surface inspector. The default value is 0.0 which means 0 units/sec (stopped). This command enables you to alter the value during the game. Figure 1 below shows the location of the Translation Magnitude field in surf inspector:

Fig. 1
Figure 1: Translation Magnitude field

Note:
In order for a texture to be able to translate in the game, either automatically or through the use of the actual texture translation commands (transOn, transToggle and transOff), the translate surface flag must be set. The Translation Magnitude and Translation Angle fields however, don't absolutely have to be set in surf inspector because they can be set with this command and the trans_angle command respectively.



transOff
 
Function
 
In SiN, textures can be made to scroll or translate on a brush face. This command turns off texture translation. The "group" name must be set.

Syntax
 
@<group_name> transOff

Notes & examples
 
If the command is issued while the texture is translating on the brush face, it just makes it stop translating. Afterwards, you can make the texture start translating again with the transOn or transToggle commands.

Note:
In order for a texture to be able to translate in the game, the translate surface flag must be set.



transOn
 
Function
 
In SiN, textures can be made to scroll or translate on a brush face. This command turns on texture translation. The "group" name must be set.

Syntax
 
@<group_name> transOn

Notes & examples
 
If the command is issued while the texture is not presently translating on the brush face, it will make it start translating at the current magnitude (speed) and angle values.
  • The current translation speed is determined either by the value set in the surface inspector's Translation Magnitude field or by the last trans_mag command.
  • The current translation angle is determined either by the value set in the surface inspector's Translation Angle field or by the last trans_angle command.
You can make the texture stop translating with the transOff command.

Note:
In order for a texture to be able to translate in the game, the translate surface flag must be set.



transToggle
 
Function
 
This does exactly the same thing as the transOn command. See notes below.

Syntax
 
@<group_name> transToggle

Notes & examples
 
According to what I saw in the source code, this is supposed to turn on texture translation if it's currently off and vice-versa. But experimentation has proven otherwise. I was not able to make a texture stop translating with this command, only start it. So for all intents and purposes, it's the same as transOn unless somebody can prove me wrong.