When a proc spawns off a child proc, is there a way for the parent to reference this new proc and kill it prematurely?
What I'm having in mind is a missile proc, which I may want to kill before it reaches it's final destination under certain conditions.
But it would be nice to have references to spawned procs in general, for other curious things.
ID:162815
Nov 23 2007, 2:04 pm
|
|
Nov 23 2007, 2:11 pm
|
|
Spawn a while loop for the missile, checking if a certain variable("disabled?"), and if it's disabled, break it.
|
In response to Kaiochao2536
|
|
Kaiochao2536 wrote:
Spawn a while loop for the missile, checking if a certain variable("disabled?"), and if it's disabled, break it. missile() is a proc that comes with byond. I can't break it like that. |
In response to Obs
|
|
You said a missile proc, not the missile() proc.
And no, you can't do anything to interfere with the missile() proc. |
In response to Kaiochao2536
|
|
How about any spawned proc?
|
In response to Obs
|
|
Yes, inside the spawned proc.
|
In response to Kaiochao2536
|
|
Kaiochao2536 wrote:
Yes, inside the spawned proc. I was asking how to do it externally. What if a proc spawns and decides it's going to live forever? It has to be killed. |
In response to Obs
|
|
Then don't make while() statements without a variable argument.
|
In response to Kaiochao2536
|
|
That is not always the case. Actually never.
|
In response to Obs
|
|
Making while() statements with a variable argument allows it to stop when the variable is false. You can set the variable to false at any time.
|
In response to Kaiochao2536
|
|
The problem is I have a series of procs that simply stop working when another proc tries to hog most of the processing time. One proc constantly works on refreshing the player's client objects, the other is a recursive expanding algorithim. Both function just fine on their own.
But when you are trying to do both at once, the client object algorithim (which is set to be in the background) apparently stops working when the CPU goes under heavy load, and then it never starts back up again (the screen never refreshes for the player). It is also set to be a background proc. I wanted to know just what the hell was really wrong with them. Even calling for a hard reset, to clear the client screen of objects, doesn't work. It's like the proc just goes dead and freezes there. But I still see the CPU load go up to typical levels in times when that client proc is supposed to be running, which leads me to believe that the frozen proc is an older instance of the client proc that is overshadowing the actual working version of the proc. |
you could always have a conditional delete
stone deleting the object will break whatever its doing procedure-wise another thing you can do is put "stops" into the code that will make it break. you obviously can't do this with byond procedures because we cannot re-declare what they do. but you can write your own missle function, for example, and include a "break" within it myfunction(var/y) |