DIF/GTKRadiantSetup

From TDN

This page is a Work In Progress.

Ok, heres a much more complete gtkradiant entity definition setup and how to make your own game type!


The files/folders you need to create are: file : gtkradiant/games/Torque.game (text format, can be *yournameofgame*.game) file : gtkradiant/Torque.Game/demo/entities.ent (text format, the folder Torque.Game must be same name as file above, demo folder will be explained further down) file : gtkradiant/Torque.Game/default_build_menu.xml


First, lets go into the gtkradiant directory, find the games folder, make a new file called "Torque.Game" (or YourNameofgame.Game) Edit it with a text editor and dump this in it.

<?xml version="1.0"?>
<game
  type="torque"
  name="Torque Engine"
  enginepath_win32="c:/projects/torque/example/"
  enginepath_linux="/usr/local/games/torque/"
  enginepath_macos="/Applications/torque/"
  engine_win32="torque.exe"
  engine_linux="torque"
  engine_macos="torque"
  basegame="demo"
  basegamename="Torque Demo"
  unknowngamename="Custom Torque Modification"
  default_scale="1.0"
  no_patch="0"
  no_bsp_monitor="1"
  archivetypes=""
  texturetypes="png tga jpg"
  modeltypes="md2"
  maptypes="maphl"
  shaders="quake3"
  entityclass="quake3"
  entityclasstype="xml"
  entities="quake3"
  brushtypes="halflife"
  patchtypes="quake3"
/>


Note: basegame="demo" GtkRadiant will store maps and autosaves in e.g, example/demo/maps, and it will expect to find textures in example/demo/textures If you change basegame to say, fps.example, then gtkradiant will expect example/fps.example/maps and example/fps.example/textures Not really any way around it, but its easy to get used to, just make sure you have something like /example/demo/textures and you'll be fine. Also, in the textures dir, you can put your textures into different directorys to organise them.

Note: enginepath_win32="c:/projects/torque/example/" This is where GtkRadiant will begin looking for the game exe and will also be used as the base directory for searching for the basegame directory (and then in basegame for maps/textures).

Note: engine_win32="torque.exe" The name of the exe you will be using for testing..

Moving on: Ok, now in gtkradiant base directory, create a dir called "Torque.Game" (or whatever you used for the file above). And then in that dir, create another dir with the same name as your basegame directory, and then, in that folder (gtkradiant/torque.game/demo for ex) create a text file called "entities.ent"

the stuff that goes in there is as follows:

