Here I'll show a few examples of the new scripting allowed in ETPro, and attempt to explain what exactly it's doing. First off, I'll start with a simple example, where a model (in this case, a dinghy) is inserted into the map.
Code: Select all
create
{
scriptname "dinghy1"
origin "2650 600 100"
classname "misc_gamemodel"
modelscale 1
contents 1
mins "-90 -90 -25"
maxs "90 90 25"
clipmask 1
model "models/mapobjects/dinghy_sd/dinghy.md3"
}
Now, to break down how it works. The create{ } command will place an entity into the map, at the spot specified by the "origin" key. The scriptname specifies the name that the entity will have in the map, and it is what seperates it from other entities in the map (which can cause quite a few problems.)
Code: Select all
create
{
scriptname "dinghy1"
origin "2650 600 100"
}
Code: Select all
create
{
scriptname "dinghy1"
origin "2650 600 100"
classname "misc_gamemodel"
}
Code: Select all
create
{
scriptname "dinghy1"
origin "2650 600 100"
classname "misc_gamemodel"
modelscale 1
contents 1
}
Code: Select all
create
{
scriptname "dinghy1"
origin "2650 600 100"
classname "misc_gamemodel"
modelscale 1
contents 1
mins "-90 -90 -25"
maxs "90 90 25"
clipmask 1
model "models/mapobjects/dinghy_sd/dinghy.md3"
}
This was a very basic example of scripting, and now I'll be listing some more advanced examples of scripting.
Example 1: Battery's Back Door and Dynamite
Code: Select all
//bani
create
{
scriptName "backdoor"
classname "func_explosive"
targetname "backdoor"
origin "4608 -4594 1024"
mins "-63 -10 0"
maxs "63 10 128"
spawnflags 1 // AXIS_OBJECTIVE(1)
eflags 65536 // EF_FAKEBMODEL
svflags 1 // SVF_NOCLIENT
}
//bani
create
{
scriptName "backdoor_obj"
classname "trigger_objective_info"
targetname "backdoor_obj"
target "backdoor"
origin "4608 -4601 1024"
mins "-95 -85 0"
maxs "95 85 128"
spawnflags 17 // AXIS_OBJECTIVE(1) | CUSTOMIMAGE
track "the Back Door"
shortname "Back Door"
customaxisimage "gfx/limbo/cm_radar_maindoor"
}
//bani - bug fixes
create
{
scriptName "bugfix1"
classname "func_fakebrush"
origin "3632 -4313 881"
contents 65536 // CONTENTS_PLAYERCLIP
mins "-40 -1 -20"
maxs "40 1 10"
}
Code: Select all
create
{
scriptName "fueldumphq_obj"
classname "team_WOLF_objective"
targetname "fueldumphq_obj"
origin "-10853 -2036 6" // z = CC_FILTER_ALLIES(2) | CC_FILTER_SPAWNS(4)
spawnflags 2 // TEAM_ALLIES(2)
}
create
{
scriptName "fueldumphq_spawn1"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "11072 -2448 512"
spawnflags 2 // TEAM_ALLIES
}
create
{
scriptName "fueldumphq_spawn2"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "-10995 -2448 512"
spawnflags 2 // TEAM_ALLIES
}
create
{
scriptName "fueldumphq_spawn3"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "-10918 -2448 512"
spawnflags 2 // TEAM_ALLIES
}
create
{
scriptName "fueldumphq_spawn4"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "-10841 -2448 512"
spawnflags 2 // TEAM_ALLIES
}
create
{
scriptName "fueldumphq_spawn5"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "11072 -2288 512"
spawnflags 2 // TEAM_ALLIES
}
create
{
scriptName "fueldumphq_spawn6"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "-10995 -2288 512"
spawnflags 2 // TEAM_ALLIES
}
create
{
scriptName "fueldumphq_spawn7"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "-10918 -2288 512"
spawnflags 2 // TEAM_ALLIES
}
create
{
scriptName "fueldumphq_spawn8"
classname "team_CTF_bluespawn"
targetname "fueldumphq_spawn"
origin "-10841 -2288 512"
spawnflags 2 // TEAM_ALLIES
}
Contents Flags
<a name="surfaceflags"></a>
- SOLID 1
- LIGHTGRID 4†
- LAVA 8
- SLIME 16
- WATER 32
- FOG 64
- MISSILECLIP 128
- ITEM 256
- MOVER 16384
- AREAPORTAL 32768†
- PLAYERCLIP 65536
- MONSTERCLIP 131072*
- TELEPORTER 262144
- JUMPPAD 524288
- CLUSTERPORTAL 1048576†
- DONOTENTER 2097152*
- DONOTENTER_LARGE 4194304*
- ORIGIN 16777216
- BODY 33554432†
- CORPSE 67108864†
- DETAIL 134217728†
- STRUCTURAL 268435456†
- TRANSLUCENT 536870912
- TRIGGER 1073741824
- NODROP 2147483648
* These, as far as I know, are bot only commands - they will have no effect on other players.
† These are flags that should not be used in a script, they're either reserved for strict-in game usage that doesn't relate to something that you would do in a script such as this, or are reserved for entities that are compiled into the map and have absolutely no use in game.