XML:BINA/OBJC/PATR: Difference between revisions

< XML:BINA‎ | OBJC
(Created page with '=BINA/OBCJ/PATR: patrol paths= '''general information''' * '''BINACJBOPatrol Path.oni''' is level specific. (It can be found in edition/GameDataFolder/lev...')
 
m (copy-edit)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=[[OBD:BINA/OBJC/PATR|BINA/OBCJ/PATR]]: patrol paths=
{{XML_OBJC_Header | prev=PART | type=PATR | next=PWRU | name=Patrol Path}}


'''general information'''
==General information==
* '''BINACJBOPatrol Path.oni''' is level specific. (It can be found in edition/GameDataFolder/level''XX''_... )
* The XML on this page is based on OniSplit '''v0.9.61.0'''.
* See [[XML basic tutorial|HERE]] if you don't know how to convert an oni file into XML and vice versa.
* "BINACJBOPatrol Path" is level-specific (level''x''_Final.dat).
* See [[OBD_talk:BINA/OBJC|HERE]] if you are searching for more general information such as how to handle object coordinates.
* A path can have at most 64 points.


;Corrupting BSL code in patrol scripts
:I ([[User:Paradox-01|Paradox]]) suspect that ''instantly'' played BSL code breaks patrol paths. Example: patrolscript0001 contains a sleep command and patrolscript0002 will be played. If you remove the sleep command, the patrol path will break. (This was tested in level 1 SP1 with A_t48 and his patrol_48.)


'''BSL support'''
XML code - patrolscript points:
 
<Points>
    <ScriptId ScriptId="1" />
    <ScriptId ScriptId="2" />
    <ScriptId ScriptId="3" />
</Points>
 
BSL code:
func patrolscript0001
{
dmsg "1"
chr_animate 0 KONOKOpowerup
sleep 1
}
func patrolscript0002
{
dmsg "2"
}
func patrolscript0003
{
dmsg "3"
}
 
==BSL support==
* <font color="#777777">ai2_showpaths = 1</font>
* <font color="#777777">ai2_showpaths = 1</font>
* ai2_dopath ''ai_name path_name''
* ai2_dopath ''ai_name path_name''


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


'''''[...]''''' means at least one patrol block. Paste all your patrol data in there (this includes the <PATR Id="..."> and </PATR> tag).


'''''[...]''''' means at least one patrol block. Paste all a patrol data into there (this includes <Object ...> and </Object> tag).
'''Example'''
 
 
'''example'''


         <Object Id="8283" Type="PATR">
         <PATR Id="8283">
             <Header>
             <Header>
                 <Flags>0</Flags>
                 <Flags></Flags>
                 <Position>-408.598755 60.1162872 -1402.20361</Position>
                 <Position>-408.598755 60.1162872 -1402.20361</Position>
                 <Rotation>0 0 0</Rotation>
                 <Rotation>0 0 0</Rotation>
Line 52: Line 74:
                 </Points>
                 </Points>
             </OSD>
             </OSD>
         </Object>
         </PATR>




'''tags'''
{| class="wikitable" width="100%"
* <Flags> .. unknown -- appears to be always 0
!width=400px| XML tag
* <Position> .. needed ?
!width=100px| Content type
* <Rotation> .. needed ?
! Description
* <Name> .. for BSL command "ai2_dopath"
|-
* <PatrolId> .. used in [[OBD:BINA/OBJC/CHAR|BINA/OBJC/CHAR]]
| <PATR Id="...">
* <ReturnToNearest> .. 1 and 0 possible
| integer
* <Points> .. holds actual patrol content
| ID doesn't matter
:: <MoveToFlag FlagId="..." />
|-
:: <Stop /> (never used in Oni)
| <Flags>
:: <Pause Frames="..." />
| flag
:: <LookAtFlag FlagId="..." />
| Unknown
:: <LookAtPoint X="..." Y="..." Z="..." /> (never used in Oni)
|-
:: <MoveAndFaceFlag FlagId="..." />
| <Position>
:: <Loop>...</Loop>
| float x3
:: <MovementMode Mode="Walk" />
| XYZ position, unused
:: <MovementMode Mode="Creep" />
|-
:: <MovementMode Mode="WalkNoAim" />
| <Rotation>
:: <MovementMode Mode="ByAlertLevel" />
| float x3
:: <MovementMode Mode="RunNoAim" />
| XYZ rotation, unused
:: <MovementMode Mode="Run" />
|-
:: <MoveToPoint X="..." Y="..." Z="..." /> (never used in Oni)
| <Name>
:: <LockFacing Facing="..." /> (not used in Oni)
| string
:: <MoveThroughFlag FlagId="..." Distance="..." />
| Used by BSL command "ai2_dopath"
:: <MoveThroughPoint X="..." Y="..." Z="..." Distance="..." /> (not used in Oni)
|-
:: <StopLooking />
| <PatrolId>
:: <FreeFacing />
| integer
:: <GlanceAtFlagFor FlagId="..." Frames="..." />
| Used in [[XML:BINA/OBJC/CHAR|BINA/OBJC/CHAR]]
:: <MoveNearFlag FlagId="..." Distance="..." />
|-
:: <LookFor Frames="..." Rotation="..." />
|valign=top| <ReturnToNearest>
:: <Unknown18 />
|valign=top| flag
:: <MoveToFlagLookAndWait Frames="..." FlagId="..." Rotation="..." />
|
:: <Unknown20 Frames="..." />
: 1 (Yes)
:: <ScriptId ScriptId="..." />
: 0 (No)
:: <IgnorePlayer Value="No" /> <IgnorePlayer Value="Yes" />
|-
:: <FaceToFlagAndFire FlagId="..." Frames="..." Spread="..." />
| <Points>
| -
| Holds the actual path data (up to 64 points).
|-
| <MoveToFlag FlagId="..." />
| integer
|
|-
| <Stop />
| -
|
|-
| <Pause Frames="..." />
| integer
|
|-
| <LookAtFlag FlagId="..." />
| integer
|
|-
| <LookAtPoint X="..." Y="..." Z="..." />
| float x3
|
|-
| <MoveAndFaceFlag FlagId="..." />
| integer
|
|-
| <Loop>...</Loop>
|
| Patrol path tags can be enclosed by this loop tag.
|-
|valign=top| <MovementMode Mode="..." />
|valign=top| flag
|
: ByAlertLevel
: Stop
: Crouch
: Creep
: WalkNoAim
: Walk
: RunNoAim
: Run
|-
| <MoveToPoint X="..." Y="..." Z="..." />
| float x3
|
|-
|valign=top| <LockFacing Facing="..." />
|valign=top| flag
|
: Forward
: Backward
: Left
: Right
: Stopped
|-
| <MoveThroughFlag FlagId="..." Distance="..." />
| integer, float
|
|-
|valign=top| <MoveThroughPoint X="..." Y="..." Z="..." Distance="..." />
| float x4
|
|-
| <StopLooking />
| -
|
|-
| <FreeFacing />
| -
|
|-
| <GlanceAtFlagFor FlagId="..." Frames="..." />
| integer x2
|
|-
| <MoveNearFlag FlagId="..." Distance="..." />
|  integer, float
|
|-
| <Scan Frames="..." Rotation="..." />
| integer, float
|
|-
| <StopScanning />
| -
|
|-
| <MoveToFlagLookAndWait Frames="..." FlagId="..." Rotation="..." />
| integer x2, float
|
|-
|valign=top| <CallScript ScriptId="..." />
| integer
|Calls a BSL function by ID. For example if the ID is 1 then the BSL function is named "patrolscript0001".
|-
|valign=top| <ForkScript ScriptId="..." />
| integer
|Forks a BSL function by ID. For example if the ID is 2 then the BSL function is named "patrolscript0002".
|-
|valign=top| <IgnorePlayer Value="..." />
|valign=top| flag
|
: No
: Yes
|-
| <FaceToFlagAndFire FlagId="..." Frames="..." Spread="..." />
| integer x2, float
|
|}


    <font color="#777777">'''(listing found stuff for research)''' <Unknown18 />
{{XML}}
<Name>p_sh_tank1</Name><PatrolId>39</PatrolId> lvl 8
<Name>p_sh_s2</Name><PatrolId>42</PatrolId> lvl 8
<Name>p_sh_s4</Name><PatrolId>43</PatrolId> lvl 8
<Name>p_sh_s5</Name><PatrolId>44</PatrolId> lvl 8
<Name>p_sh_s7</Name><PatrolId>46</PatrolId> lvl 8
<Name>p_sh_red2</Name><PatrolId>47</PatrolId> lvl 8
<Name>patrol_25_red21</Name><PatrolId>25</PatrolId> lvl 9
<Name>patrol_38</Name><PatrolId>38</PatrolId> lvl 9
<Name>Pod1_OpeningGuard_1</Name><PatrolId>27</PatrolId> lvl 14
<Name>Lab3_Sci_2</Name><PatrolId>34</PatrolId> lvl 14</font>
    <font color="#777777">'''(listing found stuff for research)''' <Unknown20 Frames="..." />
<Name>bait_2</Name><PatrolId>9</PatrolId> lvl 2 300 frames
<Name>bait_3</Name><PatrolId>38</PatrolId> lvl 2 300 frames
<Name>TerminalTwo_Striker_2</Name><PatrolId>16</PatrolId> lvl 4 0 frames
<Name>bomber_flee</Name><PatrolId>41</PatrolId> lvl 4 200 frames
<Name>red_retreat_1</Name><PatrolId>25</PatrolId> lvl 13 7 frames
<Name>red_retreat_2</Name><PatrolId>26</PatrolId> lvl 13 7 frames
<Name>patrol_27</Name><PatrolId>27</PatrolId> lvl 19 27 frames</font>

Latest revision as of 01:21, 3 April 2021

PATR : Patrol Path
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

PART << Other OBJC >> PWRU

switch to OBD page

General information

  • The XML on this page is based on OniSplit v0.9.61.0.
  • "BINACJBOPatrol Path" is level-specific (levelx_Final.dat).
  • A path can have at most 64 points.
Corrupting BSL code in patrol scripts
I (Paradox) suspect that instantly played BSL code breaks patrol paths. Example: patrolscript0001 contains a sleep command and patrolscript0002 will be played. If you remove the sleep command, the patrol path will break. (This was tested in level 1 SP1 with A_t48 and his patrol_48.)

XML code - patrolscript points:

<Points>
   <ScriptId ScriptId="1" />
   <ScriptId ScriptId="2" />
   <ScriptId ScriptId="3" />
</Points>

BSL code:

func patrolscript0001
{
	dmsg "1"
	chr_animate 0 KONOKOpowerup
	sleep 1
}
func patrolscript0002
{
	dmsg "2"
}
func patrolscript0003
{
	dmsg "3"
}

BSL support

  • ai2_showpaths = 1
  • ai2_dopath ai_name path_name

File structure

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

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

Example

       <PATR Id="8283">
           <Header>
               <Flags></Flags>
               <Position>-408.598755 60.1162872 -1402.20361</Position>
               <Rotation>0 0 0</Rotation>
           </Header>
           <OSD>
               <Name>patrol_32</Name>
               <PatrolId>32</PatrolId>
               <ReturnToNearest>1</ReturnToNearest>
               <Points>
                   <IgnorePlayer Value="Yes" />
                   <MovementMode Mode="Run" />
                   <MoveToFlag FlagId="545" />
                   <Loop>
                       <MoveToFlagLookAndWait Frames="120" FlagId="545" Rotation="5" />
                       <IgnorePlayer Value="No" />
                       <MoveThroughFlag FlagId="145" Distance="0" />
                       <MovementMode Mode="ByAlertLevel" />
                       <MoveToFlagLookAndWait Frames="300" FlagId="144" Rotation="60" />
                       <MoveThroughFlag FlagId="145" Distance="0" />
                       <MoveToFlagLookAndWait Frames="300" FlagId="146" Rotation="90" />
                   </Loop>
               </Points>
           </OSD>
       </PATR>


XML tag Content type Description
<PATR Id="..."> integer ID doesn't matter
<Flags> flag Unknown
<Position> float x3 XYZ position, unused
<Rotation> float x3 XYZ rotation, unused
<Name> string Used by BSL command "ai2_dopath"
<PatrolId> integer Used in BINA/OBJC/CHAR
<ReturnToNearest> flag
1 (Yes)
0 (No)
<Points> - Holds the actual path data (up to 64 points).
<MoveToFlag FlagId="..." /> integer
<Stop /> -
<Pause Frames="..." /> integer
<LookAtFlag FlagId="..." /> integer
<LookAtPoint X="..." Y="..." Z="..." /> float x3
<MoveAndFaceFlag FlagId="..." /> integer
<Loop>...</Loop> Patrol path tags can be enclosed by this loop tag.
<MovementMode Mode="..." /> flag
ByAlertLevel
Stop
Crouch
Creep
WalkNoAim
Walk
RunNoAim
Run
<MoveToPoint X="..." Y="..." Z="..." /> float x3
<LockFacing Facing="..." /> flag
Forward
Backward
Left
Right
Stopped
<MoveThroughFlag FlagId="..." Distance="..." /> integer, float
<MoveThroughPoint X="..." Y="..." Z="..." Distance="..." /> float x4
<StopLooking /> -
<FreeFacing /> -
<GlanceAtFlagFor FlagId="..." Frames="..." /> integer x2
<MoveNearFlag FlagId="..." Distance="..." /> integer, float
<Scan Frames="..." Rotation="..." /> integer, float
<StopScanning /> -
<MoveToFlagLookAndWait Frames="..." FlagId="..." Rotation="..." /> integer x2, float
<CallScript ScriptId="..." /> integer Calls a BSL function by ID. For example if the ID is 1 then the BSL function is named "patrolscript0001".
<ForkScript ScriptId="..." /> integer Forks a BSL function by ID. For example if the ID is 2 then the BSL function is named "patrolscript0002".
<IgnorePlayer Value="..." /> flag
No
Yes
<FaceToFlagAndFire FlagId="..." Frames="..." Spread="..." /> integer x2, float