ID:272194
Apr 26 2008, 4:33 am
|
|
OK, my pokemon game is up and running, a couple of days ago I came here asking how to make a pokeball code soon made one myself :),anyways I tried making the HM surf code by myself, I set it so when I right click the badge it says activate surf and when you activate it, it makes your var(Surf) to 1, so I was wondering how do I make it so If I have my surf set to 1, that I could go right through water?
|
In response to Kaioken
|
|
Thanks,dude. I'm gonna try it out!
|
In Enter(), if a mob can swim (or whatever), then allow them entry. Perhaps you should do this by temporarily making the turf's density = 0 while calling the default Enter() reaction ( ..() ). That way players that can swim will ignore the turf's density, but they still won't be able to swim into water that has other dense things in it (ie a boat or another player...).
However, the more foolproof method would probably be to do it the other way around; give the water an actual density of 0, and override Enter() in order to disable movement rather than enable it; in your Enter(), simply allow the proc to proceed only for certain specific conditions, ie: if what's trying to enter has either density = 0 or swim = 1 (another common condition would be, if what's trying to enter is a projectile, then allow it) - otherwise, return 0.
Good luck.