The file gtkradiant/torque.game/demo/entities.ent (or gtkradiant/*yourgamename*.game/demo

<?xml version="1.0"?>
<!--
     Entity defs for TGE/TSE game engines..
-->
<classes>
<!--
=============================================================================

FUNC_* ENTITIES

=============================================================================
-->

<group name="func_group" color="0 .5 .8">
This is not an entity as such. It is strictly an editor utility to group world brushes and patches together for convenience (selecting, moving, copying, etc). You cannot group entities with this.
</group>

<!--
=============================================================================

LIGHT ENTITY

=============================================================================
-->
<point name="light" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed point light source.
-------- KEYS --------
<string key="name" name="Name">.</string>
<integer key="spawnflags" name="Spawnflags">1=Autostart 2=End of frame 3=Random Frame.</integer>
<integer key="alarm_type" name="Alarm Type">0 is normal 1 is alarm only 2 is both.</integer>
<real key="state" name="State">.</real>
<real key="duration" name="Duration">.</real>
<color key="color" name="Light Color">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
</point>

<point name="light_omni" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed point light source.
-------- KEYS --------
<string key="name" name="Name">.</string>
<color key="color" name="Light Color">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<integer key="alarm_type" name="Alarm Type">0 is normal 1 is alarm only 2 is both.</integer>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
</point>

<point name="light_spot" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed spot light source.
-------- KEYS --------
<string key="name" name="Name">.</string>
<string key="target" name="Target">Light will follow the entity this points to.</string>
<color key="color" name="Light Color">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<integer key="alarm_type" name="Alarm Type">0 is normal 1 is alarm only 2 is both.</integer>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
<real key="distance1" name="Inside Distance">.</real>
<real key="distance2" name="Outside Distance">.</real>
</point>

<point name="light_strobe" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed spot light source.
-------- KEYS --------
<string key="name" name="Name">.</string>
<string key="target" name="Target">Light will follow the entity this points to.</string>
<integer key="spawnflags" name="Spawnflags">1=Autostart 2=End of frame 3=Random Frame.</integer>
<color key="color1" name="Light Color1">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<color key="color2" name="Light Color2">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<integer key="alarm_type" name="Alarm Type">0 is normal 1 is alarm only 2 is both.</integer>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
<real key="speed" name="Speed">0 Slow - 4 Fast: default 3.</real>
</point>

<point name="light_pulse" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed pulsing light source.
-------- KEYS --------
<string key="name" name="Name">.</string>
<integer key="spawnflags" name="Spawnflags">1=Autostart 2=End of frame 3=Random Frame.</integer>
<color key="color1" name="Light Color1">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<color key="color2" name="Light Color2">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<integer key="alarm_type" name="Alarm Type">0 is normal 1 is alarm only 2 is both.</integer>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
<real key="speed" name="Speed">0 Slow - 4 Fast: default 3.</real>
</point>

<point name="light_pulse2" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed pulsing light source.
-------- KEYS --------
<string key="name" name="Name">.</string>
<integer key="spawnflags" name="Spawnflags">1=Autostart 2=End of frame 3=Random Frame.</integer>
<color key="color1" name="Light Color1">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<color key="color2" name="Light Color2">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<integer key="alarm_type" name="Alarm Type">0 is normal 1 is alarm only 2 is both.</integer>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
<real key="attack" name="Attack">.</real>
<real key="sustain1" name="sustain1">.</real>
<real key="sustain2" name="sustain2">.</real>
<real key="decay" name="decay">.</real>
</point>

<point name="light_flicker" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed pulsing light source.
-------- KEYS --------
<string key="name" name="Name">.</string>
<integer key="spawnflags" name="Spawnflags">1=Autostart 2=End of frame 3=Random Frame.</integer>
<color key="color1" name="Light Color1">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<color key="color2" name="Light Color2">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<color key="color3" name="Light Color3">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<color key="color4" name="Light Color4">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<color key="color5" name="Light Color5">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<integer key="alarm_type" name="Alarm Type">0 is normal 1 is alarm only 2 is both.</integer>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
<real key="speed" name="Speed">0 Slow - 4 Fast: default 3.</real>
</point>

<point name="light_emitter_point" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed pulsing light source.
-------- KEYS --------
<real key="target" name="Target">.</real>
<real key="state_index" name="State Index">.</real>
<real key="falloff_type" name="Falloff type, 0=Distance 1=linear">.</real>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
<real key="falloff3" name="Outside Falloff 2 (0)">.</real>
</point>

<point name="light_emitter_spot" color=".65 .65 1" box="-8 -8 -8 8 8 8">
Non-displayed pulsing light source.
-------- KEYS --------
<real key="target" name="Target">.</real>
<real key="state_index" name="State Index">.</real>
<real key="falloff_type" name="Falloff type, 0=Distance 1=linear">.</real>
<real key="falloff1" name="Inside Falloff">.</real>
<real key="falloff2" name="Outside Falloff">.</real>
<real key="falloff3" name="Outside Falloff 2 (0)">.</real>
<real key="direction" name="Direction Vector">.</real>
<real key="theta" name="Radian: Inner Angle">.</real>
<real key="phi" name="Radian: Outer Angle">.</real>
</point>

<!--
=============================================================================

BRUSH ENTITY

=============================================================================
-->

<group name="detail" color="0 .5 .8">
Detail Brush.
</group>

<group name="collision" color="0 .5 .8">
Collision Brush.
</group>

<group name="vehicle_collision" color="0 .5 .8">
Collision Brush for use with vehicles.
</group>

<group name="portal" color="0 .5 .8">
Detail Brush.
<boolean key="ambient_light" name="does ambient light pass through 1 means yes 0 means no.">.</boolean>
</group>

<point name="target" color="0 .5 .8" box="-8 -8 -8 8 8 8">
Target for others to follow.
<string key="name" name="Name">.</string>
</point>

<!--
=============================================================================

SPECIAL ENTITY

=============================================================================
-->

<point name="MirrorSurface" color="0 .5 .8" box="-8 -8 -8 8 8 8">
Mirror Surface.
<real key="alpha_level" name="0 = full mirror, 6 = use textures alpha channel.">.</real>
</point>


<group name="Door_Elevator" color="0 .5 .8">
Doors and Elevator. Moving Brush.
<string key="name" name="Name">.</string>
<real key="path_name" name="Name of path to follow">.</real>
<string key="datablock" name="Datablock">.</string>
<string key="trigger0_name" name="Trigger0 Name">.</string>
<string key="trigger1_name" name="Trigger1 Name">.</string>
<string key="trigger2_name" name="Trigger2 Name">.</string>
<string key="trigger3_name" name="Trigger3 Name">.</string>
<string key="trigger4_name" name="Trigger4 Name">.</string>
<string key="trigger5_name" name="Trigger5 Name">.</string>
<string key="trigger6_name" name="Trigger6 Name">.</string>
<string key="trigger7_name" name="Trigger7 Name">.</string>
</group>

<group name="Force_Field" color="0 .5 .8">
Detail Brush.
<string key="name" name="Name">.</string>
<color key="color" name="Field Color">weighted RGB value of light color (default white - 1.0 1.0 1.0).</color>
<string key="trigger0_name;string" name="Trigger0 Name">.</string>
<string key="trigger1_name;string" name="Trigger1 Name">.</string>
<string key="trigger2_name;string" name="Trigger2 Name">.</string>
<string key="trigger3_name;string" name="Trigger3 Name">.</string>
<string key="trigger4_name;string" name="Trigger4 Name">.</string>
<string key="trigger5_name;string" name="Trigger5 Name">.</string>
<string key="trigger6_name;string" name="Trigger6 Name">.</string>
<string key="trigger7_name;string" name="Trigger7 Name">.</string>
</group>

<point name="ai_special_node" color="0 .5 .8" box="-8 -8 -8 8 8 8">
Node for AI.
<real key="name" name="Name">.</real>
</point>

<!--
=============================================================================

PATH ENTITY

=============================================================================
-->

<point name="path_node" color=".2 .8 .8" box="-10 -10 -10 10 10 10">
Pathing node, use with doors/elevators.
<string key="name" name="Name">.</string>
<real key="next_node" name="Next Path Node">.</real>
<real key="next_time" name="Time to next">.</real>
</point>

<point name="path_start" color=".2 .8 .8" box="-10 -10 -10 10 10 10">
Pathing node, use with doors/elevators.
<string key="name" name="Name">.</string>
<real key="next_node" name="Next Path Node">.</real>
<real key="next_time" name="Time to next">.</real>
</point>

<!--
=============================================================================

TRIGGER ENTITY

=============================================================================
-->

<group name="trigger" color=".2 .8 .8">
Trigger.
<string key="name" name="Name">.</string>
<string key="datablock" name="Datablock">.</string>
</group>

<!--
=============================================================================

WORLDSPAWN ENTITY

=============================================================================
-->

<group name="worldspawn" color="0 0 0">
Only used for the world.
-------- KEYS --------
<real key="detail_number" name="Shapes Detail Index">Shapes Detail Index.</real>
<real key="min_pixels" name="Minimum Pixels">Minimum pixels for detail.</real>
<color key="ambient_color" name="Ambient Color">r g b defaults to black.</color>
<color key="emergency_ambient_color" name="emergency_ambient_color">r g b defaults to black.</color>
<real key="light_geometry_scale" name="Lightmap Geo">lightmap geometry scale default 32 make power of 2.</real>

</group>
</classes>


Last but not least is "gtkradiant/torque.game/default_build_menu.xml" Use the one at the top of the page, or you can have another version here

<?xml version="1.0"?>
<project version="2.0">

   <var name="map2difPlus">"[EnginePath]tools/map2dif_plus.[ExecutableType]" -t "[EnginePath]"demo/textures/ -o "[EnginePath]"demo/difs/</var>
   <var name="map2difPlusDebug">"[EnginePath]tools/map2dif_plus_DEBUG.[ExecutableType]" -o "[EnginePath]"demo/difs/ -t "[EnginePath]"demo/textures/ </var>
   <var name="map2dif">"[EnginePath]tools/map2dif.[ExecutableType]" -o "[EnginePath]"demo/difs/ -t "[EnginePath]"demo/textures/ </var>
   <var name="map2difDebug">"[EnginePath]tools/map2dif_DEBUG.[ExecutableType]" -o "[EnginePath]"demo/difs/ -t "[EnginePath]"demo/textures/ </var>

   <build name="Map2Dif Plus - build only">
      <command>[map2difPlus] "[MapFile]"</command>
   </build>

   <build name="Map2Dif Plus - build -h">
      <command>[map2difPlus] -h "[MapFile]"</command>
   </build>

   <build name="Map2Dif Plus Debug - build only">
      <command>[map2difPlusDebug] "[MapFile]"</command>
   </build>

   <build name="Map2Dif Plus Debug - build -h">
      <command>[map2difPlusDebug] -h "[MapFile]"</command>
   </build>


   <build name="Map2Dif - build only">
      <command>[map2dif] "[MapFile]"</command>
   </build>

   <build name="Map2Dif - build -h">
      <command>[map2dif] -h "[MapFile]"</command>
   </build>

   <build name="Map2Dif Debug - build only">
      <command>[map2difDebug] "[MapFile]"</command>
   </build>

   <build name="Map2Dif Debug - build -h">
      <command>[map2difDebug] -h "[MapFile]"</command>
   </build>

</project>

And there you have it, you should now have your custom game plus a full entity list and their associated vars in gtkradiant! Also, dont forget to edit all the paths to be specific for your own game! }}