ID:166811
Jun 12 2006, 11:49 am
|
|
wats the var of the direction a mob is facing? i tried using dir but tht just affects the direction in which the client looks at the map, any help?
|
In response to PirateHead
|
|
lmao, thx ^^
|
In response to DarkBelthazor
|
|
np lb
|
In response to PirateHead
|
|
how can i code it in, ill give u an example of wat im doing
client/East(atom/A) |
In response to DarkBelthazor
|
|
Yeah, your use of atom/a int he arguments is probably faulty. I don't think that that argument actually exists - and besides, you have the client/mob variable to use, assuming you're wanting to turn the mob. You could easily do
client/East() turn(NORTH,90) will always return WEST, by the way. :-) According to the reference, anyway. I thought it turned clockwise, but what do I know? If you just want the arrows to turn your mob, you could do client/Move(loc,dir) Hope that helps a little. Look up turn(), by the way. It dosn't turn an atom, but rather returns a new direction based on the given dir and the degrees. |
In response to PirateHead
|
|
i know tht bit bout turn lol, the rest of the code is like EAST, 90 or WEST -90 (i accounted for degree change) but tht other bit is wat i needed, thx ^^
|
In response to DarkBelthazor
|
|
dang! tht bit of code u sent still makes my guy move normally, ill tell ya wat i tried to do ^^, i want to make it so left and right arrows turn the mob round and up arrow sends u in that direction
|
In response to DarkBelthazor
|
|
Yup. I tested and de-glitched it -- and I learned more about how client.Move() works, evidently. This works for me:
client/Move(loc) Tell me if it works for you. |
In response to PirateHead
|
|
YAY, only one thing left now, how do i stop the output to the usr? everytime it turns i get 4 4 4 8 8 1 1 1 8 8 ...etc.
^^ thx |
In response to DarkBelthazor
|
|
You sargathed it before I could remove the "world << dir" line that I put in there when I was trying to figure out why it was working wierd. Just remove that line. :-)
|
In response to PirateHead
|
|
kk, thx again :), if u ever on Kohaku, Demonic Legends or any other game ive made/coded shout me ^^
|
In response to PirateHead
|
|
plus, i just improved it a little more, so it includes 8 directions without muffing up :)
client/Move(loc) |
In response to DarkBelthazor
|
|
Holy crap, you sure did expand it.
|
In response to PirateHead
|
|
PirateHead wrote:
turn(NORTH,90) will always return WEST, by the way. :-) According to the reference, anyway. I thought it turned clockwise, but what do I know? I thought this was strange at first also, but once I learned circle trig it made more sense. Positive angles moved the terminal side counter-clockwise while negative angles moved it clockwise. If he wanted to simplify things quite a bit, he could always do: if(EAST) mob.dir = turn(mob.dir,-45) You can use negatives ;) |
In response to DarkCampainger
|
|
Yeah, it does make sense geometrically. It's just my fault that I generally think of things in a clockwise fashion; it's easy enough to settle into the counter-clockwise geometry, especially when a proc works the opposite of what you thought it would.
|
From the DM Reference (which you should have checked before posting!):
under client/var,
This defines the relationship between the world's coordinate system and the player's screen.
under atom/var,
This is the direction that the object is facing.
Next time, hit F1 first :-)