XML:BINA/OBJC/TRIG: Difference between revisions

From OniGalore
< XML:BINA‎ | OBJC
Jump to navigation Jump to search
m (...)
m (→‎Laser rotations: localized image)
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''general notes'''
{{XML_OBJC_Header | prev=TRGV | type=TRIG | next=TURR | name=Trigger}}
* '''BINACJBOTrigger.oni''' is level specific. (It can be found in edition/GameDataFolder/level''XX''_... )
* See [[XML basic tutorial|HERE]] if you don't know how to convert an oni file into XML and vice versa.
* See [[OBD_talk:BINA/OBJC|HERE]] if you are searching for more general information such as how to handle object coordinates.


==General information==
* The XML on this page was tested with OniSplit v0.9.94.0.
* BINACJBOTrigger is level-specific (level''x''_Final.dat).


'''BSL support'''
==BSL support==
: <font color="#777777">command - description - example</font>
{| class="wikitable" width="100%"
* marketing_line_off - turns the laser line off - marketing_line_off = 1
!Command
* trig_activate trigger_id:int - activates a trigger - trig_activate 2
!Description
* trig_deactivate trigger_id:int - deactivates a trigger - trig_deactivate 2
!Example
* trig_hide trigger_id:int - hides a trigger - trig_hide 91
|-
* trig_show trigger_id:int - shows a trigger - trig_show 91
|marketing_line_off
* trig_speed trigger_id:int volume:float - sets a triggers speed - trig_speed 514 .15
|turns the laser line off
* trig_reset trigger_id:int - resets a trigger to non-triggered state - trig_reset 91
|marketing_line_off = 1
 
|-
|trig_activate trigger_id:int
|activates a trigger
|trig_activate 2
|-
|trig_deactivate trigger_id:int
|deactivates a trigger
|trig_deactivate 2
|-
|trig_hide trigger_id:int
|hides a trigger, disables also laser
|trig_hide 91
|-
|trig_show trigger_id:int
|shows a trigger
|trig_show 91
|-
|trig_speed trigger_id:int volume:float
|sets a triggers speed
|trig_speed 514 .15
|-
|trig_reset trigger_id:int
|resets a trigger to non-triggered state
|trig_reset 91
|}


'''XML structure'''
==File structure==
  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
  <Oni Version="0.9.28.0">
  <Oni>
     <ObjectCollection>
     <Objects>
         '''''[...]'''''
         '''''[...]'''''
     </ObjectCollection>
     </Objects>
  </Oni>
  </Oni>


'''''[...]''''' means at least one trigger. Paste all trigger data into there (this includes '''<font color="#0A0"><Object ...></font>''' and '''<font color="#0A0"></Object></font>''' tag).
'''''[...]''''' means at least one trigger. Paste all your trigger data in there (this includes the '''<font color="#0A0"><TRIG Id="..."></font>'''/'''<font color="#0A0"></TRIG></font>''' tag).


'''example'''
'''Example'''
{| border=0 cellspacing=20 cellpadding=0 align=right
[[Image:XML_TRIG_trigger_modded.jpg|400px|right|thumb]]
|
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/trigger.jpg http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/trigger_preview.jpg]
|}


         '''<font color="#0A0"><Object Id="8136" Type="TRIG"></font>'''
         '''<font color="#0A0"><TRIG Id="8136"></font>'''
             <Header>
             <Header>
                 <Flags>0</Flags>
                 <Flags></Flags>
                 <Position>-445 68 -1362</Position>
                 <Position>-445 68 -1362</Position>
                 <Rotation>270 8.65141646E-06 180.000015</Rotation>
                 <Rotation>270 8.65141646E-06 180.000015</Rotation>
Line 49: Line 70:
                 <Offset_0077>0</Offset_0077>
                 <Offset_0077>0</Offset_0077>
                 <Events>
                 <Events>
                    <Script Function="calling_this_BSL_function" />
                     <ActivateTurret TargetId="1" />
                     <ActivateTurret TargetId="1" />
                    <DeactivateTurret TargetId="2" />
                    <ActivateConsole TargetId="3" />
                    <DeactivateConsole TargetId="4" />
                    <ActivateAlarm TargetId="5" />
                    <DeactivateAlaram TargetId="6" />
                    <ActivateTrigger TargetId="7" />
                    <DeactivateTrigger TargetId="8" />
                    <LockDoor TargetId="9" />
                    <UnlockDoor TargetId="10" />
                 </Events>
                 </Events>
             </OSD>
             </OSD>
         '''<font color="#0A0"></Object></font>'''
         '''<font color="#0A0"></TRIG></font>'''
 
==Tags==
{| class="wikitable" width="100%"
!width=280px| Tag
!width=60px| Type
! Description
|-
| <TRIG Id="...">
| integer
| You can also use <TRIG> without the ID parameter.
|-
| <Header>
| -
|
|-
| <Flags>
| flag
| Used in the past.
|-
| <Position>
| float x3
| Trigger is spawned at this XYZ position.
|-
| <Rotation>
| float x3
| Trigger has this XYZ rotation (in degrees).
|-
| <OSD>
| -
|
|-
|valign="top"| <Class>
|valign="top"| char[63]
| <font color="#777777">TRIG</font>file<font color="#777777">.oni</font>
 
This is a link to [[XML:TRIG|TRIG]] (trigger class), which holds the [[XML:M3GM|M3GM]] (3D model) of the rail and links to [[XML:TRGE|TRGE]] (laser emitter class) and [[XML:OBAN|OBAN]] (animation of the 3D model).
 
Original classes:
: trigger_arc
: trigger_circle
: trigger_evilbrain
: trigger_long
: trigger_long4x
: trigger_long4xzag
: trigger_rectangle
: trigger_sb3A
: trigger_sb3B
: trigger_short
|-
| <TriggerId>
| int16
| Used by BSL commands. Is it possible to use the same ID for different triggers?
|-
|valign="top"| <Flags>
|valign="top"| flags
|
: InitialActive
: ReverseAnim
: PingPong
|-
|valign="top"| <LaserColor>
|valign="top"| color
| [[wikipedia:RGB_color_model#Numeric_representations|RGB]] value, e.g. <LaserColor>255 0 77</LaserColor>
|-
| <StartPosition>
| float
| Start position of the trigger in the rail; ranges from 0.0 (bottom) to 1.0 (top) in relation to the spawn point of the trigger (spawn point = bottom).
|-
|valign="top"| <Speed>
|valign="top"| float
| This is one of two multipliers. The second multiplier can be set via the BSL command ''trig_speed id speed''.
 
total_speed = OBAN_speed * multiplier in file * multiplier in BSL
 
So if one of the multipliers is set to 0, the trigger will stop moving.
|-
| <EmitterCount>
| int16
| Number of emitters to spawn on the rail?
|-
| <TimeOn>
| int16
| Number of frames that laser should be on in a power cycle.
|-
| <TimeOff>
| int16
| Number of frames that laser should be off in a power cycle.
|-
| <Events>
| -
| int16 array. You can use multiple events.
|-
|valign="top"| <Script Function="call_this_BSL_function" />
|valign="top"| char[32]
| Name of linked BSL function. For example if you use "call_this_BSL_function" here, then write in the BSL script:
''func call_this_BSL_function
{
      dmsg "hi"
}''
|-
| <ActivateTurret TargetId="''Id''" />
| int16
|
|-
| <DeactivateTurret TargetId="''Id''" />
| int16
|
|-
| <ActivateConsole TargetId="''Id''" />
| int16
|
|-
| <DeactivateConsole TargetId="''Id''" />
| int16
|
|-
| <ActivateAlarm TargetId="''Id''" />
| int16
|
|-
| <DeactivateAlaram TargetId="''Id''" />
| int16
|
|-
| <ActivateTrigger TargetId="''Id''" />
| int16
|
|-
| <DeactivateTrigger TargetId="''Id''" />
| int16
|
|-
| <LockDoor TargetId="''Id''" />
| int16
|
|-
| <UnlockDoor TargetId="''Id''" />
| int16
|
|}
 
==Laser rotations==
The hardest part in setting up triggers is pointing them in the correct direction. Here are the Rotation numbers for each direction.
 
[[Image:Trigger rotation.jpg]]
 
Laser Direction 0:
*<tt><Rotation>0 90 0</Rotation></tt>: Moves left of position
*<tt><Rotation>180 90 0</Rotation></tt>: Moves right of position
*<tt><Rotation>270 90 0</Rotation></tt>: Moves above position
*<tt><Rotation>90 90 0</Rotation></tt>: Moves below position
 
Laser Direction 90:
*<tt><Rotation>0 180 0</Rotation></tt>: Moves left of position
*<tt><Rotation>180 180 0</Rotation></tt>: Moves right of position
*<tt><Rotation>270 180 0</Rotation></tt>: Moves above position
*<tt><Rotation>90 180 0</Rotation></tt>: Moves below position
 
Laser Direction 180:
*<tt><Rotation>0 270 0</Rotation></tt>: Moves left of position
*<tt><Rotation>180 270 0</Rotation></tt>: Moves right of position
*<tt><Rotation>270 270 0</Rotation></tt>: Moves above position
*<tt><Rotation>90 270 0</Rotation></tt>: Moves below position
 
Laser Direction 270:
*<tt><Rotation>0 0 0</Rotation></tt>: Moves left of position
*<tt><Rotation>180 0 0</Rotation></tt>: Moves right of position
*<tt><Rotation>270 0 0</Rotation></tt>: Moves above position
*<tt><Rotation>90 0 0</Rotation></tt>: Moves below position


'''tags'''
{{XML}}
* <Flags> : unknown
* <Position> : (trigger is spawned at this xyz-position)
* <Rotation> : (trigger has xyz-rotation (in degrees))
* <Class>
:: trigger_arc
:: trigger_circle
:: trigger_evilbrain
:: trigger_long
:: trigger_long4x
:: trigger_long4xzag
:: trigger_rectangle
:: trigger_sb3A
:: trigger_sb3B
:: trigger_short
:: (link by name to the [[TRIG]] instance (trigger class), which holds the [[M3GM]] of the rail and links to [[TRGE]] (laser emitter class) and [[OBAN]] (animation of the emitters))
:: (Screenshot of each would be good.)
* <TriggerId> : (used by BSL commands)
* <Flags> :
:: 4 - active?
:: 8 - initial active
:: 10 - reverse
:: 20 - pingpong
:: 40 - unknown
:: 80 - unknown
* <LaserColor> : ([[wikipedia:RGB_color_model#The_24-bit_RGB_representation|RGB]] range, e.g. <LaserColor>255 0 77</LaserColor>)
* <StartPosition> : (float value; start position of the trigger in the rail; range from 0 (bottom) to 1 (top) in connection to the spawn point of the trigger (spawn point = bottom))
* <Speed> : (float value; ''reference'': 0 means no movement, 1 is slow, and 2 is fast)
* <EmitterCount> : (number of laser emitters in one trigger rail)
* <Offset_0075> : (laser is on for a number of frames you set here)
* <Offset_0077> : (laser is off for a nubmer of frames you set here)
::(example: when you set 360 (at offset 0x75) and 120 (at offset 0x77) then the laser gets disabled after 6 seconds for 2 seconds, then loops; note that the laser will be off all if you set 0x75 to 0 and 0x77 to a number bigger than 0)
* <Events>
:* <Script Function="''BSL_function''" /> : (calls ''BSL_function'' (continuously as long as causer stays in laser))
:* <ActivateTurret TargetId="''ID''" /> : (activates a turret with id ''ID'' (integer decimal number))
:: (You can have more than one and different event types - functions and turrets - at same time.)

Latest revision as of 22:57, 7 May 2022

TRIG : Trigger
XML modding tips
  • See HERE to start learning about XML modding.
  • See HERE if you are searching for information on how to handle object coordinates.
  • See HERE for some typical modding errors and their causes.
XML.png
XML

AKEV << Other file types >> CONS

TMBD << Other BINA >> ONIE

TRGV << Other OBJC >> TURR

switch to OBD page

General information

  • The XML on this page was tested with OniSplit v0.9.94.0.
  • BINACJBOTrigger is level-specific (levelx_Final.dat).

BSL support

Command Description Example
marketing_line_off turns the laser line off marketing_line_off = 1
trig_activate trigger_id:int activates a trigger trig_activate 2
trig_deactivate trigger_id:int deactivates a trigger trig_deactivate 2
trig_hide trigger_id:int hides a trigger, disables also laser trig_hide 91
trig_show trigger_id:int shows a trigger trig_show 91
trig_speed trigger_id:int volume:float sets a triggers speed trig_speed 514 .15
trig_reset trigger_id:int resets a trigger to non-triggered state trig_reset 91

File structure

<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <Objects>
       [...]
   </Objects>
</Oni>

[...] means at least one trigger. Paste all your trigger data in there (this includes the <TRIG Id="...">/</TRIG> tag).

Example

XML TRIG trigger modded.jpg
       <TRIG Id="8136">
           <Header>
               <Flags></Flags>
               <Position>-445 68 -1362</Position>
               <Rotation>270 8.65141646E-06 180.000015</Rotation>
           </Header>
           <OSD>
               <Class>trigger_long</Class>
               <TriggerId>1</TriggerId>
               <Flags>44</Flags>
               <LaserColor>0 0 255</LaserColor>
               <StartPosition>0</StartPosition>
               <Speed>0</Speed>
               <EmitterCount>3</EmitterCount>
               <Offset_0075>0</Offset_0075>
               <Offset_0077>0</Offset_0077>
               <Events>
                   <Script Function="calling_this_BSL_function" />
                   <ActivateTurret TargetId="1" />
                   <DeactivateTurret TargetId="2" />
                   <ActivateConsole TargetId="3" />
                   <DeactivateConsole TargetId="4" />
                   <ActivateAlarm TargetId="5" />
                   <DeactivateAlaram TargetId="6" />
                   <ActivateTrigger TargetId="7" />
                   <DeactivateTrigger TargetId="8" />
                   <LockDoor TargetId="9" />
                   <UnlockDoor TargetId="10" />
               </Events>
           </OSD>
       </TRIG>

Tags

Tag Type Description
<TRIG Id="..."> integer You can also use <TRIG> without the ID parameter.
<Header> -
<Flags> flag Used in the past.
<Position> float x3 Trigger is spawned at this XYZ position.
<Rotation> float x3 Trigger has this XYZ rotation (in degrees).
<OSD> -
<Class> char[63] TRIGfile.oni

This is a link to TRIG (trigger class), which holds the M3GM (3D model) of the rail and links to TRGE (laser emitter class) and OBAN (animation of the 3D model).

Original classes:

trigger_arc
trigger_circle
trigger_evilbrain
trigger_long
trigger_long4x
trigger_long4xzag
trigger_rectangle
trigger_sb3A
trigger_sb3B
trigger_short
<TriggerId> int16 Used by BSL commands. Is it possible to use the same ID for different triggers?
<Flags> flags
InitialActive
ReverseAnim
PingPong
<LaserColor> color RGB value, e.g. <LaserColor>255 0 77</LaserColor>
<StartPosition> float Start position of the trigger in the rail; ranges from 0.0 (bottom) to 1.0 (top) in relation to the spawn point of the trigger (spawn point = bottom).
<Speed> float This is one of two multipliers. The second multiplier can be set via the BSL command trig_speed id speed.

total_speed = OBAN_speed * multiplier in file * multiplier in BSL

So if one of the multipliers is set to 0, the trigger will stop moving.

<EmitterCount> int16 Number of emitters to spawn on the rail?
<TimeOn> int16 Number of frames that laser should be on in a power cycle.
<TimeOff> int16 Number of frames that laser should be off in a power cycle.
<Events> - int16 array. You can use multiple events.
<Script Function="call_this_BSL_function" /> char[32] Name of linked BSL function. For example if you use "call_this_BSL_function" here, then write in the BSL script:
func call_this_BSL_function
{
     dmsg "hi"
}
<ActivateTurret TargetId="Id" /> int16
<DeactivateTurret TargetId="Id" /> int16
<ActivateConsole TargetId="Id" /> int16
<DeactivateConsole TargetId="Id" /> int16
<ActivateAlarm TargetId="Id" /> int16
<DeactivateAlaram TargetId="Id" /> int16
<ActivateTrigger TargetId="Id" /> int16
<DeactivateTrigger TargetId="Id" /> int16
<LockDoor TargetId="Id" /> int16
<UnlockDoor TargetId="Id" /> int16

Laser rotations

The hardest part in setting up triggers is pointing them in the correct direction. Here are the Rotation numbers for each direction.

Trigger rotation.jpg

Laser Direction 0:

  • <Rotation>0 90 0</Rotation>: Moves left of position
  • <Rotation>180 90 0</Rotation>: Moves right of position
  • <Rotation>270 90 0</Rotation>: Moves above position
  • <Rotation>90 90 0</Rotation>: Moves below position

Laser Direction 90:

  • <Rotation>0 180 0</Rotation>: Moves left of position
  • <Rotation>180 180 0</Rotation>: Moves right of position
  • <Rotation>270 180 0</Rotation>: Moves above position
  • <Rotation>90 180 0</Rotation>: Moves below position

Laser Direction 180:

  • <Rotation>0 270 0</Rotation>: Moves left of position
  • <Rotation>180 270 0</Rotation>: Moves right of position
  • <Rotation>270 270 0</Rotation>: Moves above position
  • <Rotation>90 270 0</Rotation>: Moves below position

Laser Direction 270:

  • <Rotation>0 0 0</Rotation>: Moves left of position
  • <Rotation>180 0 0</Rotation>: Moves right of position
  • <Rotation>270 0 0</Rotation>: Moves above position
  • <Rotation>90 0 0</Rotation>: Moves below position