ID:273367
 
I feel embarrassed, asking what seems to me which is a noob question. Basically what I want is to be able to stop a proc at any moment. For example maybe have a proc-A that takes about 10 seconds to execute because of sleep delays and have proc-B that is able to stop proc-A at any moment.
This is set up so that you can change the variable to stop the action with a verb. You don't need procs to stop procs, just stop an action or never start an action by using If statements.


mob/var/cyanide_poison = 0
mob/var/HP = 100
mob
proc
poisoned()
if(src.cyanide_poison == 1)
src.HP--
sleep(20)


proc
Hpdetector()
if(src.HP == 0)
Del()

mob/verb/Drink_Miracle_Antitode
if(src.cyanide_poison == 1)
src.cyanide_poison = 0
else
return
In response to Darkjohn66
No, seriously, stop providing examples. Your examples are bad. Newbies learning from newbies is bad.
One way is to just have the proc you want to be stopped check some variable before it does anything, every time. You can then set that variable to the "kill" value to effectively stop the proc.

If you're talking about the rare instance where a proc MUST stop, not just not do anything more, then the only way to forcibly stop a proc is to delete the object it belongs to (unless you screw around with the src variable, which you shouldn't).