ID:142518
 
I am trying to create a code that will shoot arrows problem is that the arrows aren't being created.Here is the verb (yes i know that it is missing important things it is to see if it will work.)
mob/verb
Shoot_Arrow()
var/mob/A=new /mob/arrow
walk(A,usr.dir)




mob
Battle
verb
shootarrow()
var/obj/H = new/obj/projectile/arrow
set category = "Battle"
if(usr.doing == 0)
usr.doing = 1
usr.icon = 'arrow.dmi'
usr.icon_state = "arrow"
usr.movable = 0
spawn(15)
del(H)
usr.doing = 0
H.dir = usr.dir
H.loc = usr.loc
while(H)
step(H,H.dir)
var/turf/T = H.loc
if(T.density == 1)
del(H)
break
for(var/mob/M as mob in T) //for and M in that turf
if(M == usr)
continue
usr<<output("You shot [M]!","Battle") //says you shot M
M.hp -= 50
usr.DeathCheck()
usr.racecheck()
del(H)
sleep(1)
else
usr<<"???????????"
obj/projectile
arrow
icon = 'arrow.dmi'
icon_state = "arrow"
mob/Battle/verb
shootarrow()
set category="Battle"
arrow()

that might work im not sure though so you can test it if you want =\
In response to SadoSoldier
people, DM tags exist for a reason.
In response to Eternal Desire
ima lazy bum who forgets the dm tags -.- its not like im required to besides if he needs help and that code does work he shouldnt care besides that im not helping you so dm tags for you werent needed unless you were testing the my code otherwise stealing it or seeing if it works either way i said i didnt know if it worked or not because im too busy to really try
In response to SadoSoldier
Firstly, no, it won't compile. If you're not going to even make sure your code works than don't post your "help". Your "help" will just make things worse. I'd suggest you not post "help" for a good long freaking while.
In response to Popisfizzy
help is not defined as giving a solution help is defined as pushing in the right direction and thats more of a code then he has with some major points he needs. look it up. even though it doesnt compile all he needs to do is adjust it.
And lastly NEVER TELL ME WHAT TO DO OR NOT TO DO. luckly for you im on the forum. im done posting back goodbye.
In response to SadoSoldier
Looking at that i can tell that it would never compile.
All i really need to know is why the icon will not appear.
In response to SadoSoldier
SadoSoldier wrote:
ima lazy bum who forgets the dm tags -.- its not like im required to besides if he needs help and that code does work he shouldnt care besides that im not helping you so dm tags for you werent needed unless you were testing the my code otherwise stealing it or seeing if it works either way i said i didnt know if it worked or not because im too busy to really try

some people try out examples in the compiler.

if everyone thought like you, the precious line would be null.
and i highly doubt your -THAT- busy. you dont seem to have a job, so yeah.
In response to Riku411811
because you never set it to... i showed you that in the part of the code that did work and the only reason that it doesnt is because i took one of my existing codes and deleted the unneccesary parts to show the major points use the projectile parts of it
In response to Eternal Desire
Actually i do have a job. A REAL job not some fake one. And since appererently people seem to think that i lack the abilities to code the game i was making im putting it on hold and working on an easier one. Don't define a person you've never met.
In response to SadoSoldier
yeah, found it thanks.Sorry for wasting your time
In response to SadoSoldier
Thing is, your help doesn't help. It hurts. Don't post code that makes the situation worse. That should be obvious, but if I have to point it out I will:

Do not post anymore help until you are better, which, by looking at that code, will be a while.
In response to Riku411811
I wouldnt of posted at all if i didnt care that the person i was helping was wasting my time its the other people that bugs me. Good for you that you found your problem bye.
In response to SadoSoldier
SadoSoldier wrote:
Actually i do have a job. A REAL job not some fake one. And since appererently people seem to think that i lack the abilities to code the game i was making im putting it on hold and working on an easier one. Don't define a person you've never met.
haha. i'm sure you do.

if you really had a job you'd know what goes where. hint hint, DM tags? and also, spelling doesnt take aslong as you think it does.

it takes like two seconds to put

//code here
In response to Eternal Desire
Cutting down a few seconds leaves space for things you might have to do that you dont know about. And i didnt say my job had anything to do with a computer.
In response to Popisfizzy
If you understand codes you can see the major points if you don't then maybe YOUR the one who needs to go study -.-
and i really wont care if its decided everyone thinks im the worst coder ever if i even think i can help at all im going to post so before you underestimate something or someone next time GET A GRIP ON REALITY noones perfect ESPECIALLY NOT YOU. and no im not saying im perfect either but you need to get over yourself and figure out hey maybe hes right if i look at it this way -.- FIGURE IT OUT
In response to SadoSoldier
SadoSoldier wrote:
If you understand codes you can see the major points if you don't then maybe YOUR the one who needs to go study -.-

When helping someone, though, you can't expect the help to be contingent on whether or not everything you do can be understood. Hence, explanations go a long way. The person needs help because they don't understand something; giving them more mess just makes the situation worse in most cases.

Hiead
In response to SadoSoldier
SadoSoldier wrote:
If you understand codes you can see the major points if you don't then maybe YOUR the one who needs to go study -.-

The first evidence that you don't know what you're talking about is the fact that you call a snippet of code "codes". It's indicative of the fundamentally incorrect belief that code is just copy-and-paste and able to work. It's like thinking there is only a select set of sentences one can use to write a novel. There are a plethora of different ways to do a single thing, and how you do that depends on the situation. It depends on what you require and how your other code works.

and i really wont care if its decided everyone thinks im the worst coder ever if i even think i can help at all im going to post

Well, that's ashame. Did you know someone got banned before for consistently posting crappy "help"? There is a precedenet, and if you feel your unhelpful help is worth posting, despite the fact that you're being detrimental to the whole thing, then continue to do what you are doing. You've been warned, as the guy that was banned was before your time here.

[Edit]

In fact, here is the post where he was banned.
In response to SadoSoldier
If you're that damn pressed for time then you shouldn't even be posting here.

Take two seconds to make yourself understood or get out.
Well, I see SadoSoldier has managed to hijack this thread with a horrible block of code, so I'll solve your problem:

You are never placing the arrow on the map. In order to do that, you either need to do A.loc = usr.loc, or alternatively, pass usr.loc as an argument to new():

var/mob/A = new /mob/arrow(usr.loc)


That can be shortened by making the variable A of type /mob/arrow:

var/mob/arrow/A = new(usr.loc)


Additionally, arrows should probably be objs, not mobs.
Page: 1 2 3