mob/PC/Login()
spawn()MovmentLoop()
Problem description:i have the movment code but its to mob/player
i want to use it to mob/pc and mob/player how can i use it in mob/pc with out duplicate it?
Code:
mob/PC/Login() Problem description:i have the movment code but its to mob/player i want to use it to mob/pc and mob/player how can i use it in mob/pc with out duplicate it? |
Jul 15 2014, 1:09 am
|
|
Define MovementLoop() in /mob. Then mob/PC and mob/Player have it.
|
i will try thx
Edite : the movment code dsnt work if i do that it works when i change mob/pc to player but the icons and some code are messed |
its allowing you move diagonal
mob |
Okay so the only people that can use MovementLoop() are your players. Why? It takes information from the keyboard to work.
mob/Player is the only place it should be. If you want movement for anything that isn't a player you must use something else. MovementLoop won't work with anything that isn't a player. |
you right but when i put it in
mob/player/login() it dsnt work and shold i add usr to while() in the movment()? |
Is this from a library or demo? It should include an example of how to use it. Basically it's not working because I don't think you've got the key macros.
Basically when you press a key, you want it to call a process that remembers the key. The library should tell you how to do this. If you don't have the keys setup, it won't do anything. |
its from demo and the readme dsnt explain much like i said if i change the mob/PC/login()
pc -> Player it works but the icons missin from the player and the login screen |
Okay I'm just going to say I can't help. I thought knew what you want but I can't understand you.
Sorry but maybe some one else can help you. |
i want to make the player to move diagonal
i have 2 login 1 . mob/Player/login() - when creating new char 2. mob/PC/login() - when login after the creation(PlayerChar) when i change the PC to Player it works but when i do that ther some bugs all i need xD is moving diagonaly for the players not only up , down , left ,and right can you help me do this ? |
Players should be able to move diagonally already in BYOND (though, by default, it is using the numpad).
If you see the interface's macro file, you can see they are already defined as .northeast, etc. Simply define new diagonal keys through the interface, no hacking needed since the demo you are using is likely pre-4.0 What is your objective using that (inefficient) snippet, making a combo system? ------------------- Edit: As people told you, you should place that spawn() under /mob/Player/Login() mob/Player/Login() The reason why it causes other issues to you is because you are NOT calling ..() which allows other instances (including the default action) of that proc. I think it makes more sense of have that under client/Move() but... w/e floats your boat. ------------------- Now, if you want ONLY the /mob/Player to use diagonals and NOT NPCs or other /mob types, that's different. You can do this by checking the directional bit flags atom/movable/Move(NewLoc,Dir=0,step_x=0,step_y=0) // Called when any /atom/movable objects (including /obj & /mob) attempts to move |
what i want is when i press with a character mob/PC(Player Character) when thers 3 for each Player
Up and Left it go to NorthWest and so on |
In response to CrazyDog
|
|
CrazyDog wrote:
when thers 3 for each Player No idea what you meant by that... And that snippet you posted already does that... Unless you put NORTH/SOUTH & EAST/WEST at the same sequence entry (e.g. NORTH, WEST, EAST, SOUTH). In that example, because how the snippet is, this is what it finds: key# -> (current X, current Y) key1 -> (0, 0) <-- Because SOUTH is present on key4, key1 is NORTH, it disallows you to set anything key2 -> (0,0) <-- Same scenario as above but this is because EAST is in key3 key3 & key4 -> (0,0) --- Now, if you did NORTH, SOUTH, EAST, EAST, it would do: key1 -> (0,0) key2 -> (0,0) key3 -> (EAST,0) // No WEST in any key key4 -> (EAST,0) --- And if you did (any combination) of NORTH, NORTH, EAST, EAST, you should be able to move NORTHEAST because there is no SOUTH or WEST entered. ----------------------------------------------------- Now, show us your snippet where you placed keySet()/keyDel() (not its definition but when the person presses the keys). What is your world.tick_lag set to? If the issue is that there's not enough time for the two keys (ex: you press UP, RIGHT and the person moves NORTH then EAST individually instead of NORTHEAST), try increasing your move_delay to give more time for entry. |
This is the first code its macro set + del and set keys
thos are the only 2 codes i have for diagonal movment client |