MegaGlest Forum

MegaGlest => Feature requests => Topic started by: titi_son on 27 April 2015, 16:36:00

Title: Produced Resources (probably also consumable resources with specific/0 damage)
Post by: titi_son on 27 April 2015, 16:36:00
I "invented"  ;D Produced Resources.

Produced Resources are resources you gain with time.
For example if you want to make a "Goldmine"-unit and want it to produce
one gold per second you can do that by using produced resources. Produced
Resources work like consumed resources (food),
but there are no consumers; only producers.

!I AM STILL NOT SURE IF THIS IS THE RIGHT WAY TO IMPLEMENT THIS!
Maybe we should only add resource reqs for skills. So you can give negative reqs of a resource to the stop skill of a unit.

pull request (https://github.com/MegaGlest/megaglest-source/pull/64)

XML Syntax:
Code: [Select]
<?xml version="1.0" standalone="no"?>

<resource>
<image path="images/iron.bmp"/>
<type value="produced">
<interval value="30"/>
</type>
</resource>

I will add another aspect to this pull request (or make a new for this) if you want. These would be consumables with specific or zero damage (like in gae (https://docs.megaglest.org/XML/Resource))
It would be fairly easy to implement so tell me if you like the idea. For example for oil production; cars would consume the produced oil but will not die if oil is empty (they could still drive of course which would be strange but nevermind  :P)
Title: Re: Produced Resources (probably also consumable resources with specific/0 damage)
Post by: kagu on 27 April 2015, 17:49:39
This looks great, you probably should add, "amount" so it will give that amount of resource on given interval.
Title: Re: Produced Resources (probably also consumable resources with specific/0 damage)
Post by: titi_son on 27 April 2015, 17:58:39
You know how food works, don't you?
This works the same way. You just need to give a building negative reqs of that resource.
For example a goldmine has reqs:
wood: 100
stone: 200
gold: -10

this will produce 10 gold per interval
Title: Re: Produced Resources (probably also consumable resources with specific/0 damage)
Post by: kagu on 27 April 2015, 18:12:14
Ah, I got it, I thought you wanted to make it rally like "gold-mine", where it produces gold all the time.
Title: Re: Produced Resources (probably also consumable resources with specific/0 damage)
Post by: titi_son on 2 May 2015, 17:53:08
NEED TO CHECK SOMETHING!

don't accept pull request yet to avoid a bug which may occur

*fixed*