Game Configurations: added "Thing Radius" (23) and "Thing Height" (24) action argument types. When non-zero, arguments of these types will affect the size of associated thing in Classic and Visual modes.

Game Configurations: updated things in ZDoom "Bridges" category to use argument types 23 and 24.
Documentation: added "Action Argument Settings" page, updated "Basic Settings", "Map Format Settings", "Linedefs Settings" and "Things Settings" pages in Configurations -> Game Configurations group.
Documentation: updated "DECORATE keys" page.
This commit is contained in:
MaxED 2015-05-30 10:26:16 +00:00
parent 84059749bb
commit 35cd4068ff
15 changed files with 262 additions and 77 deletions

View file

@ -388,10 +388,12 @@ zdoom
arg0
{
title = "Radius";
type = 23;
}
arg1
{
title = "Height";
type = 24;
}
}
@ -403,10 +405,12 @@ zdoom
arg0
{
title = "Radius";
type = 23;
}
arg1
{
title = "Height";
type = 24;
}
}
@ -417,10 +421,12 @@ zdoom
arg0
{
title = "Radius";
type = 23;
}
arg1
{
title = "Height";
type = 24;
}
}
@ -432,10 +438,12 @@ zdoom
arg0
{
title = "Radius";
type = 23;
}
arg1
{
title = "Height";
type = 24;
}
}
@ -447,10 +455,12 @@ zdoom
arg0
{
title = "Radius";
type = 23;
}
arg1
{
title = "Height";
type = 24;
}
arg2
{
@ -1483,10 +1493,12 @@ doom
arg0
{
title = "Radius";
type = 23;
}
arg1
{
title = "Height";
type = 24;
}
}
}

View file

@ -208,6 +208,10 @@
<param name="Name" value="Things Settings">
<param name="Local" value="gc_thingsettings.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Action Argument Settings">
<param name="Local" value="gc_argumentsettings.html">
</OBJECT>
</UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Scripting Configurations">

View file

@ -0,0 +1,91 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Game Configuration - Linedefs Settings</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="default.css" media="screen" title="Default" />
</head>
<body>
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="keyword" value="Configurations">
<param name="keyword" value="Game Configurations">
<param name="keyword" value="Action">
<param name="keyword" value="Argument">
</object>
<div id="title">
<h1>Game Configuration - Action Argument Settings</h1>
</div>
<div id="contents">
<p> <b class="fat">title</b> (string)<br />
Sets the title of this argument.<br />
<br />
<b class="fat"><a name="argtooltip" id="argtooltip"></a>tooltip</b> (string) - <span class="red">GZDB only</span>.<br />
Allows to specify a tooltip text displayed for a <a href="gc_thingsettings.html#argtooltip">Thing</a> or Linedef argument definition. Newline character ("\n") can be used to format the text.<br />
Argument tooltips can be also set in <a href="gc_decoratekeys.html#argtooltip">DECORATE</a>.<br />
<strong>Example:</strong> </p>
<pre>arg1
{
title = "Mirror Polyobj Number";
<span class="blue">tooltip = "Polyobject that will mirror\nthis one's movements.";</span>
}</pre>
<br />
<b class="fat">type</b> (integer)<br />
Sets the type of this argument. This changes the behaviour of Argument inputs in <a href="w_linedefedit.html">Linedef</a> and <a href="w_thingedit.html">Thing Edit</a> windows. Supported values are:<br />
<br />
<ul style="list-style-type:none">
<li>0 = Integer (default)</li>
<li>4 = Linedeftype</li>
<li>5 = Sector effect</li>
<li>8 = Angle in degrees</li>
<li>10 = XXRRGGBB color</li>
<li>11 = Enum option</li>
<li>12 = Enum bits</li>
<li>13 = Sector tag</li>
<li>14 = Thing tag</li>
<li>15 = Linedef tag</li>
<li>22 = Byte angle (<span class="red">GZDB only</span>)</li>
<li>23 = Thing Radius (<span class="red">GZDB only</span>)</li>
<li>24 = Thing Height (<span class="red">GZDB only</span>)</li>
</ul>
<p><b class="fat">enum</b> (structure or string)<br />
Provides a list of predefined values to display for this argument. Used only when argument <strong>type</strong> is 11 or 12.<br />
The value can be either a name of a predefined enum:<br />
<pre>
arg0
{
title = &quot;Volume&quot;;
type = 11;
<span class="blue">enum = &quot;sound_volume&quot;;</span>
}
</pre>
or an explicit definition:<br />
<pre>
arg0
{
title = "Apply to";
type = 11;
<span class="blue">enum
{
0 = "Floor and Ceiling";
1 = "Ceiling";
2 = "Floor";
}</span>
}
</pre>
<br />
<b class="fat">default</b> (integer) - <span class="red">GZDB only</span>.<br />
Sets the default value for a Thing or Linedef argument definition.<br />
<strong>Example:</strong>
</p>
<pre>9038
{
title = "ColorSetter";
arg0
{
title = "Red";
<span class="blue">default = 255;</span>
}
}</pre>
</p>
</div>
</body>

