ID:1910503
 
(See the best response by Misticone.)
I'm trying to make it so that I can move and shoot simultaneously but I can't get it to work. I got an input controller from a library but it still didn't fix the issue.
mob
var/tmp/list/DKeys = list()
var/tmp/list/Keys = list()

Login()
..()
winset(client, "north", "parent=macro;name=north;command=keydown+north")
winset(client, "north+up", "parent=macro;name=north+up;command=keyup+north")

winset(client, "west", "parent=macro;name=west;command=keydown+west")
winset(client, "west+up", "parent=macro;name=west+up;command=keyup+west")

winset(client, "south", "parent=macro;name=south;command=keydown+south")
winset(client, "south+up", "parent=macro;name=south+up;command=keyup+south")

winset(client, "east", "parent=macro;name=east;command=keydown+east")
winset(client, "east+up", "parent=macro;name=east+up;command=keyup+east")

winset(client, "T", "parent=macro;name=T;command=keydown+Shoot")
winset(client, "T+up", "parent=macro;name=T+up;command=keyup+Shoot")

spawn move_loop()
spawn skill_loop()

proc/move_loop()
set instant = 1
if(KB || Actives["Gathering"] || Actives["Meditate"] || Actives["Train"] || Talking)
goto restart
if(world.time >= move_time)
if(!step(src, (DKeys["South"] && (SOUTH || DKeys["South"])) | (DKeys["North"] && (NORTH || DKeys["North"])) | (DKeys["West"] && (WEST || DKeys["West"])) | (DKeys["East"] && (EAST || DKeys["East"]))))
if(!step(src, (DKeys["South"] && (SOUTH || DKeys["South"])) | (DKeys["North"] && (NORTH || DKeys["North"]))))
step(src, (DKeys["West"] && (WEST || DKeys["West"])) | (DKeys["East"] && (EAST || DKeys["East"])))
restart
spawn(world.tick_lag) move_loop()

proc/skill_loop()
set instant = 1
if(Keys["Shoot"])
Shoot()
spawn(world.tick_lag) skill_loop()

verb/keydown(k as text)
set hidden = 1
set instant = 1
if(k == "north") DKeys["North"] = 1
if(k == "west") DKeys["West"] = 1
if(k == "south") DKeys["South"] = 1
if(k == "east") DKeys["East"] = 1

if(k == "Shoot") Keys["Shoot"] = 1

verb/keyup(k as text)
set hidden = 1
set instant = 1
if(k == "north") DKeys["North"] = 0
if(k == "west") DKeys["West"] = 0
if(k == "south") DKeys["South"] = 0
if(k == "east") DKeys["East"] = 0

if(k == "Shoot") Keys["Shoot"] = 0


