Author Topic: resource produced over time but consumed instantly  (Read 1360 times)

Y

  • Swordman
  • *
  • Posts: 13
    • View Profile
resource produced over time but consumed instantly
« on: 21 August 2016, 22:02:12 »
Hi!

I have a question:
Can I create a building that produces a certain resource over time, as consumable resources, but that is consumed instantly, as static/tech/tileset resources?

Like having a building named mine producing iron, 10 per minute for example, but if I builded a unit that costs 100 iron, they are removed from the iron stock and not changing the flow to -90 iron/minute (as does food in Megapack).

I have unfortunately not found an answer on the forum, I missed a post on this?

Thanks!
« Last Edit: 22 August 2016, 09:06:26 by Y »

Golkombie

  • Battlemage
  • **
  • Posts: 42
    • View Profile
Re: resource produced over time but consumed instantly
« Reply #1 on: 21 August 2016, 22:04:01 »
There isn't a building like this, but it is a valid idea for late game play.
To be honest, I'm just honest..

Y

  • Swordman
  • *
  • Posts: 13
    • View Profile
Re: resource produced over time but consumed instantly
« Reply #2 on: 7 September 2016, 07:20:05 »
I rephrase my question:

Is it possible to spend the stock of a consumable resource without changing the flow?

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: resource produced over time but consumed instantly
« Reply #3 on: 7 September 2016, 09:22:52 »
So you want something that produces non consumable resources ?

Update:
Sadly there is nothing told in the wiki about it, but as far as I remember something like this was done in some mods.
You can look at the military mod ( mod center ) which uses a pump to get Oil. And the there is one of the VBROS mods which uses a pond which poduces "fish".
Maybe not exactly what you want but amybe it helps. BTW if this is not implemented yet and is needed write a feature request here in the forum. ( please detailed with a possible xml example)
« Last Edit: 7 September 2016, 09:33:21 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Y

  • Swordman
  • *
  • Posts: 13
    • View Profile
Re: resource produced over time but consumed instantly
« Reply #4 on: 7 September 2016, 09:31:02 »
Precisely the opposite!

I want a resource that is produced and stock over time as food, but that I can spend as wood / stone / gold.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: resource produced over time but consumed instantly
« Reply #5 on: 7 September 2016, 09:34:32 »
Gold stone wood are non consumable resources, so we talk about the same :)
( btw see my update above )

And if you find out how to do it, PLEASE update the wiki!
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Y

  • Swordman
  • *
  • Posts: 13
    • View Profile
Re: resource produced over time but consumed instantly
« Reply #6 on: 7 September 2016, 09:51:30 »
haha yeah I just understand your point of view.
That's it, I want a resource that is produced as a consumable, but that spend as a normal, hence the ambiguity :)

Ok, I'll watch the military mod, the oil resource seems to be a perfect example of what I wish!

Thanks!

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: resource produced over time but consumed instantly
« Reply #7 on: 7 September 2016, 22:47:04 »
Ok, that doesn't really work in enemy and allies .....

BUT:
My son already implemented this but its still a pull request at the moment: https://github.com/MegaGlest/megaglest-source/pull/64

As Resource it uses "produced" instead of static.
Syntax would be like this:
Code: [Select]
<resource>
<image path="images/housing.bmp"/>
<type value="produced">
<interval value="1"/>
</type>
</resource>

Would this be useful for you?
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: resource produced over time but consumed instantly
« Reply #8 on: 7 September 2016, 23:06:07 »
The current pull request does not fully work as expected, but we are working on it now.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Y

  • Swordman
  • *
  • Posts: 13
    • View Profile
Re: resource produced over time but consumed instantly
« Reply #9 on: 8 September 2016, 10:19:25 »
Ok, cool :) !

Because I think that such resources is quite common in games.

I'm working on a custom factions editor, and I imagine factions having specific resources, where you can build a custom production building, like a pump for modern factions, or farm for medieval factions.
Each faction choosing the name of the resource (and its image), and the name of the production building (and its 3d model).