MegaGlest Forum

MegaGlest => Feature requests => Topic started by: MirceaKitsune on 5 October 2016, 22:36:55

Title: Spawn on death
Post by: MirceaKitsune on 5 October 2016, 22:36:55
Another basic feature I would like to suggest, which I also plan to use personally. Would it be possible to let units spawn other units upon death please? I'm imagining a definition among the lines of:

Code: [Select]
<spawn-on-deaths>
<spawn-on-death>
<unit type="my-unit"/>
<count value="5"/>
<health value="25%"/>
<probability value="50%"/>
</spawn-on-death>
</spawn-on-deaths>

This would allow useful mechanics such as: A technician emerging out of every catapult / ballista / battle machine that's destroyed (the operator walks out of the wrecked device), drake riders turning into summoners (implying the drake died but the rider survived), workers emerging from castles that have crumbled, and more types of logical unit conversions.
Title: Re: Spawn on death
Post by: Ishmaru on 8 October 2016, 06:06:53
I'd like to see this as well!
Title: Re: Spawn on death
Post by: titi on 20 November 2016, 14:54:13
I made something like this now, is this good enough ?

Code: [Select]
<skill>
<type value="die"/>
<name value="die_skill"/>
<ep-cost value="0"/>
<speed value="120"/>
<anim-speed value="120"/>
<animation path="models/catapult_dying.g3d"/>
<sound enabled="true" start-time="0.1">
<sound-file path="$COMMONDATAPATH/sounds/catapult_die1.wav"/>
<sound-file path="$COMMONDATAPATH/sounds/catapult_die2.wav"/>
<sound-file path="$COMMONDATAPATH/sounds/catapult_die3.wav"/>
</sound>
<fade value="false"/>
<spawn start-time="0.1">
<unit value="catapult"/>
<amount value="1"/>
<health-percent min="80" max="100"/>
<probability value="100"/>
</spawn>
</skill>

And I think units created this way should not count in the stats as "created units". I removed this from the attackSpawn too.
Title: Re: Spawn on death
Post by: titi on 20 November 2016, 15:19:32
A problem I see is that this syntax is not really the same as for spawn attacks.
Title: Re: Spawn on death
Post by: MirceaKitsune on 20 November 2016, 15:41:22
Thank you titi! I shall definitely try it later, once I get back into working on MG. The syntax looks good, just two questions: What is start-time, and can you define multiple unit type spawns?
Title: Re: Spawn on death
Post by: titi on 21 November 2016, 10:41:38
Start time is the moment based ont he death animation when the unit spawns. By this you can get a better timing to let the technician "exit" the catapult for example.

You cannot let spawn differrent types of units on death like this, you can just set teh number of spawned units. Multiple types ( like your syntax suggested ) was a bit more complicated and I skipped it. Do you really think its needed ?
Title: Re: Spawn on death
Post by: MirceaKitsune on 21 November 2016, 12:54:22
Start time is the moment based ont he death animation when the unit spawns. By this you can get a better timing to let the technician "exit" the catapult for example.

You cannot let spawn differrent types of units on death like this, you can just set teh number of spawned units. Multiple types ( like your syntax suggested ) was a bit more complicated and I skipped it. Do you really think its needed ?

That makes sense and is a good idea! And nah: I don't see myself using multiple types of unit spawns per death, and mostly suggested that for completion. The important feature exists, and I definitely cannot complain!
Title: Re: Spawn on death
Post by: titi on 21 November 2016, 14:45:44
Another thing my son sugested is sadly not possible at the moment as the information is missing:
A "spawn at enemy" like its possible for attack spawns.  So if a unit A is killed by a unit B the spawned units surround unit B. This would be nice, but is not possible. I think I leave it like it is for the moment.

( btw you can try things by either building for yourself https://docs.megaglest.org/MG/Development or more simply get the data and binaries from here: http://snapshots.megaglest.org )
Title: Re: Spawn on death
Post by: MirceaKitsune on 21 November 2016, 18:20:01
Another thing my son sugested is sadly not possible at the moment as the information is missing:
A "spawn at enemy" like its possible for attack spawns.  So if a unit A is killed by a unit B the spawned units surround unit B. This would be nice, but is not possible. I think I leave it like it is for the moment.

( btw you can try things by either building for yourself https://docs.megaglest.org/MG/Development or more simply get the data and binaries from here: http://snapshots.megaglest.org )

I can see the use in that, even if it doesn't feel quite as important as simple spawning on death (at the location of the victim). And I always build Megaglest from GIT, so if the feature is in master I should have no problem trying it.
Title: Re: Spawn on death
Post by: titi on 25 November 2016, 13:10:51
New features are never in master as this is our release branch. To try new things always use branch "develop".
Title: Re: Spawn on death
Post by: MirceaKitsune on 25 November 2016, 16:35:16
New features are never in master as this is our release branch. To try new things always use branch "develop".

Ah... I remember now, and I think I am on the "develop" branch. For most GIT repositories the experimental branch is always "master", so my brain is set to assuming that :P
Title: Re: Spawn on death
Post by: Omega on 27 November 2016, 19:53:47
For most GIT repositories the experimental branch is always "master", so my brain is set to assuming that :P
They're totally doing it wrong then, haha. The consensus I've seen among developers is that master should reflect production.