ID:145085
 
the proc for making it so you have to wait a second to cast again?
mob/EarthGod
verb
BoulderThrow()
set category="EarthGod"
var/obj/S=new/obj/GodBoulder
S.loc=(usr.loc)
S.damage=30
S.owner=usr
walk(S,usr.dir,2)
sleep(50)
***delay(10)***
LvlCheck(usr)
del S
return


Godstuff.dm:11:error:delay:undefined proc


Don't copy and paste. First you need to set a variable like "attacking" and then check for it. If it is true, then return. Also, about copying and pasting, if someone gives you advice, don't copy and paste it. Learn from it. Obviously you didn't learn from it or you'd know the error.
Use sleep or spawn. It's your choice.
In response to Justin B
I didn't copy and paste, and second of all, this is a spell and I want it so you cant simultaneously cast it.
In response to Sorcerb
Sorcerb wrote:
I didn't copy and paste, and second of all, this is a spell and I want it so you cant simultaneously cast it.

That's what Justin means, you have to attach a var so it could check when you "fired" your attack. Make something like an attacking var, so it will check when you click the verb, like so.

mob/EarthGod
verb
BoulderThrow()
set category="EarthGod"
if(usr.attacking==1)
usr<<"Can't attack right now."
else
var/obj/S=new/obj/GodBoulder
S.loc=(usr.loc)
S.damage=30
S.owner=usr
usr.attacking=1
walk(S,usr.dir,2)
sleep(50)
LvlCheck(usr)
del S
spawn(50) usr.attacking=0

I wouldn't copy and paste this code, you will probably get errors, and I wasn't sure if I coded it right, I just did that now to show you an example of what he means.

-- Vancegetto
In response to Vancegetto
That's still wrong, anyhow.

Boolean vars! And why the hell did you use spawn() at the end. :/

And as Lummox would add; "All those vars needs to be passed onto New()"
In response to Vancegetto
That looks even worse than my coding, you put in a random (spawn(5)) at the end.
In response to Mysame
If that's so wrong, then tell me how to fix it bigshot. :P
In response to Sorcerb
mob/EarthGod
verb
BoulderThrow()
set category="Earth God"
if(usr.attacking){usr<<"Can't attack right now.";return}
new/obj/GoldBoulder(usr.loc,30,usr)
usr.attacking=1
sleep(50)
usr.LvlCheck() // Who passes 'usr' as an argument? Really.
del(S)
usr.attacking=0

obj/GoldBoulder/New(location,damageitshoulddo,mob/owneritshouldhave)
loc=location // o.o;;
damage=damageitshoulddo // o.o!
owner=owneritshouldhave // ya rly
walk(src,owneritshouldhave.dir)
sleep(50);del(src)
In response to Mysame
That won't work...
In response to Sorcerb
It isn't random. You are just saying that because Mysame said that. He meant for it to be sleep(50)
In response to Justin B
No I'm not, if he's going to try to give advice, he should make it so it makes sense to the person that needs it, not to him, who already knows what he's thinking.
In response to Sorcerb
How so? :)
In response to Mysame
Don't use my phrases against me, that's not fair, you don't see me using your dumb ones.
In response to Sorcerb
What phrases against who, how is what not fair, what's dumb? You said; "That won' work", I responded. Seriously, now...
In response to Mysame
1) "How so?" That's what I say.

2)Because that's cheating.

3) Your phrases.

4) I'm telling you that coding is all wrong.
In response to Sorcerb
1) Freedom of speech?
2) Cheating? How so? Me saying something? C'mon now, stay off the weed.
3) If you have a comment on something, back it up with reason, little Jimmy.
4) Really? How so? :)
In response to Mysame
No freedom of speech.
Yes, that is cheating, you.
I have many reasons, I just don't want to tell you them.
Just cause. I already have all the coding for the boulder, so that will just mess it up.
In response to Sorcerb
4) I'm telling you that coding is all wrong.


i betcha 5 bucks that you don't even understand the code u posted. :O

In response to Shoe
Yes i do.
Page: 1 2 3 4