Monster-Generating Eggs
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Monster-Generating Eggs
Another coder's corner question : )
How do exactly the eggs that generates monsters (and, in general, eggs which trigger a certain event once they are on screen)?
For example, if I trigger the event as the egg gets on screen, and thereafter I disable that egg, there's the chance that by walking all around it, I could trigger it lots of times. For example, if it's an egg that generates a bunch of sheeps, by walking around it, it could generate more and more sheeps before the previously generated ones are deallocated because of their distance from the party.
Maybe you keep a list of the triggered eggs, and re-enable them only when you get *very* far from the original egg position?
How do exactly the eggs that generates monsters (and, in general, eggs which trigger a certain event once they are on screen)?
For example, if I trigger the event as the egg gets on screen, and thereafter I disable that egg, there's the chance that by walking all around it, I could trigger it lots of times. For example, if it's an egg that generates a bunch of sheeps, by walking around it, it could generate more and more sheeps before the previously generated ones are deallocated because of their distance from the party.
Maybe you keep a list of the triggered eggs, and re-enable them only when you get *very* far from the original egg position?
-
- Posts: 1241
- Joined: Thu May 14, 2020 1:34 pm
Re: Monster-Generating Eggs
My quick fix:
Put "auto-reset" and the distance to a respectable factor. Make sure that it's a "Party Near" egg and not an "Avatar footpad" egg
~ Wizardry Dragon
Put "auto-reset" and the distance to a respectable factor. Make sure that it's a "Party Near" egg and not an "Avatar footpad" egg
~ Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Re: Monster-Generating Eggs
Heh, no no I am not working with exultstudio. It's a from-scratch project. So I am talking of real code here
-
- Posts: 1241
- Joined: Thu May 14, 2020 1:34 pm
Re: Monster-Generating Eggs
They're egg props, it's just a lot easier to set them from ExultStudio.
~ Wizardry Dragon
~ Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Re: Monster-Generating Eggs
In U8, a monster egg has a 'hatched' flag. If you trigger the egg, it gets set. Then, when you get far enough away, it gets cleared again.
-
- Posts: 1241
- Joined: Thu May 14, 2020 1:34 pm
Re: Monster-Generating Eggs
That's auto-reset, it's a default (I believe). You set how far away you have to go before it resets with the "distance" property.
~ Wizardry Dragon
~ Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Re: Monster-Generating Eggs
They also work that way (as wjp described) in U7. Also, the distance where the egg gets reset is also the distance where monsters created by the egg also disappear (they're 'cached out' in the term Ryan used when he implemented this).
-
- Posts: 1241
- Joined: Thu May 14, 2020 1:34 pm
Re: Monster-Generating Eggs
I believe I heard that the monster persists if you use the once-only flag, but I am unsure as I havent tested it myself.
~ Wizardry Dragon
~ Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Re: Monster-Generating Eggs
It's all a matter of distances, then. One must be careful that the egg scatters monsters a bit far away too. At least *a screen* away, to be sure that they will be created offscreen, preventing the "appearing from nothing" effect.
That, obviously, only for monsters and other visual things. Music, weather, they can just be triggered.
That, obviously, only for monsters and other visual things. Music, weather, they can just be triggered.
-
- Posts: 1241
- Joined: Thu May 14, 2020 1:34 pm
Re: Monster-Generating Eggs
Yeah, although I wouldnt want music for a town when I'm still miles away from it
~ Wizardry Dragon
~ Wizardry Dragon
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca