Author Topic: Spawn on death  (Read 822 times)

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Spawn on death
« 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.

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,070
  • um wat??
    • View Profile
    • DelphaDesign
Re: Spawn on death
« Reply #1 on: 8 October 2016, 06:06:53 »
I'd like to see this as well!
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,227
    • View Profile
    • http://www.titusgames.de
Re: Spawn on death
« Reply #2 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.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,227
    • View Profile
    • http://www.titusgames.de
Re: Spawn on death
« Reply #3 on: 20 November 2016, 15:19:32 »
A problem I see is that this syntax is not really the same as for spawn attacks.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Re: Spawn on death
« Reply #4 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?

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,227
    • View Profile
    • http://www.titusgames.de
Re: Spawn on death
« Reply #5 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 ?
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Re: Spawn on death
« Reply #6 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!

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,227
    • View Profile
    • http://www.titusgames.de
Re: Spawn on death
« Reply #7 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 )
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Re: Spawn on death
« Reply #8 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.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,227
    • View Profile
    • http://www.titusgames.de
Re: Spawn on death
« Reply #9 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".
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
Re: Spawn on death
« Reply #10 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

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Spawn on death
« Reply #11 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.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything