Script Object: Difference between revisions

From DF21 Wiki
(Created page with "'''Object Script''' enables manipulation of objects via ForceScript. == Naming of objects == TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are ''case insensitive'' like sector names. Objects are named in the .O file as shown here: <pre> →‎006 SEWERBUG.WAX: CLASS: SPRITE DATA: 3 X: 232.00 Y: 0.00 Z: 264.00 PCH: 0.00 YAW: 0.00 ROL: 0.00 DIFF: 1 SEQ LOGIC: SEWER1...")
 
(Getting objects)
Line 28: Line 28:
  SEQEND
  SEQEND
</pre>
</pre>
== Getting objects by name ==
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.
* <code>getObject</code>
* <code>getObjectsByName</code>

Revision as of 01:52, 30 August 2025

Object Script enables manipulation of objects via ForceScript.

Naming of objects

TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are case insensitive like sector names.

Objects are named in the .O file as shown here:

/* 006 SEWERBUG.WAX  */
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1
 SEQ
  LOGIC:     SEWER1
  NAME: sewer-creature2
 SEQEND

/* 007 REMOTE.WAX    */
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1
 SEQ
  LOGIC:     REMOTE
  NAME: cool-remote
 SEQEND

/* 008 MOUSEBOT.3DO  */
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1
 SEQ
  LOGIC:     MOUSEBOT
  NAME: mouse4
 SEQEND

Getting objects by name

To get objects by their name, use the methods in the Level Script API.

  • getObject
  • getObjectsByName