When I try to use them both at the same time my character stops, shoots and then moves. What am I doing wrong here?
Check your last line of code, you forgot a quote.
if(k == "Shoot") Keys[Shoot"] = 0
Should be like this:
if(k == "Shoot") Keys["Shoot"] = 0

EDIT:
Couldn't u just do something like this:
you could check in the player's movement built-in proc if the Shoot key is pressed. If it is then the player shoots
mob/Player/Move()
if(Keys["Shoot"] == 1) //Checks if the key is pressed
src<<"PewPew" //Shoot proc here
..() //Moves the client


You shouldn't be using goto and perhaps you would want to make the keydown/keyup procs instead of verbs (but that is my personal opinion, there is no problem leaving them as verbs I just think that it would be cleaner and more efficient)
Ah sorry about that, it IS if(k == "Shoot") Keys["Shoot"] = 0 in the code but I was editting around the names for the post and deleted the " by accident.
The player only shoots when walking if I do that and it didn't fix the issue.

Kay so I tested out a bunch of stuff and it seems like its the Cross proc I have for the bullet. Without it I can shoot and move, with it I stop and move. Any reason for that?

mob
var/tmp/list/DKeys = list()
var/tmp/list/Keys = list()

Login()
..()
winset(client, "north", "parent=macro;name=north;command=keydown+north")
winset(client, "north+up", "parent=macro;name=north+up;command=keyup+north")

winset(client, "west", "parent=macro;name=west;command=keydown+west")
winset(client, "west+up", "parent=macro;name=west+up;command=keyup+west")

winset(client, "south", "parent=macro;name=south;command=keydown+south")
winset(client, "south+up", "parent=macro;name=south+up;command=keyup+south")

winset(client, "east", "parent=macro;name=east;command=keydown+east")
winset(client, "east+up", "parent=macro;name=east+up;command=keyup+east")

winset(client, "T", "parent=macro;name=T;command=keydown+Shoot")
winset(client, "T+up", "parent=macro;name=T+up;command=keyup+Shoot")

spawn move_loop()
spawn skill_loop()

proc/move_loop()
set instant = 1
if(KB || Actives["Gathering"] || Actives["Meditate"] || Actives["Train"] || Talking)
goto restart
if(world.time >= move_time)
if(!step(src, (DKeys["South"] && (SOUTH || DKeys["South"])) | (DKeys["North"] && (NORTH || DKeys["North"])) | (DKeys["West"] && (WEST || DKeys["West"])) | (DKeys["East"] && (EAST || DKeys["East"]))))
if(!step(src, (DKeys["South"] && (SOUTH || DKeys["South"])) | (DKeys["North"] && (NORTH || DKeys["North"]))))
step(src, (DKeys["West"] && (WEST || DKeys["West"])) | (DKeys["East"] && (EAST || DKeys["East"])))
restart
spawn(world.tick_lag) move_loop()

proc/skill_loop()
set instant = 1
if(Keys["Shoot"])
Shoot()
spawn(world.tick_lag) skill_loop()

verb/keydown(k as text)
set hidden = 1
set instant = 1
if(k == "north") DKeys["North"] = 1
if(k == "west") DKeys["West"] = 1
if(k == "south") DKeys["South"] = 1
if(k == "east") DKeys["East"] = 1

if(k == "Shoot") Keys["Shoot"] = 1

verb/keyup(k as text)
set hidden = 1
set instant = 1
if(k == "north") DKeys["North"] = 0
if(k == "west") DKeys["West"] = 0
if(k == "south") DKeys["South"] = 0
if(k == "east") DKeys["East"] = 0

if(k == "Shoot") Keys["Shoot"] = 0

verb/Shoot()
new/obj/Bullet(src)


obj
Bullet
icon = 'DarkBlast(anti).dmi'

var/Damage
var/rawDamage = 1
var/mob/creator
var/Intensity = 1

New(mob/M)
..()
walk(src, M.dir)
creator = M.ID
spawn(40) del src


Cross(atom/A)
if(istype(A, /obj/Bullet))
var/obj/Bullet/O = A
if(O.creator == creator)
return 1
Your Cross proc doesn't make much sense to me...
let me see if I understand what you want to do:
Cross(atom/A) // THis gets the crossed atom
if(istype(A, /obj/Bullet)) //checks if the crossed atom is a bullet
var/obj/Bullet/O = A //associates the bullet to a variable
if(O.creator == creator) //Checks if the crossed atom(which is a bullet) creator is this bullet's creator
return 1


In this case the bullet will only overlap if both the bullet and the crossed atom are not dense.

What I suspect is happening is that your mob is colliding with the bullet while you are moving and since the mob and the bullet are dense atoms the overlap isn't allowed.

Replace your Cross proc with this

    Cross(var/mob/a)
world<<a.name


and tell me what the output is.
The Cross() lets only bullets of the same owner pass through each other, and nothing else can pass over them. This does imply that players bump into them. This is what you said, so how is it confusing? There is no need to replace it with a debug output; if anything, insert world << A to the top of Cross().
The Cross() lets only bullets of the same owner pass through each other, and nothing else can pass over them.This is what you said, so how is it confusing?

Yeah, but how would that happen if the bullets travel through space at the same velocity ? If the bullets' velocity is constant and the player isn't teleporting to a location in front of the bullet and then shoots his own bullet isn't that Cross proc check uselless?

This does imply that players bump into them.

Yup he should add this to his Cross proc:
if(istype(A,/mob/Player/m)) //If it crosses a player mob
if(m.ID == Creator) //and if that mob is yours
return 1 //Overlap is allowed


Bullet
Gluscap
Gluscap
Gluscap
Bullet
Bullet
Bullet
Gluscap
Gluscap
Gluscap
Bullet
Bullet
Bullet
Gluscap
Gluscap
Gluscap
Bullet
Bullet
Gluscap
Gluscap
Gluscap
Bullet
Bullet

And on and on and on. Though it still does stop movement. The reason I used cross is because the shoot verb is really fast, shooting multiple shots per second. Without cross, it only allows 1 per tile. With the cross proc multiple can be on one tile.
Best response
As I suspected. Replace your Cross proc with this:
Cross(atom/A) // THis gets the crossed atom
if(istype(A, /obj/Bullet)) //checks if the crossed atom is a bullet
var/obj/Bullet/O = A //associates the bullet to a variable
if(O.creator == creator) //Checks if the crossed atom(which is a bullet) creator is this bullet's creator
return 1
else
if(istype(A, /mob))
if(A.ID == creator)//If it bumps into your mob
return 1//Allows overlap
yes that works, thank you

although I can't walk south east or south west while using shoot, probably going to have to write the move_loop so it can do that