spawn(Delay=0) Statement
proc/Kill(mob/m) Statement?
ID:159432
Mar 13 2009, 6:32 pm
|
|
In response to Kaioken
|
|
mob/human kinda like that. *Edit* Well not quite but.. because for that you can call it afterwords... Okay leme just say what im trying to do. Im trying to make a custom spawn with different params, but the only problem is it cant add the statment part to it it thinks its a label. #define Spawn(x) MySpawn(x,30) that doesn't work it thinks Statement is a label |
In response to Tubutas
|
|
mob/human |
In response to Bakasensei
|
|
Yes i said thats how you could do it but thats not what i want :O. I need it so you can call a statement (like world<<1) at the end of the proc, and the statemnet is gonna be dynamic so there's no simulating it.
in that case... src.GrowOld() src<<"You've died old Man" once again don't get caught in the details, but thats kindoff what i want. |
In response to Tubutas
|
|
I'd be surprised if it thought it was anything else, seeing as you're using a nonexistent syntax there, so it just takes it as a random word (which it is, it's no special DM word) for a label name. DM does not work like this; you can't arbitrarily say Statement and expect it to work how you want - you can't even add new instructions that take blocks of code indented under them in the first place. Only special constructs can do that, not your own procs. There's not really a need for it, anyway. For one, you could use a #define in place of a direct spawn():
#define MySpawn(D,R) spawn(D*R/10)
|
In response to Kaioken
|
|
I've been going at it backwards!! wow that makes so much sense :O. Thanks.
|
This makes the GrowOld() proc return almost immediately whenever called, queuing up its main body code to run later. This is of course better to use than spawn()ing each and every call with procs that generally act as a process that takes time and there is no benefit in (or desire that) the proc caller waiting until that process finishes. You could use -1 as the spawn() delay if you wish the spawned code to execute as soon as possible. Misc note: some built-in DM instructions work in this same manner, for example walk() and flick().