An 'elevation' triggered event in SoM?

#1
People probably know that all event triggers in SoM go all the way up and down (on the Y axis) which makes a lot of scenarios hard to pull off. I just noticed one way SoM does sense the players Y-axis elevation that could be used in an event: 'pit trap' type Pieces trigger damage and a red screen flash when the player drops below ground level (ie into the pit).

This could be used to trigger falling to death scenarios or even (with a bit of work) variable damage based on how far the player falls.

Fall to death Example:
Event1 (Triggers when player walks off cliff)
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎ 'Set Player's HP in counter0'
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎ 'Activate Event2'

Event2(Always on) = 'Set Player HP in counter1
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  "IF" counter0 is > counter1 [triggers when damaged by pit trap]
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎ Change HP -999
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  "END IF"


Variable Damage fall scenario:
Event1 (Triggers when player walks off cliff)
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎ "Begin Timer0'
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎ 'Set Player's HP in counter0'
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎ 'Activate Event2'

Event2(Always on) = Set Player's HP in counter1
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ''Set Timer0's value in counter2'
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  "IF" HP in counter0 is > HP in counter1 [triggers when damaged by pit trap]
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  "Decrease counter1 by Counter2's value [reduces HP based on fall time]
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  Set Player HP to counter1's value
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  Move Object [raise invisible floor Object to stop pit trap's damage]
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  Disable Event2
‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  ‎  "END IF"

Pit trap Piece's don't seem to do much damage, but you can amplify their damage with an event similar to the 'fall scenarios' so they could be used for lava Pieces, or underwater air-deprivation damage also.
Might be worth the effort if it's important to the game. It's the only possible Y axis trigger I know of. :)

Edit: Made a demo showing the 'fall to death' trigger setup. It's attached.
‎  ‎ 


Attached Files
.zip   Pit-Trap Damage Trigger Demo.zip (Size: 19.41 KB / Downloads: 156)
Reply

#2
Demo added to first post.
Reply

#3
I admit I havent looked at your demo yet, but how would these events measure Y?
- Todd DuFore (DMPDesign)
Site Founder
Reply

#4
Oh nvm I just noticed the pit trap piece requirement, good find...why cant i think of a pit trap map piece though?
- Todd DuFore (DMPDesign)
Site Founder
Reply

#5
Yes, 'Pit Trap' is just a tag in the PRT file. The tag causes the player to take damage if they drop below that Piece's ground level.
You can make any Piece a 'pit-trap' using the Piece Editor.

You could set a Piece's 'ground level' to any elevation needed (by changing it's MHM file) and thus trigger events when the player takes damage as they pass through the desired elevation on the Y axis.

Probably most useful for fall damage/death scenarios, but it could also trigger cut-scenes or move objects as the player falls.
Reply

#6
John that is brilliant, I love it.

I will be sure to incorporate this in my next game.
- Todd DuFore (DMPDesign)
Site Founder
Reply

#7
Okay so this topic kinda set me off thinking about something id like to make... Namely a pitfall where the player drops into a new level.

I'd like to ask (the moonlight masters) how i could drop into a map piece that has enough mhm and msm for a fairly long downwards tunnel... and into a new map, incorporating the pitfall damage idea from this thread?

Something that i cant get my head around is... I know that you can setup an obj to place the player into a new map, but id prefer the player to actually fall for a while first, rather than just walk over the object and be transported there (as in, reduce the Y axis trigger for the event.)
Reply

#8
The 'pit-trap' scenario from this post should work perfectly for what you want to do.
Specifically, the player would fall for a ways, and then warp to the new map when they pass below Y=0.



Attached Files Thumbnail(s)
   
Reply

#9
Ok, found this very interesting so i thought to try out you're demo.

Really impressed. However... For the jump down to death area, i jumped more to the left and landed on a far left square, which for some reason started to drain my hp by the second and left me alive.

For the jump to damage event, i jumped down, got damaged and wandered to the back of the sign, and again started getting my hp drained by the second. This would only trigger if i moved into the squares behind the warp sign, if i moved back to where you'd normally land after jumping, the drain was removed, if id step in it would drain again.


Attached Files Thumbnail(s)
   
Reply

#10
Done a bit of tinkering.

Set the radius for fall to death to 4.0 on both lengths. Worked fine and no worries.

The second area i couldnt fathom though, at map piece 20 87 i would walk over it and take damage.

Btw whilst on topic, would i need to actually damage the player or just initiate the warp to map for it to work?
Reply





Users browsing this thread:
2 Guest(s)