ID:159642
Feb 4 2009, 8:06 am
|
|
Well i want to make a move delay when you are walking on a certain turf if some var is 1 and not allow someone to step on it if the same var is 2 but i have no idea where to start....so is it possible and how?
|
In response to Andre-g1
|
|
turf Ok so it does all ok with the delay but I still need to code somehow that he walks to the turf...right now he only gets the delay and the water acts as density = 1 |
In response to Destrojer
|
|
You forgot to call the parent, ..().
And also, on a switch if statement, you can use multiple values, so instead of : if(0) You can just do this :
if(0,1) M.Move_Delay = 0
|
In response to Andre-g1
|
|
turf I tried placing it everywhere but still the same problem. |
In response to Andre-g1
|
|
You can also use to's in switch if statements which I didn't know you could before :o
mob/verb/Verby(n as num) |
In response to Spunky_Girl
|
|
You can use 'to' even if it isn't in a switch statement, however that's irrelevant to this topic.
|
In response to Andre-g1
|
|
It's totally relevant :)
switch(M.water) :) |
... any chance of getting a better description of this? If so, I might be able to write up something for you. What you have now is borderline nonsense.
|
In response to Popisfizzy
|
|
turf well....it's supposed to if Water = 0 or 1 you can move on it with no delay,if Water = 2 you can move on it but with a delay,and if 3 you are not able to move on it.....but with this code i have,move delay is ok,but water turf acts as density = 1 |
In response to Destrojer
|
|
Note that the following code is dependent on the stuff laid out here, which is also in my pif_MovementSystem library.
mob/var/swim_skill = 0 |
In response to Popisfizzy
|
|
Thank you...."return 1" works in this case....unlike "..()" >.<
|
In response to Destrojer
|
|
... that would be because ..() returns nothing. In most things, Enter() and other similiar procs do nothing but return 1 by default, so there's no need to call the parent proc.
|
In response to Popisfizzy
|
|
Exit() does just return 1 by default, but returning 1 in an Enter() override like you did breaks the normal movement rules of density, since that what its default behavior governs. Unless you want everything to be considered nondense in water, you should return ..() so the final return value allows or disallows the movement according to density of objects.
Also, watch your wording. =P Popisfizzy wrote: ..() returns nothing. [...] Enter() and other (simil<s>i</s>ar) procs [...] return 1<font color=red>Word</font> <font color=#33CCFF>Police</font> |
In response to Kaioken
|
|
I don't believe I was thinking very clearly when I wrote that statement.
|
In response to Popisfizzy
|
|
Now i have another question >.<
turf The verbs Dive/Surface.....when you use then then if there is someone in your view it shows that screen to select who you want to do it on,and i want to make it only be used on the user. (well...either way it is only used on the user but that screen is annoying.....how to remove it?) |
In response to Destrojer
|
|
Um, this is because you did it right there yourself by defining a mob argument in the verb, and verb arguments require the player to supply a suitable value by choosing. It's also essentially useless there seeing as the usr var is a var that is already pre-declared and exists on all procs; in fact it's weird and perhaps buggish if that code actually compiles, as it declares a new var with a name already used; I'll rather assume you used a different actual var name.
What you want in a verb like that is probably the src setting, to make the verb only available when in water and as such as desired (though that would be the case by default with turfs), and using the usr var to denote the player running the verb, as that's what that var does. You should probably read the DM Guide on verbs, and look them up (and verb arguments) in the Ref as well. |
In response to Popisfizzy
|
|
We all have those moments, but a nice way to put it, there. >.>
|
And yes, it is possible.
Something like that should give you a head start.