View file

@ -28,7 +28,14 @@
This game configuration is available by default. You can enable and disable game configurations using <a href="w_gameconfigurations.html">Game Configurations window</a>.<br />
The default value is <b>false</b>.<br />
<br />
<b class="fat">basegame</b> (integer) [0 .. 4] - <span class="red">GZDB only</span>.<br />
<b class="fat">actionspecialhelp</b> (string) - <span class="red">GZDB only</span>.<br />
The URL used to display action special help. &quot;<strong>%K</strong>&quot; wildcard is replaced by <strong>id</strong> property defined in <a href="gc_linedefsettings.html#actionid">action definition</a>.<br />
<br />
<b class="fat">thingclasshelp</b> (string) - <span class="red">GZDB only</span>.<br />
The URL to open when thing class name is clicked in the Thing Edit form. &quot;<strong>%K</strong>&quot; wildcard is replaced by <strong>classname</strong> property defined in thing definition or by DECORATE actor name.<br />
<br />
<b class="fat">basegame</b> (integer) [0 .. 4] - <span class="red">GZDB only</span>.<br />
Indicates which game the current configuration is based on. Used to load game-specific GLDEFS lumps (DOOMDEFS, HTICDEFS, HEXNDEFS or STRFDEFS).
<br /><b>Possible values:</b> 1 (DOOM), 2 (HERETIC), 3 (HEXEN) or 4 (STRIFE).<br />
The default value is <b>0</b> (don't load game-specific lumps).<br />

View file

@ -35,7 +35,7 @@
<br />
<strong><a name="argtooltip" id="argtooltip"></a>//$ArgNTooltip &lt;text&gt;</strong> - <span class="red">GZDB only</span>.<br />
Allows to specify a tooltip text displayed for this argument. Newline character (&quot;\n&quot;) can be used to format the text. This property can only be used in conjunction with &quot;<strong>$ArgN</strong>&quot;.<br />
Argument tooltips can be also set for <a href="gc_thingsettings.html#argtooltip">things</a> and <a href="gc_linedefsettings.html#argtooltip">linedefs</a> in a Game Configuration.<br />
Argument tooltips can be also set for <a href="gc_argumentsettings.html#argtooltip">things and linedefs</a> in a Game Configuration.<br />
<br />
<strong>//$Color &lt;color index&gt;</strong> - <span class="red">GZDB only</span>.<br />
Allows to override category color for this actor. Possible values:

View file

@ -33,7 +33,7 @@
<li><b>2</b> - None of these lumps must exist.
<li><b>3</b> - All of these lumps must exist.
</ul>
Example:<br />
<strong>Example:</strong><br />
<pre>
gamedetect
{
@ -71,7 +71,7 @@ gamedetect
<li><b class="fat">scriptbuild</b> (boolean) - <span class="red">GZDB only</span>.<br />
When this is set, it indicates that this lump can be edited with the script editor. Currently chosen script configuration will be used to build this lump. The contents of this lump will be loaded in the script editor automatically.<br />
</ul>
Example:<br />
<strong>Example:</strong><br />
<pre>
maplumpnames
{
@ -161,6 +161,87 @@ maplumpnames
}
</pre>
<br />
<b class="fat">universalfields</b> (structure) - <span class="red">UDMF only</span>.<br />
Provides additional UDMF field definitions to show in the <strong>Custom</strong> tab of Edit windows.<br />
<span class="red">Warning:</span> only add fields that Doom Builder does not edit with its own user-interface!<br />
<span class="red">Warning:</span> the "default" field must match the UDMF specifications!<br /><br />
<strong>Field data types:</strong><br />
<ul style="list-style-type:none">
<li>0 = Integer</li>
<li>1 = Float</li>
<li>2 = String</li>
<li>3 = Bool</li>
<li>4 = Linedef type (integer)</li>
<li>5 = Sector effect (integer)</li>
<li>6 = Texture (string)</li>
<li>7 = Flat (string)</li>
<li>8 = Angle in degrees (integer)</li>
<li>9 = Angle in radians (float)</li>
<li>10 = XXRRGGBB color (integer)</li>
<li>11 = Enum option (integer)</li>
<li>12 = Enum bits (integer)</li>
<li>13 = Sector tag (integer)</li>
<li>14 = Thing tag (integer)</li>
<li>15 = Linedef tag (integer)</li>
<li>16 = Enum option (string)</li>
<li>17 = Angle in degrees (float)</li>
<li>22 = Byte angle (integer) - <span class="red">GZDB only</span></li>
</ul>
<strong>Example:</strong><br />
<pre>
universalfields
{
linedef
{
comment
{
type = 2;
default = "";
}
}
sidedef
{
comment
{
type = 2;
default = "";
}
}
thing
{
comment
{
type = 2;
default = "";
}
skill6
{
type = 3;
default = false;
}
class6
{
type = 3;
default = false;
}
}
sector
{
comment
{
type = 2;
default = "";
}
}
}
</pre>
</p>
</div>
</body>

View file

@ -106,10 +106,23 @@ linedefflagstranslation
}
</pre>
<br />
<span class="big">Linedef definitions:</span><br />
<span class="big">Linedef action definitions:</span><br />
<br />
<b class="fat">title</b> (string)<br />
The name of this linedef action.<br />
<br />
<b class="fat"><a name="actionid" id="actionid"></a>id</b> (string) - <span class="red">GZDB only</span>.<br />
The name used to display help page when you press the &quot;Action Help&quot; button in <a href="w_thingedit.html">Thing</a> or <a href="w_linedefedit.html">Linedef Edit</a> windows (used in conjunction with <strong>actionspecialhelp</strong> property).<br />
<br />
<b class="fat">prefix</b> (string)<br />
Linedef action prefix (&quot;WR&quot;, &quot;SR&quot;, &quot;GR&quot; etc.). Usable only for Doom format linedef definitions.<br />
<br />
<b class="fat">requiresactivation</b> (boolean) - <span class="red">GZDB only</span>.<br />
this linedef action requires activation flag(s). When this property is set to true, a warning will be shown when a user selects this linedef action and no activation flags are set.<br />
This linedef action requires activation flag(s). When this property is set to true, a warning will be shown when a user selects this linedef action and no activation flags are set.<br />
The default value is <strong>true</strong>.<br />
<strong>Example:</strong>
<pre>1
@ -120,30 +133,7 @@ linedefflagstranslation
</pre>
<br />
<span class="big">Linedef action argument definitions:</span><br />
<br />
<b class="fat">default</b> (integer) - <span class="red">GZDB only</span>.<br />
Sets the default value for a Thing or Linedef argument definition.<br />
<strong>Example:</strong>
<pre>9038
{
title = "ColorSetter";
arg0
{
title = "Red";
<span class="blue">default = 255;</span>
}
}</pre>
<br />
<b class="fat"><a name="argtooltip" id="argtooltip"></a>tooltip</b> (string) - <span class="red">GZDB only</span>.<br />
Allows to specify a tooltip text displayed for a <a href="gc_thingsettings.html#argtooltip">Thing</a> or Linedef argument definition. Newline character ("\n") can be used to format the text.<br />
Argument tooltips can be also set in <a href="gc_decoratekeys.html#argtooltip">DECORATE</a>.<br />
<strong>Example:</strong>
</p>
<pre>arg1
{
title = "Mirror Polyobj Number";
<span class="blue">tooltip = "Polyobject that will mirror\nthis one's movements.";</span>
}</pre>
See <a href="gc_argumentsettings.html">Action Argument Settings</a>.
</p>
</div>
</body>

View file

@ -17,9 +17,6 @@
</div>
<div id="contents">
<p> <span class="big">General settings:</span><br />
<br />
<b class="fat">thingclasshelp</b> (string) - <span class="red">GZDB only</span>.<br />
The URL to open when thing class name is clicked in the Thing Edit form.<br />
<br />
<b class="fat">defaultthingflags</b> (structure)<br />
This defines what the default flags should be first the first new thing when inserted. In map formats that use numeric thing flags, the settings in this structure should be the numeric flags to set. In map formats that use named flags, the settings must be the names of the flags to set. The value of the settings is optional and is ignored by Doom Builder.<br />
@ -170,32 +167,7 @@ thingrenderstyles
}</pre>
<br />
<span class="big">Thing argument definitions:</span><br />
These settings can be used inside of thing argument definitions.<br />
<br />
<b class="fat">default</b> (integer) - <span class="red">GZDB only</span>.<br />
Sets the default value for a Thing or Linedef argument definition.<br />
<strong>Example:</strong>
</p>
<pre>9038
{
title = "ColorSetter";
arg0
{
title = "Red";
<span class="blue">default = 255;</span>
}
}</pre>
<br />
<b class="fat"><a name="argtooltip" id="argtooltip"></a>tooltip</b> (string) - <span class="red">GZDB only</span>.<br />
Allows to specify a tooltip text displayed for a Thing or <a href="gc_linedefsettings.html#argtooltip">Linedef</a> argument definition. Newline character ("\n") can be used to format the text.<br />
Argument tooltips can be also set in <a href="gc_decoratekeys.html#argtooltip">DECORATE</a>.<br />
<strong>Example:</strong>
</p>
<pre>arg1
{
title = "Mirror Polyobj Number";
<span class="blue">tooltip = "Polyobject that will mirror\nthis one's movements.";</span>
}</pre>
See <a href="gc_argumentsettings.html">Action Argument Settings</a>.
</p>
</div>
</body>

