Page 1 of 1
Monster-Generating Eggs
Posted: Tue Jul 22, 2003 2:06 am
by Andrea B Previtera
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?
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 5:26 am
by Wizardry Dragon
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
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 6:38 am
by Andrea B Previtera
Heh, no no I am not working with exultstudio. It's a from-scratch project. So I am talking of real code here
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 6:49 am
by Wizardry Dragon
They're egg props, it's just a lot easier to set them from ExultStudio.
~ Wizardry Dragon
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 8:09 am
by wjp
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.
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 8:23 am
by Wizardry Dragon
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
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 10:31 am
by drcode
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).
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 10:37 am
by Wizardry Dragon
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
Re: Monster-Generating Eggs
Posted: Tue Jul 22, 2003 10:21 pm
by Andrea B Previtera
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.
Re: Monster-Generating Eggs
Posted: Wed Jul 23, 2003 8:32 am
by Wizardry Dragon
Yeah, although I wouldnt want music for a town when I'm still miles away from it
~ Wizardry Dragon