ID:160333
 
i know how 2 code in the density part but how would i go about when the person clicks the levitation verb their icon actuallf floats up in the air and go up and down up and down and when they click levitation again their icon returns 2 the ground

here is the base of levitation im starting with

mob/powers/verb/Levitate()
set category = "Skills"//then the category
density = !density
if(density) usr << "You return to the ground."
else usr << "You levitate into the air."

this will make them untouchable but i need 1 add sum things like when there like this they their icon floats up and down and returns to normal when they hit the verb again
i dont want the icon 2 change i just want it 2 float up and down in the air til the verb is clicked again in which it returns 2 normal
In response to Mel23jones
An icon_state making the person levitate would be an extremely good idea, which alternatively, you would need an infinite loop running (until the person stops floating) with the modification of pixel_y.
Okay, how about you actually learn how to program instead of asking everyone how to do everything? Read the DM Guide, and figure it out. Hell, you could at least use the search function, as a lot of these questions have been asked before.
In response to GhostAnime
this is very simple which even i can do a fairly new usr for example heres this sample code

mob/var
float = 0
mob/verb
levitate()
if(usr.float = 0)
usr<<"You start to float."
usr.float = 1
usr.icon_state = "float" //Only usr change icon_state if the icon state is in the same icon file as the player icons
else //meaning if float isn't 0
usr<<"You stop floating."
usr.float = 0
usr.icon_state = "player" //change this to what ever this usrs i con state was
mob/turf
pit
density = 1
if(usr.float = 1)
src.density = 0

this is basicly what the code would have to be there are other simpler or more complicated ways to do it i did it quick so don't blame me if theres mistakes


In response to IrunoHatake
That code wouldn't even compile.
In response to Andre-g1
lol >.> did u make icons :P idk i quickly made it like i said i told him to edit it anyway
In response to IrunoHatake
ok this is what i tried

mob/powers/verb/Levitate()
set category = "Skills"//then the category
density = !density
src.pixel_y=70
src.pixel_y=40
if(density) usr << "You return to the ground."
else usr << "You levitate into the air."

that will make the char go up and down but it wont continue i need 2 make it continuous because the player is not changing icons the icon they have is floating up and down until they hit the verb again this code works but its now working how i want it to



In response to Mel23jones
mob/powers/verb/Levitate()
set category = "Skills"//then the category
density = !density
src.pixel_y=70
src.pixel_y=40
if(density) usr << "You return to the ground." //this wouldn't work unless something changes density to 1
else usr << "You levitate into the air."

also theres no varible for if your floating so u can't turn off and on the skill something along the likes of making a varible then if(var == 1) and if(var == 0) that just my suggestion but i don't rlly see to good how this code would work effectivly like you want it to
In response to IrunoHatake
that code will make the user go up then down a little but they r basically being moved 2tiles up i want it 2 look like the user is 2tiles up but they r really just floating how would i go about that?
In response to IrunoHatake
Hes using density, and on your earlier post, Andre-G1 was saying your code isn't good at all, and you shouldn't try to help people, if you don't know yourself.