View file

@ -876,6 +876,8 @@
<Compile Include="Types\RandomFloatHandler.cs" />
<Compile Include="Types\RandomIntegerHandler.cs" />
<Compile Include="Types\ThingClassHandler.cs" />
<Compile Include="Types\ThingHeightHandler.cs" />
<Compile Include="Types\ThingRadiusHandler.cs" />
<Compile Include="Types\ThingTypeHandler.cs" />
<Compile Include="VisualModes\VisualVertex.cs" />
<Compile Include="Windows\CenterOnCoordinatesForm.cs">

View file

@ -24,6 +24,7 @@ using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.GZBuilder.Data;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.VisualModes;
#endregion
@ -69,6 +70,7 @@ namespace CodeImp.DoomBuilder.Map
// Configuration
private float size;
private float height; //mxd
private PixelColor color;
private bool fixedsize;
private bool directional; //mxd. If true, we need to render an arrow
@ -93,6 +95,7 @@ namespace CodeImp.DoomBuilder.Map
public int Action { get { return action; } set { BeforePropsChange(); action = value; } }
public int[] Args { get { return args; } }
public float Size { get { return size; } }
public float Height { get { return height; } } //mxd
public PixelColor Color { get { return color; } }
public bool FixedSize { get { return fixedsize; } }
public int Tag { get { return tag; } set { BeforePropsChange(); tag = value; if((tag < General.Map.FormatInterface.MinTag) || (tag > General.Map.FormatInterface.MaxTag)) throw new ArgumentOutOfRangeException("Tag", "Invalid tag number"); } }
@ -228,6 +231,7 @@ namespace CodeImp.DoomBuilder.Map
t.action = action;
t.args = (int[])args.Clone();
t.size = size;
t.height = height; //mxd
t.color = color;
t.directional = directional;
t.fixedsize = fixedsize;
@ -492,8 +496,18 @@ namespace CodeImp.DoomBuilder.Map
// Apply size
size = ti.Radius;
height = ti.Height; //mxd
fixedsize = ti.FixedSize;
spritescale = ti.SpriteScale; //mxd
//mxd. Apply radius and height overrides?
for(int i = 0; i < ti.Args.Length; i++)
{
if(ti.Args[i].Type == (int)UniversalType.ThingRadius && args[i] > 0)
size = args[i];
else if(ti.Args[i].Type == (int)UniversalType.ThingHeight && args[i] > 0)
height = args[i];
}
// Color valid?
if((ti.Color >= 0) && (ti.Color < ColorCollection.NUM_THING_COLORS))

