Join us on our TWC Discord channel

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Adding new entities to Radiant
#1
How to add new, mod specific entities to Radiant?
This tutorial may not be useful for most people, only ETJump, ETRun and Domination mods use new entities.
I'll use trigger_ballonly_multiple and team_powerball entities in this example. First has 2 spawnflags - AXIS_GOAL (1) & ALLIED_GOAL (2) and 1 key - scriptName. Second has no spawnflags and scriptname as key too.

1. .def files - GTK Radiant 1.4

Go to ET->etmain->scripts
Open any file with .def extension using any text editor.
Add this at the end:
Code:
/*QUAKED trigger_ballonly_multiple (.5 .5 .5) ? AXIS_GOAL ALLIED_GOAL -------- KEYS -------- "scriptName" The object name in the script file -------- SPAWNFLAGS -------- AXIS_GOAL only trigger if allied player is trying to make a goal ALLIED_GOAL only trigger if axis player is trying to make a goal -------- NOTES -------- Player must be on the right team and have the powerball it to trigger. It will call the "death" function in the object's script. */

Code:
/*QUAKED team_powerball (1 0 0) (-8 -8 -8) (8 8 8) -------- KEYS -------- "scriptname" name used for scripting purposes -------- SPAWNFLAGS -------- (none) -------- NOTES -------- Used in the Power Ball mod */
title - entity name, in first () is entity color, in second and third () entity size (isn't needed for entities similar to trigger and func - which need to be put on texture). After size and ? there should be spawnflags names, sorted by ascending values (1, 2, 4, 8, 16 etc.)
SPAWNFLAGS - you need to add the names used before in separate lines, next to them are descriptions
KEYS - key needs to be put in "" in separate line, next to it is description
NOTES is entity description
Each entity needs to start with /*QUAKED and end with */

2. .ent files - GTK Radiant 1.5/NetRadiant

Go to NetRadiant/GTK Radiant 1.5 folder -> et.game -> etmain
Open file with .ent extension using any text editor.
Add this (to avoid mess, add trigger_ between two other triggers, team_ between two other teams etc.):

Code:
<group name="trigger_ballonly_multiple" color=".5 .5 .5"> -------- KEYS -------- <string key="scriptname" name="scriptname">object's scriptname</string> -------- SPAWNFLAGS -------- <flag key="AXIS_GOAL" name="AXIS_GOAL" bit="0">Only trigger if Allied player is trying to make a goal.</flag> <flag key="ALLIED_GOAL" name="ALLIED_GOAL" bit="1">Only trigger if Axis player is trying to make a goal.</flag> -------- NOTES -------- Player must be on the right team and have the powerball it to trigger. It will call the "death" function in the object's script. </group>

Code:
<point name="team_powerball" color="1 0 0" box="-8 -8 -8 8 8 8"> -------- KEYS -------- <string key="scriptname" name="scriptname">Name of script block for entity</string> -------- SPAWNFLAGS -------- (none) -------- NOTES -------- Used in the Power Ball mod </point>

As you can see, .ent file uses another structure (XML). There are also more specifications like <point> for some entities and <group> for another. The best way to add new entities is to look at similar ones (for example for trigger_ballonly_multiple that would be trigger_flagonly_multiple) and edit them.

Tutorial written by Destroy666. If you want to copy it to your site, please include the author and link to this thread.
Spoiler[spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler][spoiler]<object classid="clsidBiggrin27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="500" height="300">
<param name="movie" value="http://z0r.de/L/z0r-de_3068.swf" />
<param name="quality" value="high" />
<embed src="http://z0r.de/L/z0r-de_3068.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="300"></embed>
</object>
[/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler][/spoiler]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [help] radiant 1.4 xLizeR 2 3,630 24-10-2012, 05:49 PM
Last Post: xLizeR
  Tutorial Adding tags to model Destroy666 0 2,204 07-03-2012, 12:39 AM
Last Post: Destroy666

Forum Jump:


Users browsing this thread: 1 Guest(s)