Jump to content

OBD:BINA/OBJC/PATR: Difference between revisions

you're right, unknown20 forks the patrol script
m (force loop, it's extensively used in level8_Final)
(you're right, unknown20 forks the patrol script)
Line 64: Line 64:
:18 - force loop continuance and correctness (type 17 can cause incorrect loops and a complete break in case of 0 frames)
:18 - force loop continuance and correctness (type 17 can cause incorrect loops and a complete break in case of 0 frames)
:19 - time + flag + rotation in degrees (short + short + float) - character moves to the flag and when reached he/she looks/aims around for the fixed time
:19 - time + flag + rotation in degrees (short + short + float) - character moves to the flag and when reached he/she looks/aims around for the fixed time
:20 - appears to be a duplicate of 21
:20 - <u>fork</u> patrolscript by id (short) - BSL function with this id is called up (f.e. id <nowiki>= 1, then called up function =</nowiki> patrolscript0001)
:21 - patrolscript id follows (short) - function with this id is called up (f.e. id <nowiki>= 1, then called up function =</nowiki> patrolscript0001)
:21 - <u>call</u> patrolscript by id (short) - BSL function with this id is called up (f.e. id <nowiki>= 1, then called up function =</nowiki> patrolscript0001), caution: bsl can interrupt the patrol path (see example below)
:22 - ignore player (byte) - 0 <nowiki>= off; 1 =</nowiki> on
:22 - ignore player (byte) - 0 <nowiki>= off; 1 =</nowiki> on
:23 - flag + time + firing spread in degrees (short + short + float) - character faces to to the flag and fires his/her weapon for the fixed time  
:23 - flag + time + firing spread in degrees (short + short + float) - character faces to to the flag and fires his/her weapon for the fixed time  
Line 79: Line 79:
;Path points
;Path points
:A path can have at most 64 points.
:A path can have at most 64 points.
;Corrupting BSL code at patrolscripts
:I suspect that ''instantly'' played BSL code breaks patrol path.
:example:
::patrolscript0001 contains a sleep command and patrolscript0002 will be played.
::But 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"
}




8,013

edits