EvilEngine/BUTN: Difference between revisions

From Heavy Iron Modding
Content added Content deleted
Battlepedia>Seil
m (Seil moved page BUTN to EvilEngine/BUTN)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<onlyinclude>
{{AssetInfobox
{{#vardefine:typeid|BUTN}}<nowiki/>
|subtitle=Button
{{#vardefine:name|Button}}<nowiki/>
|type=[[Placeable]]
{{#vardefine:type|[[Entity]]}}<nowiki/>
|objectid=0x18
{{#vardefine:basetype|0x18}}<nowiki/>
|games=Night of 100 Frights<br>Battle for Bikini Bottom<br>The SpongeBob SquarePants Movie<br>The Incredibles}}
{{#vardefine:games|Scooby BFBB TSSM Incredibles}}<nowiki/>
{{#vardefine:sourcecode|[https://github.com/bfbbdecomp/bfbb/blob/master/src/Game/zEntButton.h zEntButton.h]}}<nowiki/>
{{#vardefine:image|Buttons.png}}<nowiki/>
</onlyinclude>
{{AutoAssetInfobox}}


This asset defines an entry for buttons such as switches and pressure plates.
This asset defines an entry for buttons such as switches and pressure plates.


==Format==
==Format==
Buttons are [[Placeable Asset|placeable assets]], so they start with their 0x54 byte header, then are followed by:
Buttons 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 || [[AssetID]] || '''Pressed Model'''. Defaults to ModelAssetID in the placeable header (same model for pressed and unpressed).
| 0x54 || [[AssetID]] || '''modelPressedInfoID''' || Defaults to ModelAssetID in the placeable header (same model for pressed and unpressed).
|-
|-
| 0x58 || int || '''Type'''.
| 0x58 || int || '''actMethod''' ||
* 0 = Button - Stays pressed upon being hit. (Also has a flashing effect)
* 0 = Button - Stays pressed upon being hit. (Also has a flashing effect)
* 1 = Pressure Plate - Stays pressed until it stops being hit, then unpresses.
* 1 = Pressure Plate - Stays pressed until it stops being hit, then unpresses.
|-
|-
| 0x5C || int || null
| 0x5C || int || '''initButtonState''' ||
|-
|-
| 0x60 || int || '''Unpress'''. 0 (disabled) or 1 (enabled). If this is enabled, the button will automatically unpress itself after '''Unpress Timeout'''. (Only works on Button, not Pressure Plate.) Useful for timed challenges.
| 0x60 || int || '''isReset''' || 0 (disabled) or 1 (enabled). If this is enabled, the button will automatically unpress itself after '''resetDelay'''. (Only works on Button, not Pressure Plate.) Useful for timed challenges.
|-
|-
| 0x64 || float || '''Unpress Timeout''' (seconds). Time to wait after being pressed to unpress.
| 0x64 || float || '''resetDelay''' || (seconds) Time to wait after being pressed to unpress.
|-
|-
| 0x68 || int || '''Hit Mask'''. This bitmask specifies what can press the button.
| 0x68 || int || '''buttonActFlags''' || This bitmask specifies what can press the button.
* 0 - Bubble Spin/Sliding (SpongeBob)
* 0x1 - Bubble Spin/Sliding (SpongeBob)
* 1 - Bubble Bounce
* 0x2 - Bubble Bounce
* 2 - Bubble Bash
* 0x4 - Bubble Bash
* 3 - [[BOUL|Boulder]]/Bubble Bowl
* 0x8 - [[BOUL|Boulder]]/Bubble Bowl
* 4 - Cruise Bubble
* 0x10 - Cruise Bubble
* 5 - Bungee
* 0x20 - Bungee
* 6 - Thrown Enemy/Tiki
* 0x40 - Thrown Enemy/Tiki
* 7 - Throw Fruit
* 0x80 - Throw Fruit
* 8 - Patrick Slam
* 0x100 - Patrick Slam
* 9 - Unknown
* 0x200 - Unknown
* 10 - (Pressure Plate) Player Stand
* 0x400 - (Pressure Plate) Player Stand
* 11 - (Pressure Plate) Enemy Stand
* 0x800 - (Pressure Plate) Enemy Stand
* 12 - (Pressure Plate) [[BOUL|Boulder]]/Bubble Bowl
* 0x1000 - (Pressure Plate) [[BOUL|Boulder]]/Bubble Bowl
* 13 - (Pressure Plate) Stone Tiki
* 0x2000 - (Pressure Plate) Stone Tiki
* 14 - Sandy Melee/Sliding
* 0x4000 - Sandy Melee/Sliding
* 15 - Patrick Melee/Sliding
* 0x8000 - Patrick Melee/Sliding
* 16 - (Pressure Plate) Throw Fruit
* 0x10000 - (Pressure Plate) Throw Fruit
* 0x20000 - Patrick Cartwheel (TSSM only, unused in BFBB)
* 17-31 - Unused
* The rest of the bits are unused.
|-
|-
| 0x6C || byte[8] || Unknown. Usually 4,0,0,4,2,1,1,0
| 0x6C || [[Motion]] || '''Motion''' || Always type 4 (Mechanism)
|-
|-
! colspan="4" | Events
| 0x74 || float || '''Pressed Height''' (local units). Height of the button when pressed. This is affected by local rotation and scale.
|-
|-
| 0x9C || Event[numberOfEvents] || '''[[Events]]''' || '''BFBB'''
| 0x78 || float || '''Transition Time''' (seconds). Time it takes to move between pressed and unpressed height.
|-
|-
| 0xA8 || Event[numberOfEvents] || '''[[Events]]''' || '''Movie'''
| 0x7C || float || '''Ease In Time''' (seconds). Easing in duration, relative to unpressed height. Must be >= 0 and <= Transition Time.
|-
| 0x80 || float || '''Ease Out Time''' (seconds). Easing out duration, relative to pressed height. Must be >= 0 and <= Transition Time.
|-
| 0x84 || int[6] || null
|-
! colspan="3" | Events
|-
| 0x9C || Event[numberOfEvents] || '''[[Events]]'''
|}
|}


=== Events ===
=== Events ===

{{Assets}}
{{AutoGameNavs}}


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

Latest revision as of 22:33, 15 September 2022

BUTN
Button
TypeEntity
Base Type0x18
Games usedNight of 100 Frights

Battle for Bikini Bottom
The SpongeBob SquarePants Movie

The Incredibles
Source codezEntButton.h

This asset defines an entry for buttons such as switches and pressure plates.

Format

Buttons are entity assets, so they start with their 0x54 byte header, then are followed by:

Offset Type Variable Description
0x54 AssetID modelPressedInfoID Defaults to ModelAssetID in the placeable header (same model for pressed and unpressed).
0x58 int actMethod
  • 0 = Button - Stays pressed upon being hit. (Also has a flashing effect)
  • 1 = Pressure Plate - Stays pressed until it stops being hit, then unpresses.
0x5C int initButtonState
0x60 int isReset 0 (disabled) or 1 (enabled). If this is enabled, the button will automatically unpress itself after resetDelay. (Only works on Button, not Pressure Plate.) Useful for timed challenges.
0x64 float resetDelay (seconds) Time to wait after being pressed to unpress.
0x68 int buttonActFlags This bitmask specifies what can press the button.
  • 0x1 - Bubble Spin/Sliding (SpongeBob)
  • 0x2 - Bubble Bounce
  • 0x4 - Bubble Bash
  • 0x8 - Boulder/Bubble Bowl
  • 0x10 - Cruise Bubble
  • 0x20 - Bungee
  • 0x40 - Thrown Enemy/Tiki
  • 0x80 - Throw Fruit
  • 0x100 - Patrick Slam
  • 0x200 - Unknown
  • 0x400 - (Pressure Plate) Player Stand
  • 0x800 - (Pressure Plate) Enemy Stand
  • 0x1000 - (Pressure Plate) Boulder/Bubble Bowl
  • 0x2000 - (Pressure Plate) Stone Tiki
  • 0x4000 - Sandy Melee/Sliding
  • 0x8000 - Patrick Melee/Sliding
  • 0x10000 - (Pressure Plate) Throw Fruit
  • 0x20000 - Patrick Cartwheel (TSSM only, unused in BFBB)
  • The rest of the bits are unused.
0x6C Motion Motion Always type 4 (Mechanism)
Events
0x9C Event[numberOfEvents] Events BFBB
0xA8 Event[numberOfEvents] Events Movie

Events