mob/verb/Test()
var/string = "Myproc"
string()
proc/Myproc()
world << "It worked"
Myproc() isn't being called when I do string(). I know why but can someone give me a way of calling Myproc() by doing string()?
ID:169394
![]() Jun 24 2005, 9:47 am
|
|
mob/verb/Test() Myproc() isn't being called when I do string(). I know why but can someone give me a way of calling Myproc() by doing string()? |
![]() Jun 24 2005, 9:48 am
|
|
Take a look at the call() proc.
|
I tried that before but I think it may be bugged.
mob/verb/Test() What I'm trying to do with the above is to display "1" to the world by using the verb. What the processes do is that they call a certain proc depending on the message I send(in this case "NewSword") in the verb, then the proc that is called should return 1 if it finds a certain item in a list or 0 if it doesn't. But what happens is that when it gets to call(string)(M), it starts running a random piece of coding. I've tried putting this snippet in two different games and in both it ran a random process(in one it ran a verb and in the other it ran a banning proc). |
It looks like you're trying to do something complicated with call() before mastering the basics. Try using a simple testbed for call() with just a basic string, not trying to add anything to it or any of that crap, and see where you can get with it.
Failing that, try just using proc references like /mob/proc/CheckNewSword. (This call() format requires you specify the src object, in this case the mob, followed by that proc reference; for global procs the src object is null.) In the end if you can get that to work you can still use your string addition, but you'll just have to use text2path() to do it. Lummox JR |
I tried:
mob/proc/Itack(thing) But to no success. It still calls some random piece of coding. |
DeathAwaitsU wrote:
I tried: > mob/proc/Itack(thing) But to no success. It still calls some random piece of coding. I'm guessing you don't actually mean "random" so much as "arbitrary". Which piece of code is being called? Lummox JR |
turf With the runtime error: runtime error: Cannot read null.mytable proc name: Entered (/turf/hchair/Entered) source file: Game.dm,19 usr: DeathAwaitsU (/mob/Player) src: null call stack: Entered(DeathAwaitsU (/mob/Player)) Itack("NewSword", DeathAwaitsU (/mob/Player)) DeathAwaitsU (/mob/Player): Teststs() |