ID:142467
 
mob 
verb
Water_Walk()
density = 0

I tryed making it so when i activate it it changes the waters density to 0 so i can "walk on it". i also tryed this,but none work.

mob 
verb
Water_Walk(water/W as 'water.dmi')
W.density = 0


But it says
245:error:Bad Imput Type


Plz help me with this or direct me to a guide to help, i would like to learn how to do this not be another rip coder.



the thing you are trying to do has no sense at all, but I am still gonna help you

mob 
verb
Water_Walk()
for(var/turf/water/W in world)
W.density = 0
In response to Kisioj
Which i find really stupid... why not change the persons density rather then the turf all around the world which allows people that do not have water walking enabled to go by.

Or learn how to use/modify Enter() to allow/deny access
In response to GhostAnime
i agree with GhostAnime, why not just change your density?

mob
verb
Water_Walk()
set category = "Commands"//Optional
set desc = "Use To Walk Over Dense Objects"//again optional
usr.density = 0
usr << "You become able to walk though the density of objects!"//Yet again, Optional if u want a message knowing that it happened


It's just that easy.
In response to Reno Kujika
That's quite a bad way to do it. If you want certain areas to be restricted by, say, an ability to swim in more rapid torrents, you could try it this way:
mob/var/swim_ability = 1 //They can do it a little by 
//default.

turf/water
var/swim_difficulty = 1 //This means people, by
//default, can swim.

Enter(mob/m)
//This checks to see that m is both a mob and a
//client. There are probably creatures in the water,
//so, by default, I'd avoid having NPCs not go in.
//Obviously, feel free to change it if you wish.
//This also checks to see that the player's ability
//is at least good enough to swim in the current
//torrent.

//As this returns the default proc, it is imperative
//that you DO NOT make this turf dense, even though
//that seems rather counter-intuitive for what
//you've probably learned so far.
if(istype(m) && m.client && m.swim_ability >= swim_difficulty) return ..()

//If any of the previous conditions are false, no
//swimming for you!
return 0
In response to Popisfizzy
Yes, and another way to do it would to check if they have it set to something...or something..I dont really know what im talking about but i mean like..
turf
Walkable_Water
icon = 'Water.dmi'
icon_state = "water"
name = "Walkable Water"
density = 0
Enter(atom/a)
if(istype(a,/mob))if(a:Water_Walk)return 1
else return 1
mob/var/Water_Walk = 0

mob/Admin//with or without the Admin if u want to give it to every player or not
verb
Water_Walk()
usr.Water_Walk = 1
usr << "You are now able to walk on certain water!"
In response to Reno Kujika
Isnt : something you should always avoid?
In response to Reno Kujika
Never, never, never, never, never use : like that. Abusing the : operator is one of the worst things you can do. As well, you never call the parent proc in Enter(), and both situations return 1. Another error is that you don't indent underneath "Walkable_Water". All around, this is just a bad snippet of code.
In response to Popisfizzy
turf
icon='turf.dmi'
water
icon_state="water" //yadayada... basic stuff.
Enter(atom/M) //if anything enters.
if(M.can_water_walk) //is the var set to 1 or higher?
return 0 //lets you pass, yeS?
else //if you dont have that var enabled
return 1 //dont pass.
world<<"[M] tried to walk on water, but he cant! HAHAHAHAHA"


Eh, I cant test it but that should work.
In response to King of Slimes
Returning 0 ends the proc, which means no water walking.
In response to Darkmag1c1an11
Darkmag1c1an11 wrote:
Returning 0 ends the proc, which means no water walking.

oh. Well I dont understand why anyone wants this feature, so I wouldnt know how to do it.
In response to King of Slimes
Then why did you feel a need to post horribly incorrect code?
In response to King of Slimes
1. This feature is generally used for Naruto games, but since I can't always be sure, I just tell them how and move on.

2. Learning to code isn't learning specific things, it's learning broad ideas that allow you to code those specific things. The return statement is one of the broad ideas.
In response to King of Slimes
That's probably even more incorrect than what the other person had. My code is still the best to use for this situation, so far posted.
In response to Darkmag1c1an11
Darkmag1c1an11 wrote:
1. This feature is generally used for Naruto games, but since I can't always be sure, I just tell them how and move on.

2. Learning to code isn't learning specific things, it's learning broad ideas that allow you to code those specific things. The return statement is one of the broad ideas.

1: lol anime gaems.

2: If I dont need the feature, I doubt I need to learn it.
In response to King of Slimes
If you had any idea what the hell you were doing, "learning" how to use Enter() would consist of looking it up in the reference. However, you DON'T, and then you proceed taking this anti-knowledge and vomiting it all over the forum.

If you can't provide advice, don't. Don't spam harmful code and say, "LAWL I DUN NO HOW 2 KODE HUR HUR HUR" as if that gives you the right to sabotage people who are ACTUALLY TRYING TO LEARN SOMETHING.
In response to Garthor
Garthor wrote:
If you had any idea what the hell you were doing, "learning" how to use Enter() would consist of looking it up in the reference. However, you DON'T, and then you proceed taking this anti-knowledge and vomiting it all over the forum.

If you can't provide advice, don't. Don't spam harmful code and say, "LAWL I DUN NO HOW 2 KODE HUR HUR HUR" as if that gives you the right to sabotage people who are ACTUALLY TRYING TO LEARN SOMETHING.

Never said I dont know how to code.

That whole post is flammy, to be honest. Dont have any thing nice to say? Keep it to yourself.
In response to King of Slimes
Being nice doesn't work. People don't remember a nice post.
In response to King of Slimes
You never said you don't know how to code, but that doesn't automatically mean you know how to code.
In response to King of Slimes
King of Slimes wrote:
That whole post is flammy, to be honest. Dont have any thing nice to say? Keep it to yourself.

No, that's not "flammy". This is "flammy":

Don't have anything intelligent to say? Keep it to yourself.
Page: 1 2 3 4