Author Topic: producable resources and more ...  (Read 896 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
producable resources and more ...
« on: 30 March 2012, 23:54:57 »
Hi, I added 3 new optional switches to unit.xml ( its in svn now ):

"count-unit-death-in-stats"
"count-unit-production-in-stats"
"count-unit-kill-in-stats"
update:
"count-kill-for-unit-upgrade"

This is meant for units which are for example just projectiles ( fo attack spawned units ) or to finally make resource production work.

How to do resource production now:

In general its done with an unvisibal unit, but this units is instantly killed after it is born ...

1. define a resource like this:
Code: [Select]
<resource>
<image path="images/housing.bmp"/>
<type value="static">
<recoup_cost value="false"/>
</type>
</resource>

( "recoup_cost value="false"" will keep the resource if the unit dies. )

2. build an "unvisible" unit with an empty model.
In this unit set:
- set a cellmap "0"
- set <max-hp value="10" regeneration="-10"/>  ( by this the unit instantly dies after its produced, and you hear its death sound ... )
- set <count-unit-death-in-stats value="false"/>
- set <count-unit-production-in-stats value="false"/>

 
« Last Edit: 31 March 2012, 10:14:54 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: producable resources and more ...
« Reply #1 on: 31 March 2012, 01:02:30 »
This is awsome! Great for annex scouts and special skills thank you!
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

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: producable resources and more ...
« Reply #2 on: 31 March 2012, 04:22:34 »
What is their parent tag in the unit XML? <parameters>?
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: producable resources and more ...
« Reply #3 on: 31 March 2012, 10:16:17 »
I added a new switch "count-kill-for-unit-upgrade"
If a unit has set this switch to false , killing it does not count up the number of kills of the attacking unit.

@Omega: yes its in Parameters
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

 

anything