I randomly was thinking of making a quick little game based on the childhood game "The Floor Is Lava" but with a unique twist.
Players would all spawn in a sort of rectangular room. Every so often one of the pieces of the floor and would vanish revealing lava below and if a player is standing there, they die and would then have to spectate the others.
Think of it as a more competitive version. Does anyone have any idea how one could make said tiles of the floor randomly disappear in no set order and reveal lava below that will kill players if they step into it?
1
2
Feb 14 2014, 12:59 pm
Best response
|
|
Look up locate() in the reference. Make an attempt, and if you are still having trouble, let us know so that we can evaluate and help you figure out where you are going wrong.
|
Well, I more or less want to change the floor tiles randomly into the lava tiles that I have.
Meaning the floor will randomly turn into lava at random instances. So, every time the players hop in, the tiles will "convert" in a different order. To the point where all the tiles will become lava. Here's the mess of code I have right now concerning the turfs. turf/floor |
You can make it a game of chance where lava generates randomly every 30 seconds.
var{lava_time=0.5;} //time modifier. 0.5 = 30 seconds. To use it, when the game begins, just use the code generateLava(locate(center.x,center.y,center.z), radius.size) Please remember that center is just a place holder for an atom and radius.size is a place holder for a number. Note: Ask questions if you don't get what is going on in the code, I will be more than willing to explain it to you. |
var{lava_time=0.5;} //time modifier. 0.5 = 30 seconds. |
Alright thanks mate. Any tips on what I should define for the center, and radius?
Also, I tried compiling the code and it said "objects.dm:19:error: lava_time: undefined var" Trying to figure out how to define this var. I'm used to defining vars, but can't figure this one out. |
just anywhere put
var/lava_time=0.5 //every 30 sconds As for the Center, it is ideal to be the center of the arena. As for the radius, its how many tiles it expands from the center. If you need further assistance with any future project, you may contact me via skype or my networking site. [email protected] ~ SKYPE http://www.ssj4justdale.com ~ SOCIAL-NETWORK |
When the game begins, do
generateLava(locate(17,13,1), 10) //this will make the center locate(17,13,1) and it will expand 10 tiles in each direction.
|
Alright, but now I'm getting a bad argument definition.
var{lava_time=0.5;} //time modifier. 0.5 = 30 seconds. |
No no no -.- dont modify the code I gave you.
leave the one I sent untouched> then add something like mob/Login() |
yeah, my function was just something thats there to be called later one from another code, like a library.
Anyway, hope to get in contact with you again in the future. |
In response to Ssj4justdale
|
|
Just one more question. Just ran the game and the floor tiles actually never changed to lava. Maybe I'm missing something in the code?
var{lava_time=0.5;} //time modifier. 0.5 = 30 seconds. And then the Login stuff. mob/Login() Should the Login stuff be under my original Login code? mob/Login() |
I would do
mob/Login() |
Alright, thanks pal. One more question and I should be done bugging you.
30 seconds is a little too long. I want it to be more fast paced. Let's say, 5 seconds. |
In response to Ssj4justdale
|
|
Oh man that worked beautifully. Thanks! I'll post a video of it in action :)
|
Alright, if you have issues with the time implementation, I can adjust it so you can just enter how many seconds you want on it.
The current math behind it is ((600*0.09)) = time in seconds * 10. -- 0.09 is lava_time This would currently output 54, but the seconds it's waiting is the output/10 which would be 5.4 seconds. |
1
2