EvilEngine/TRIG: Difference between revisions

m
Seil moved page TRIG to EvilEngine/TRIG
Battlepedia>Igorseabra4
No edit summary
m (Seil moved page TRIG to EvilEngine/TRIG)
 
(17 intermediate revisions by 4 users not shown)
Line 1:
<onlyinclude>
==TRIG==
{{#vardefine:typeid|TRIG}}<nowiki/>
{{#vardefine:name|Trigger}}<nowiki/>
{{#vardefine:type|[[Entity]]}}<nowiki/>
{{#vardefine:basetype|0x01}}<nowiki/>
{{#vardefine:games|Scooby BFBB TSSM Incredibles ROTU RatProto}}<nowiki/>
{{#vardefine:sourcecode|[https://github.com/bfbbdecomp/bfbb/blob/master/src/Game/zEntTrigger.h zEntTrigger.h]}}<nowiki/>
{{#vardefine:image|}}<nowiki/>
</onlyinclude>
{{AutoAssetInfobox}}
 
This asset defines an entry for a trigger, a volume of space which can detect what happens within it and send events to other assets accordingly.
 
The triggers have their own position coordinates below, but they use the Position values in the Placeable header as the pivot point for rotation (rotation is done as if that point was the origin). Apparently, all 3 trigger types can be rotated this way.
 
==Format==
Triggers are [[Entity|entity assets]], so they start with their 0x54 byte header, then are followed by:
 
{| class="wikitable"
! Offset !! Type !! Variable !!Description
|-
! 0x54 || struct (size: 0x30) || '''p''' ||
! colspan="3" | Header
|-
| 0x000x54 || [[AssetIDVector3]] || '''AssetTrigger ID'''.Position 0 ||
|-
| 0x040x60 || byte[[Vector3]] || '''AssetTrigger type'''.Position 0x011 for TRIG.||
|-
| 0x050x6C || byte[[Vector3]] || '''NumberTrigger ofPosition Events'''.2 ||
|-
| 0x060x78 || short[[Vector3]] || '''Flags'''.Trigger UsuallyPosition 003 1D||
|-
! !! !! !!
! colspan="3" | Trigger
|-
| 0x080x84 || byte[[Vector3]] || Unknown.'''direction''' || Usually (0, or-0, 1.)
|-
| 0x090x90 || byteint || Shape.'''flags''' 0|| =Usually Box, 1 = Sphere0.
|-
! colspan="4" | Events
| 0x0A || byte || Unknown. Always 0.
|-
| 0x94 || Event[numberOfEvents] || '''[[Events]]''' ||
| 0x0B || byte || Unknown. Always 0.
|}
 
* Trigger types (offset 0x09):
** 0 - Box
** 1 - Sphere
** 2 - Cylinder (unused)
** 3 - Sphere (unused, seems to be the same as used Sphere)
 
* Trigger Position 0
** Box - Front, Bottom, Left sides of box (absolute coordinates)
** Sphere - Center (X, Y, Z) (absolute coordinates)
** Cylinder - Bottom? (X, Y, Z) (absolute coordinates)
* Trigger Position 1
** Box - Back, Top, Right sides of box (absolute coordinates)
** Sphere - X is the sphere's radius. Y and Z are always 0.
** Cylinder - X is the cylinder's radius. Y is the cylinder's height. Z is probably always 0.
* Trigger Position 2
** Box - Three seemingly random values in the range of 0xCDCDCDB7 to 0xCDCDCDDA. The meaning of this vector is unknown and is probably unused.
** Sphere - Always (0, 0, 0)
** Cylinder - Probably always (0, 0, 0)
* Trigger Position 3
** Box - Three seemingly random values in the range of 0xCDCDCDB7 to 0xCDCDCDDA. The meaning of this vector is unknown and is probably unused.
** Sphere - Always (0, 0, 0)
** Cylinder - Probably always (0, 0, 0)
 
==Events==
{| class="wikitable"
! Event !! Description
|-
| '''[[EnterPlayer]]''' || '''EnterPlayer''' is fired when the [[PLYR|Player]] enters the trigger.
| 0x0C || int || null
|-
| '''[[ExitPlayer]]''' || '''ExitPlayer''' is fired when the [[PLYR|Player]] exits the trigger.
| 0x10 || int || null. Not present in beta Goo Lagoon.
|-
| '''[[EnterEntity]]''' || '''EnterEntity''' is sent from an [[Placeable Asset|Entity]] when it enters the trigger.
| 0x14 || Vector3 || '''Rotation'''. This is actually used. The box trigger is rotated by its center point after placement. No effect on sphere trigger.
|-
| '''[[ExitEntity]]''' || '''EnterEntity''' is sent from an [[Placeable Asset|Entity]] when it enters the trigger.
| 0x20 || Vector3 || '''Position'''. Probably unused.
|-
| '''[[Enter SpongeBob]]''' || '''Enter SpongeBob''' is fired at the same time as [[EnterPlayer]] if the current playable character is SpongeBob.
| 0x2C || Vector3 || '''Scale'''. Unused.
|-
| '''[[Enter Patrick]]''' || '''Enter Patrick''' is fired at the same time as [[EnterPlayer]] if the current playable character is Patrick.
| 0x38 || Vector4 || '''Color'''. Unused.
|-
| '''[[Enter Sandy]]''' || '''Enter Sandy''' is fired at the same time as [[EnterPlayer]] if the current playable character is Sandy.
| 0x48 || float || '''Unknown'''
|-
| '''[[Exit SpongeBob]]''' || '''Exit SpongeBob''' is fired at the same time as [[ExitPlayer]] if the current playable character is SpongeBob.
| 0x4C || [[AssetID]] || '''Unknown'''
|-
| '''[[Exit Patrick]]''' || '''Exit Patrick''' is fired at the same time as [[ExitPlayer]] if the current playable character is Patrick.
| 0x50 || int || null
|-
| '''[[Exit Sandy]]''' || '''Exit Sandy''' is fired at the same time as [[ExitPlayer]] if the current playable character is Sandy.
| 0x54 || Vector3 || Trigger Position 0
|-
| '''[[EnterCruise]]''' ||
| 0x60 || Vector3 || Trigger Position 1
|-
| '''[[ExitCruise]]''' ||
| 0x6C || Vector3 || Trigger Position 2
|-
| 0x78 || Vector3 || Trigger Position 3
|-
| 0x84 || float || Unknown. Usually 0.
|-
| 0x88 || float || Unknown. Usually -0.
|-
| 0x8C || float || Unknown. Usually 1.
|-
| 0x90 || float || Unknown. Usually 0.
|-
! colspan="3" | Events
|-
| 0x94 || Event[numberOfEvents] || '''[[Events]]'''
|}
 
{{Assets}}
* Trigger Position 0
{{AutoGameNavs}}
** Box - Front, Bottom, Left sides of box (absolute coordinates)
** Sphere - Center (X, Y, Z) (absolute coordinates)
* Trigger Position 1
** Box - Back, Top, Righ sides of box (absolute coordinates)
** Sphere - X is the sphere's radius. Y and Z are always 0.
* Trigger Position 2
** Box - Three seemingly random values in the range of 0xCDCDCDB7 to 0xCDCDCDDA. The meaning of this vector is unknown and is probably unused.
** Sphere - Always (0, 0, 0)
* Trigger Position 3
** Box - Three seemingly random values in the range of 0xCDCDCDB7 to 0xCDCDCDDA. The meaning of this vector is unknown and is probably unused.
** Sphere - Always (0, 0, 0)
 
[[Category:Asset]]