XML:BINA/OBJC/PATR: Difference between revisions

From OniGalore
< XML:BINA‎ | OBJC
Jump to navigation Jump to search
mNo edit summary
m (copy-edit)
 
(11 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}}


{{Template:XMLModdingHints}}
==General information==
* The XML on this page is based on OniSplit '''v0.9.61.0'''.
* "BINACJBOPatrol Path" is level-specific (level''x''_Final.dat).
* A path can have at most 64 points.


'''general information'''
;Corrupting BSL code in patrol scripts
* '''BINACJBOPatrol Path.oni''' is level specific. (It can be found in edition/GameDataFolder/level''XX''_... )
: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.)


XML code - patrolscript points:


'''BSL support'''
<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'''


 
         <PATR Id="8283">
'''example'''
 
         <Object Id="8283" Type="PATR">
             <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>
 


{| class="wikitable" width="100%"
!width=400px| XML tag
!width=100px| 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 [[XML:BINA/OBJC/CHAR|BINA/OBJC/CHAR]]
|-
|valign=top| <ReturnToNearest>
|valign=top| 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.
|-
|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
|
|}


'''tags'''
{{XML}}
* <Flags> .. unknown -- appears to be always 0
* <Position> .. needed ?
* <Rotation> .. needed ?
* <Name> .. for BSL command "ai2_dopath"
* <PatrolId> .. used in [[OBD:BINA/OBJC/CHAR|BINA/OBJC/CHAR]]
* <ReturnToNearest> .. 1 and 0 possible
* <Points> .. holds actual patrol content
:: <MoveToFlag FlagId="..." />
:: <Stop /> (never used in Oni)
:: <Pause Frames="..." />
:: <LookAtFlag FlagId="..." />
:: <LookAtPoint X="..." Y="..." Z="..." /> (never used in Oni)
:: <MoveAndFaceFlag FlagId="..." />
:: <Loop>...</Loop>
:: <MovementMode Mode="Walk" />
:: <MovementMode Mode="Creep" />
:: <MovementMode Mode="WalkNoAim" />
:: <MovementMode Mode="ByAlertLevel" />
:: <MovementMode Mode="RunNoAim" />
:: <MovementMode Mode="Run" />
:: <MoveToPoint X="..." Y="..." Z="..." /> (never used in Oni)
:: <LockFacing Facing="..." /> (not used in Oni)
:: <MoveThroughFlag FlagId="..." Distance="..." />
:: <MoveThroughPoint X="..." Y="..." Z="..." Distance="..." /> (not used in Oni)
:: <StopLooking />
:: <FreeFacing />
:: <GlanceAtFlagFor FlagId="..." Frames="..." />
:: <MoveNearFlag FlagId="..." Distance="..." />
:: <LookFor Frames="..." Rotation="..." />
:: <Unknown18 />
:: <MoveToFlagLookAndWait Frames="..." FlagId="..." Rotation="..." />
:: <Unknown20 Frames="..." />
:: <ScriptId ScriptId="..." />
:: <IgnorePlayer Value="No" /> <IgnorePlayer Value="Yes" />
:: <FaceToFlagAndFire FlagId="..." Frames="..." Spread="..." />

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