Author Topic: BackgroundTriggers  (Read 3125 times)

Akari

  • *
  • Posts: 766
    • View Profile
BackgroundTriggers
« on: 2007-10-19 13:09:49 »
Along with revercing of walking algorithm I unrerstand BackgroundTriggers (called triggers in this topic http://forums.qhimm.com/index.php?topic=3247.0)

Kero was wrong in almost all parts on this.

This is not exactly what is storen in there.
struct {
  vector3S16 corner1;
  vector3S16 corner2;
  U8 enterstate;
  U8 leavestate;
  U8 defaultstate;
  U8 sound;
} triggers

This will be more appropriate.
struct {
  vector3S16 corner1;
  vector3S16 corner2;
  U8 background_group_id;
  U8 background_frame_id;
  U8 behavior;
  U8 sound_id;
} triggers

background_group_id and background_frame_id are the same parameters that used in BGON BGOFF opcodes.

behavior can be from 0 to 5

0 - OnTrigger - ON
1 - OnTrigger - OFF
2 - OnTrigger - ON, AwayFromTrigger - OFF
3 - OnTrigger - OFF, AwayFromTrigger - ON
4 - OnTrigger - ON, AwayFromTriggerOnPlusSide - OFF
5 - OnTrigger - OFF, AwayFromTriggerOnPlusSide - ON

sound id needs to be reverced more, but this is G territory =)