EvilEngine/TRIG: Difference between revisions

From Heavy Iron Modding
Content added Content deleted
Battlepedia>Seil
m (Seil moved page TRIG to EvilEngine/TRIG)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<onlyinclude>
{{#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.
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==
==Format==
Triggers are [[Placeable Asset|placeable assets]], so they start with their 0x54 byte header, then are followed by:
Triggers are [[Entity|entity assets]], so they start with their 0x54 byte header, then are followed by:


{| class="wikitable"
{| class="wikitable"
! Offset !! Type !! Description
! Offset !! Type !! Variable !!Description
|-
|-
| 0x54 || Vector3 || Trigger Position 0
! 0x54 || struct (size: 0x30) || '''p''' ||
|-
|-
| 0x60 || Vector3 || Trigger Position 1
| 0x54 || [[Vector3]] || Trigger Position 0 ||
|-
|-
| 0x6C || Vector3 || Trigger Position 2
| 0x60 || [[Vector3]] || Trigger Position 1 ||
|-
|-
| 0x78 || Vector3 || Trigger Position 3
| 0x6C || [[Vector3]] || Trigger Position 2 ||
|-
|-
| 0x84 || float || Unknown. Usually 0.
| 0x78 || [[Vector3]] || Trigger Position 3 ||
|-
|-
! !! !! !!
| 0x88 || float || Unknown. Usually -0.
|-
|-
| 0x8C || float || Unknown. Usually 1.
| 0x84 || [[Vector3]] || '''direction''' || Usually (0, -0, 1)
|-
|-
| 0x90 || float || Unknown. Usually 0.
| 0x90 || int || '''flags''' || Usually 0.
|-
|-
! colspan="3" | Events
! colspan="4" | Events
|-
|-
| 0x94 || Event[numberOfEvents] || '''[[Events]]'''
| 0x94 || Event[numberOfEvents] || '''[[Events]]''' ||
|}
|}


Line 31: Line 44:
** 0 - Box
** 0 - Box
** 1 - Sphere
** 1 - Sphere
** 2 - Cylinder (unused)

** 3 - Sphere (unused, seems to be the same as used Sphere)


* Trigger Position 0
* Trigger Position 0
** Box - Front, Bottom, Left sides of box (absolute coordinates)
** Box - Front, Bottom, Left sides of box (absolute coordinates)
** Sphere - Center (X, Y, Z) (absolute coordinates)
** Sphere - Center (X, Y, Z) (absolute coordinates)
** Cylinder - Bottom? (X, Y, Z) (absolute coordinates)
* Trigger Position 1
* Trigger Position 1
** Box - Back, Top, Righ sides of box (absolute coordinates)
** Box - Back, Top, Right sides of box (absolute coordinates)
** Sphere - X is the sphere's radius. Y and Z are always 0.
** 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
* 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.
** 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)
** Sphere - Always (0, 0, 0)
** Cylinder - Probably always (0, 0, 0)
* Trigger Position 3
* 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.
** 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)
** Sphere - Always (0, 0, 0)
** Cylinder - Probably always (0, 0, 0)


==Events==
==Events==
{| class="wikitable"
* [[List of Events#EnterPlayer|EnterPlayer]]
! Event !! Description
* [[List of Events#ExitPlayer|ExitPlayer]]
|-
* [[List of Events#EnterEntity|EnterEntity]]
| '''[[EnterPlayer]]''' || '''EnterPlayer''' is fired when the [[PLYR|Player]] enters the trigger.
* [[List of Events#ExitEntity|ExitEntity]]
|-
* [[List of Events#Enter SpongeBob|Enter SpongeBob]]
| '''[[ExitPlayer]]''' || '''ExitPlayer''' is fired when the [[PLYR|Player]] exits the trigger.
* [[List of Events#Enter Patrick|Enter Patrick]]
|-
* [[List of Events#Enter Sandy|Enter Sandy]]
| '''[[EnterEntity]]''' || '''EnterEntity''' is sent from an [[Placeable Asset|Entity]] when it enters the trigger.
* [[List of Events#Exit SpongeBob|Exit SpongeBob]]
|-
* [[List of Events#Exit Patrick|Exit Patrick]]
| '''[[ExitEntity]]''' || '''EnterEntity''' is sent from an [[Placeable Asset|Entity]] when it enters the trigger.
* [[List of Events#Exit Sandy|Exit Sandy]]
|-
* [[List of Events#EnterCruise|EnterCruise]]
| '''[[Enter SpongeBob]]''' || '''Enter SpongeBob''' is fired at the same time as [[EnterPlayer]] if the current playable character is SpongeBob.
* [[List of Events#ExitCruise|ExitCruise]]
|-
| '''[[Enter Patrick]]''' || '''Enter Patrick''' is fired at the same time as [[EnterPlayer]] if the current playable character is Patrick.
|-
| '''[[Enter Sandy]]''' || '''Enter Sandy''' is fired at the same time as [[EnterPlayer]] if the current playable character is Sandy.
|-
| '''[[Exit SpongeBob]]''' || '''Exit SpongeBob''' is fired at the same time as [[ExitPlayer]] if the current playable character is SpongeBob.
|-
| '''[[Exit Patrick]]''' || '''Exit Patrick''' is fired at the same time as [[ExitPlayer]] if the current playable character is Patrick.
|-
| '''[[Exit Sandy]]''' || '''Exit Sandy''' is fired at the same time as [[ExitPlayer]] if the current playable character is Sandy.
|-
| '''[[EnterCruise]]''' ||
|-
| '''[[ExitCruise]]''' ||
|}

{{Assets}}
{{AutoGameNavs}}


[[Category:Asset]]
[[Category:Asset]]

Latest revision as of 22:58, 15 September 2022

TRIG
Trigger
TypeEntity
Base Type0x01
Games usedNight of 100 Frights

Battle for Bikini Bottom
The SpongeBob SquarePants Movie
The Incredibles
Rise of the Underminer

Ratatouille Prototype
Source codezEntTrigger.h

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 assets, so they start with their 0x54 byte header, then are followed by:

Offset Type Variable Description
0x54 struct (size: 0x30) p
0x54 Vector3 Trigger Position 0
0x60 Vector3 Trigger Position 1
0x6C Vector3 Trigger Position 2
0x78 Vector3 Trigger Position 3
0x84 Vector3 direction Usually (0, -0, 1)
0x90 int flags Usually 0.
Events
0x94 Event[numberOfEvents] Events
  • 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

Event Description
EnterPlayer EnterPlayer is fired when the Player enters the trigger.
ExitPlayer ExitPlayer is fired when the Player exits the trigger.
EnterEntity EnterEntity is sent from an Entity when it enters the trigger.
ExitEntity EnterEntity is sent from an Entity when it enters the trigger.
Enter SpongeBob Enter SpongeBob is fired at the same time as EnterPlayer if the current playable character is SpongeBob.
Enter Patrick Enter Patrick is fired at the same time as EnterPlayer if the current playable character is Patrick.
Enter Sandy Enter Sandy is fired at the same time as EnterPlayer if the current playable character is Sandy.
Exit SpongeBob Exit SpongeBob is fired at the same time as ExitPlayer if the current playable character is SpongeBob.
Exit Patrick Exit Patrick is fired at the same time as ExitPlayer if the current playable character is Patrick.
Exit Sandy Exit Sandy is fired at the same time as ExitPlayer if the current playable character is Sandy.
EnterCruise
ExitCruise