ID:176764
 
IS there away so when u cast a spell that the waters density for only you becomes to a state where u can walk on it?
There are a couple of ways to achive this effect. I'll give you the worst first. You can simply make it so that the water is non-dense. Thats bad since anyone can walk over it.
2nd. You could use Enter(). Just make it so that the mob has a 'walk_on_water' variable. When you cast the spell, it sets that var to 1 (True). When you Enter() the water it will return 'walk_on_water'. So the water turf would look something like this.
turf
icon = 'water.dmi'
water
Enter(O)
if(istype(O, /mob))
return O:walk_on_water

3rd. If you just want it to walk through one water turf, and its a specific one (Like the one in front of them) just set there loc to the waters loc.
-DogMan
In response to Dog Man
ok thanks ill see if it works
In response to Dog Man
Dog Man wrote:
> turf
> icon = 'water.dmi'
> water
> Enter(O)
> if(istype(O, /mob))
> return O:walk_on_water
>

What would i put for the walk_on_water var?
In response to Koolguy900095
walk_on_water = 1 if you want to be able to walk on water, and 0 if you dont.
In response to Dog Man
now how do i make it so when u logoff the var resets to whatever
In response to Koolguy900095
Simply dont save that variable. Or if you do, just have part that resets it in your loading proc.
-DogMan
In response to Dog Man
ok thanks let me try that
In response to Koolguy900095
i am a real n00b arnt i anyway why dont this work

mob
Login()
walk_on_water = 0
In response to Koolguy900095
Ummm. I would put a ..() in there, to make it do the defualt action of Login(). That's the only thing I can see that would cause it not to work.
mob
Login()
..()
walk_on_water = 0
-DogMan
In response to Dog Man
would this be a good code so after 30 seconds you cant walk on water anymore

Walk_on_water()
walk_on_water = 1
sleep(300)
walk_on_water = 0
In response to Koolguy900095
Yeah, that would do the job. Your probably better off to use spawn(300).
Walk_on_water()
walk_on_water = 1
spawn(300)
walk_on_water = 0
In response to Koolguy900095
By defining it as temporary.

mob/var/tmp/walk_on_water = 0

Then it will be ignored in the default Read() and Write() procs, and will save you that one bit of space.