View file

@ -1207,25 +1207,25 @@ namespace CodeImp.DoomBuilder.Rendering
{
spriteWidth = info.Radius * spriteScale - spriteShrink * spriteScale;
spriteHeight = spriteWidth * ((float)sprite.Height / sprite.Width);
if(spriteWidth < MINIMUM_SPRITE_RADIUS) continue; //don't render tiny little sprites
}
else if(sprite.Width < sprite.Height)
{
spriteHeight = info.Radius * spriteScale - spriteShrink * spriteScale;
spriteWidth = spriteHeight * ((float)sprite.Width / sprite.Height);
if(spriteHeight < MINIMUM_SPRITE_RADIUS) continue; //don't render tiny little sprites
}
else
{
spriteWidth = info.Radius * spriteScale - spriteShrink * spriteScale;
spriteHeight = spriteWidth;
if(spriteWidth < MINIMUM_SPRITE_RADIUS) continue; //don't render tiny little sprites
}
foreach(Thing t in group.Value)
{
if(t.IsModel && (General.Settings.GZDrawModelsMode == ModelRenderMode.ALL || (General.Settings.GZDrawModelsMode == ModelRenderMode.SELECTION && t.Selected))) continue;
CreateThingSpriteVerts(thingsByPosition[t], spriteWidth, spriteHeight, ref verts, buffercount * 6, t.Selected ? selectionColor : 0xFFFFFF);
float scaler = t.Size / info.Radius;
if(Math.Max(spriteWidth, spriteHeight) * scaler < MINIMUM_SPRITE_RADIUS) continue; //don't render tiny little sprites
CreateThingSpriteVerts(thingsByPosition[t], spriteWidth * scaler, spriteHeight * scaler, ref verts, buffercount * 6, t.Selected ? selectionColor : 0xFFFFFF);
buffercount++;
totalcount++;

View file

@ -0,0 +1,5 @@
namespace CodeImp.DoomBuilder.Types
{
[TypeHandler(UniversalType.ThingHeight, "Thing Height", false)]
internal class ThingHeightHandler : IntegerHandler { }
}

View file

@ -0,0 +1,5 @@
namespace CodeImp.DoomBuilder.Types
{
[TypeHandler(UniversalType.ThingRadius, "Thing Radius", false)]
internal class ThingRadiusHandler : IntegerHandler { }
}

View file

@ -45,5 +45,7 @@ namespace CodeImp.DoomBuilder.Types
RandomInteger = 20, //mxd
RandomFloat = 21, //mxd
AngleByte = 22, //mxd
ThingRadius = 23, //mxd
ThingHeight = 24, //mxd
}
}

