Deactivating daemons

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Ice Cream Jonsey
Posts: 30175
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Deactivating daemons

Post by Ice Cream Jonsey »

Are we supposed to be deactivating daemons when they are done?

It just occurred to me that maybe AHH they don't on their own when they are finished. Which means all the ones I fire will just keep executing and then things get weird once we get past turn 32767.
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 2255
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Re: Deactivating daemons

Post by Roody_Yogurt »

Fuses will deactivate themselves once the timer reaches 0, but yes, non-fuse daemons should manually be deactivated when not in use. I mean, I don't think it'll break your game or anything, but yeah, it will just keep running the daemon code indefinitely unless you stop it.

User avatar
Ice Cream Jonsey
Posts: 30175
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: Deactivating daemons

Post by Ice Cream Jonsey »

Well. Nobody try to make 32,000 moves in my games then.

Would you say that the last case of each daemon should be a Deactivate(self)? It seems like that would be fine, having the daemon deactivate its own self? I hope?
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 2255
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Re: Deactivating daemons

Post by Roody_Yogurt »

That should work. Here is some code from Spur that does it:

Code: Select all

daemon sarahroad_daemon                 ! waiting for you
{}

event sarahroad_daemon
{
	"\n\"I'm glad you made it,\" Sarah says as she climbs down from 
	her horse."
	move sarah to location
	Activate(sarahfollow_daemon)
	Deactivate(self)
}

User avatar
Ice Cream Jonsey
Posts: 30175
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: Deactivating daemons

Post by Ice Cream Jonsey »

Thanks Roody!
the dark and gritty...Ice Cream Jonsey!

Post Reply