Jump to content
Sign in to follow this  
Indomitus

"Move or Die" game logic, anyone?

Recommended Posts

Today I started playing with options for building a game timer without using a timer object (using the DELAY tile instead) and realized that the same technique could be applied to "Move Or Die" style logic.

If you've never played Move Or Die, it's a fast-paced VS game, and one of the main mechanics of it is that if you stand still for too long, you die and automatically lose that round.  To stay in the game, you have to keep moving.

I figured that could be a fun game mechanic to have in Ylands, if someone comes up with a game mode to use it.  Here's the results.  Have fun with it.

 

I'm just posting screenshots for now, since it's actually pretty simple code.

 

The main code is in an Entity Storage.  All of the variables being used are listed under the "On Create" event.  Those would need to be defined in the Variables section at the left.  Certain ones are just values you can change to adjust the behavior of the logic.  And of course the "DisplayTimer" routine can be changed or even removed depending on the needs of the game.

Ylands_190118_232506.thumb.png.7a54ca0cc12cdd28be892a92360770c0.png

To make it work, this is the code I added into a Player Role object.  The Delay tile in this part is completely optional.

Ylands_190118_225856.thumb.png.cff1cb50ece6486efa31476e0f0b962c.png

 

One possible variation could be:  If the move distance is higher than the minimum, where it currently sets "MyStandStillTime" to 0, it could instead subtract the "TimerInterval" (or a different value) to make the time act like regenerating health instead of resetting all at once.

Another variation could use the player's actual Hit Points instead of a timer.  That would give a built-in display and warning when it's running out.

 

Edited by Indomitus

Share this post


Link to post
Share on other sites

 

I was thinking about custom timers like this and im actually surprised it works seeing as the delay function doesnt work in while loops. Interesting

 

Edited by Oliver Hope

Share this post


Link to post
Share on other sites

A Return tile is basically an "END" command.  It tells the script to exit the routine.  There's a plain one, and one that can return a value, so you have to use the one that matches the block of code you're in.  If that code was called from somewhere else, it will return to the next line back there.

The Delay tile does kind of the same thing.  It will end the block of code, so it has to be at the end, or inside a piece of logic where it's okay to exit the routine (like inside an IF block).

Edited by Indomitus

Share this post


Link to post
Share on other sites
49 minutes ago, Indomitus said:

A Return tile is basically an "END" command.  It tells the script to exit the routine.  There's a plain one, and one that can return a value, so you have to use the one that matches the block of code you're in.  If that code was called from somewhere else, it will return to the next line back there.

The Delay tile does kind of the same thing.  It will end the block of code, so it has to be at the end, or inside a piece of logic where it's okay to exit the routine (like inside an IF block).

Wow i just learnt a lot :P thanks

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×