View file

@ -103,17 +103,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
int sectorcolor = new PixelColor(255, 255, 255, 255).ToInt();
//mxd. Check thing size
float infoRadius, infoHeight;
if((info.Radius < 0.1f) || (info.Height < 0.1f))
float thingradius = Thing.Size; // Thing.Size has ThingRadius arg override applied
float thingheight = Thing.Height; // Thing.Height has ThingHeight arg override applied
if(thingradius < 0.1f || thingheight < 0.1f)
{
infoRadius = FIXED_RADIUS;
infoHeight = FIXED_RADIUS;
thingradius = FIXED_RADIUS;
thingheight = FIXED_RADIUS;
sizeless = true;
}
else
{
infoRadius = info.Radius;
infoHeight = info.Height;
sizeless = false;
}
@ -191,8 +191,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
base.Texture = General.Map.Data.Hourglass3D;
// Determine sprite size
float radius = Math.Min(infoRadius, infoHeight / 2f);
float height = Math.Min(infoRadius * 2f, infoHeight);
float radius = Math.Min(thingradius, thingheight / 2f);
float height = Math.Min(thingradius * 2f, thingheight);
// Make vertices
WorldVertex[] verts = new WorldVertex[6];
@ -272,23 +272,23 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Apply settings
SetPosition(pos);
SetCageSize(infoRadius, infoHeight);
SetCageSize(thingradius, thingheight);
SetCageColor(Thing.Color);
// Keep info for object picking
cageradius2 = infoRadius * Angle2D.SQRT2;
cageradius2 = thingradius * Angle2D.SQRT2;
cageradius2 = cageradius2 * cageradius2;
pos2d = pos;
if(sizeless) //mxd
{
boxp1 = new Vector3D(pos.x - infoRadius, pos.y - infoRadius, pos.z - infoRadius/2);
boxp2 = new Vector3D(pos.x + infoRadius, pos.y + infoRadius, pos.z + infoRadius/2);
boxp1 = new Vector3D(pos.x - thingradius, pos.y - thingradius, pos.z - thingradius/2);
boxp2 = new Vector3D(pos.x + thingradius, pos.y + thingradius, pos.z + thingradius/2);
}
else
{
boxp1 = new Vector3D(pos.x - infoRadius, pos.y - infoRadius, pos.z);
boxp2 = new Vector3D(pos.x + infoRadius, pos.y + infoRadius, pos.z + infoHeight);
boxp1 = new Vector3D(pos.x - thingradius, pos.y - thingradius, pos.z);
boxp2 = new Vector3D(pos.x + thingradius, pos.y + thingradius, pos.z + thingheight);
}
// Done