ID:180062
 
move over dense turfs...
this what iwant can anyone help?
I want a verb that makes the usr able to go over dense objects. Also i want it to display an image of the usr flying. I want it so if you hit the verb again you land on the cooridinate you are above, if you are on somethinge dense you cant move untill you hit the verb named fly. Is that descriptive enough?
Sigh!

Here we go!
mob
var
isflying = 0

mob/verb
fly()
if(isflying == 1) //if they're flying
usr.icon = 'notflying.dmi' //make them land
usr.isflying = 0
if(isflying == 0) //if they're not flying
usr.icon = 'flying.dmi' //make them fly
usr.isflying = 1

turf/Enter(mob/M)
if(M.isflying) //if M is flying
return 1 //let them pass
else //but if they aren't flying
return 0 //don't let them through

M.density = 0

That's it. Really.
In response to Vortezz
Vortezz wrote:
Sigh!

Here we go!
> mob
> var
> isflying = 0
>
> mob/verb
> fly()
> if(isflying == 1) //if they're flying
> usr.icon = 'notflying.dmi' //make them land
> usr.isflying = 0
> if(isflying == 0) //if they're not flying
> usr.icon = 'flying.dmi' //make them fly
> usr.isflying = 1
>
> turf/Enter(mob/M)
> if(M.isflying) //if M is flying
> return 1 //let them pass
> else //but if they aren't flying
> return 0 //don't let them through
>


This is actually a good approach (as apposed to setting density), since you can now override Enter() for turfs that you don't want people flying over. This also keeps two flying people from being able to fly through each other.

Just as a shortcut, you could even do this for turf:

<code>turf/Enter(mob/M) return M.isflying</code>
In response to Vortezz
Thanks!!!!!!!!!
hopefully the bb will come soon!!!!
In response to Valderalgx
Valderalgx wrote:
Thanks!!!!!!!!!
hopefully the bb will come soon!!!!

It won't, unless you stop now and spend at least a week learning the basics before you start creating the game.
In response to Skysaw
<code>turf/Enter(mob/M) > return M.isflying</code>

Ah! Of course! Hehe, how simple! =).

=V
In response to Vortezz
Vortezz wrote:
<code>turf/Enter(mob/M) > > return M.isflying</code>

Ah! Of course! Hehe, how simple! =).

hehe, I have a personal mission to get rid of as many "if" statements as I can!

.s
In response to Vortezz
mob
var
isflying = 0

mob/verb
fly()
if(isflying == 1) //if they're flying
usr.icon = 'nofly.dmi' //make them land
usr.isflying = 0
if(isflying == 0) //if they're not flying
usr.icon = 'fly.dmi' //make them fly
usr.isflying = 1

turf/Enter(mob/M)
if(M.isflying) //if M is flying
return 1 //let them pass
else //but if they aren't flying
return 0 //don't let them through
mob/verb
land()
usr.icon = 'nofly.dmi' //make them land
usr.isflying = 0

Now if i land it wont let me move, also how do i set the category?
In response to Valderalgx
You don't need to make a land verb. I've set it all up for one verb. This also shows that you don't know what you're doing. In that case, PLEASE read the FAQ, PLEASE thoroughly read the guide and ZBT tutorial, PLEASE, PLEASE, PLEASE understand something when I give it to you!

Set category is used in the following manner:
set category = "Spebessels"


PLEASE read the reference when looking for this!
In response to Vortezz
It wont 1, display the nofly icon if i hit fly again, 2 still keps moving through dense objects.
In response to Valderalgx
Valderalgx wrote:
It wont 1, display the nofly icon if i hit fly again, 2 still keps moving through dense objects.

This is why your game won't get done.

If you don't stop, step back, and understand the code you are using, you'll never get anywhere.

If you understood what Vortezz's code was doing, it would take you 2 seconds to fix problems like this.
In response to Deadron
just fixed it sorry i will wait until bb now.
Look at the title of your post. "Can't find anything on..." Do you think there's going to be a clearly marked answer for every little tiny question that you have? The problem here is that you're asking a very specific question that's actually just a very general matter: setting variables. If you'd learn the basics instead of working on the specifics, you'd be in much better shape.