ID:166386
 
I am wanting to start working on a game, but I have one problem that I don't know how to fix, I want to be able to move up a z level but clicking on something that says raise or lower.

I am wanting to make a kind of Skies of Arcadia Legends game.
If you mean a thing that asks you if you want to go higher or lower then try this
mob/proc/Teleport()
switch(alert("Stuff you want to say above the buttons","Title of prompt","Raise","Lower","Cancel (Just in case)"))
if("Raise") loc=locate(x,y,z+1)
if("Lower") loc=locate(x,y,z-1)
if("Cancel") return

that may not be the best way but i'm not going to refine it that much
world
maxz=5 // change that to the amount of z levels in your map.
obj
change_z_level
icon='icon.dmi'
Click()
if(alert("Higher or lower your Z level?","Z level","Higher","Lower")=="higher") // if the players choses to higher the Z level.
if(usr.z==world.maxz) // If the user's current Z is the highest Z level.
usr<<"Error! You already are on the highest Z level!"
return
else src.z+=1 // Otherwise higher the Z level by 1
else
// You can't get too lazy, now, can you?
// This is up to you, plainly giving code to you will
// only result into laziness on your side, so do this
// part yourself. =)


O-matic
In response to Shlaklava
Shlaklava wrote:
that may not be the best way but i'm not going to refine it that much

And what if the user is on the highest Z level, and decides to higher his Z level again? Or the opposite, being on the lowest Z level and lowering the Z level? Always make it as secure as you can.

O-matic
In response to O-matic
O-matic wrote:
Shlaklava wrote:
that may not be the best way but i'm not going to refine it that much

And what if the user is on the highest Z level, and decides to higher his Z level again? Or the opposite, being on the lowest Z level and lowering the Z level? Always make it as secure as you can.

O-matic

Let me quote myself again

Shlaklava wrote:
that may not be the best way but i'm not going to refine it that much

So i was correct...it was only for example
In response to O-matic
Alright, thank you both, this will help me get ready for the game.

But if I want to change it to an area, do I just switch out the icon with area? (I probly have to do some other things to it but I want to find that out)
In response to Shlaklava
Shlaklava wrote:
Let me quote myself again

Shlaklava wrote:
that may not be the best way but i'm not going to refine it that much

So i was correct...it was only for example

What is the use of supplying code of which you're not even sure it is proper code? If you're unsure, then don't try. I cannot state it any simplier.

O-matic
In response to O-matic
if people are going to ask a question...then I'm going to supply them with an example that i will not work on like a game...they need to learn that they have to catch those bugs themselves...

plus i was trying to get the fact that you could use switch(alert()) as a prompt
In response to Shlaklava
You trying to teach a lion to not-hunt before sending him into the jungle, let me state it that way.

O-matic