TombEngine icon indicating copy to clipboard operation
TombEngine copied to clipboard

Adngel smoke emitter update

Open Adngel opened this issue 8 months ago • 5 comments

This branch is a refactor of the code used by Smoke Emitters.

  • Reference variables have been created to improve the readibility.
  • Functions created to modularize some actions.
  • namespace created to encapsulate the functions related to the smoke emitters.
  • Replaced several calls of the deprecated "GetRandomControl" function.
  • Replaced item pointer by item reference.
  • fixed errors with the particle velocity.

Also added some new features

  • restored the big bubbles effect using the OCB +2
  • Added use for the variable ItemFlags[2], when steam emitter is underwater, ItemFlags[2] will be the radius it uses to spawn the bubles. (32 if by default, set it to 512 if you want bubles spawning from the tile)
  • Implemented the ability to color the smoke_emitter using the editor object tint (smoke_emitter_black and smoke_emitter_white will keep ignoring the color tint).
  • Removed the steam shot position displacement, for now on, the steam shot will spawn from the object root, in the direction of the cone red vertex. It can be moved to the tile sides keeping the Shift and Ctrl while moving in the editor.
  • Added negative OCBs to deactivate the damage of the steam shots (to simulate poison decorative effect like the VCI levels from TR5).
  • Added the ability to free rotate them upwards and downwards. (Used only for steam shots effects).
  • Added steam shot effects to the Smoke_emitter_black and Smoke_emitter_white

Note: You need update Tomb Editor (master branch) if you want to have the option of rotate smoke emitters pitch rotations. (If you don't, you still can use smoke emitters and rotate them via lua scripts).

OCB and Item Flags:

  • OCB 0: Default Smoke
  • OCB < 0: Steam shot won't harm Lara (new)
  • OCB =! 0: Horizontal steam shot (edited from 8&)
  • OCB + (16 * X): x is the number of frames it pauses between steam shots
  • OCB 111 (removed) originally moved the source 512 behind to spawn steam shot from the wall, now the same can be achieved just moving the cone object to the wall.

Example OCB between 1 and 15 Steam shot is constant OCB between 16 and 31 Steam shot will pause 1 frame OCB between 480 and 495 (16 x 30) Steam shot will pause 30 frames (1 second) OCB between 2400 and 2415 (16 x 150) Steam shot will pause 150 frames (5 seconds)

ItemFlags

  • item.ItemFlags[0]: Timer for the pause between steam shots
  • item.ItemFlags[1]: Timer for the active steam shots
  • item.ItemFlags[2]: Acceleration of the steam shot particles
  • item.ItemFlags[3]: Bit flags of the Steam Emiter (bit 0 = No Damage) (new)

In Underwater rooms

  • OCB 0: Intermitent bubbles emission.
  • OCB 1: Continuous bubbles emission.
  • OCB +2: Use big bubbles. (new)

ItemFlags

  • item.ItemFlags[0]: Count the number of bubles it has to spawn.
  • item.ItemFlags[1]: Flag used to spawn a serie of bubbles with no delay.
  • item.ItemFlags[2]: Radius of the bubbles spawn horizontal plane. (by default is 32). (new)

Things to do:

  • [ ] Testing.
  • [x] Revision.
  • [x] Implementation of the free axis rotation in editor and engine. (Changes made in editor master branch).

Adngel avatar May 30 '24 17:05 Adngel