Author Topic: Produced Resources (probably also consumable resources with specific/0 damage)  (Read 1392 times)

titi_son

  • Draco Rider
  • *****
  • Posts: 284
  • titi_son
    • View Profile
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

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)
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)
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

kagu

  • Administrator
  • Horseman
  • ********
  • Posts: 203
    • View Profile
This looks great, you probably should add, "amount" so it will give that amount of resource on given interval.
Megaglest Chat
Please support:
1. CEGUI 2. In-process games 3. Registered Players
Playtime:
Every Sunday 21:00 - 01:00 CET

titi_son

  • Draco Rider
  • *****
  • Posts: 284
  • titi_son
    • View Profile
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
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

kagu

  • Administrator
  • Horseman
  • ********
  • Posts: 203
    • View Profile
Ah, I got it, I thought you wanted to make it rally like "gold-mine", where it produces gold all the time.
Megaglest Chat
Please support:
1. CEGUI 2. In-process games 3. Registered Players
Playtime:
Every Sunday 21:00 - 01:00 CET

titi_son

  • Draco Rider
  • *****
  • Posts: 284
  • titi_son
    • View Profile
NEED TO CHECK SOMETHING!

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

*fixed*
« Last Edit: 11 May 2015, 14:38:56 by titi_son »
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.