Results 1 to 4 of 4

Thread: Editor help - self-regenerating resource

  1. #1

    Default Editor help - self-regenerating resource

    Hi guys, I wanted to make a resource that regenerates itself, sort of like how a unit with energy can regain energy over time...The problem is, the energy regeneration is 3 values dedicated to "energy" only, there isn't such a thing for other resources.

    Would there be a way to code such a thing?
    I've been doing some tests on high yield minerals, but so far, I can only get those to stay there even if they are depleted.

    I want to create a resource that can regenerate itself over time, like Tiberium in C&C3.

    Kudos to Arkceangel for the Terran avatar and sig!

  2. #2
    Junior Member
    Join Date
    Jun 2009
    Posts
    175

    Default Re: Editor help - self-regenerating resource

    Well, it can probably be done via the set unit property trigger (as minerals show up as a unit and resources is one of the options, though i have not tested it), you would just need to have the game look at the current min count and set it to that + whatever amount you want to have it regenerate by every X seconds.

    Other than that..... Well I'd bet you could get something done in the data editor via effects or behaviors, but that is bound to be a lot more difficult.

  3. #3
    gastrop0d's Avatar Junior Member
    Join Date
    Apr 2010
    Posts
    68

    Default Re: Editor help - self-regenerating resource

    Well if you want it to be like tiberium, you probably want minerals that have been mined into nothing to reappear and slowly replenish, right?

    You could do something like, record the positions of all the mineral fields at the start of the map in an array, then periodically check if each mineral field still exists. If not, create a new mineral field at the recorded position and give it a little bit of resources. Then just periodically add a little bit of resources to all mineral fields up to the max value you want.

  4. #4

    Default Re: Editor help - self-regenerating resource

    Thing is, I want to avoid the use of triggers as much as possible, all it will do is make the resource have a certain amount more, not necessarily regenerate its amount, like, say, a psionic unit recharges its power, or a Zerg unit its health, or a Protoss unit its shields.

    I'll try coding it in Universe maybe rather than using the editor, and use the Universe compiler from SC2Mapster to get the code into the game.

    Kudos to Arkceangel for the Terran avatar and sig!

Similar Threads

  1. [SC2] Galaxy Editor Resource Thread
    By Fyrinite in forum StarCraft Discussion
    Replies: 131
    Last Post: 11-16-2010, 03:59 PM
  2. Another Macro Idea : Special Resource (needs a name)
    By Santrega in forum StarCraft Discussion
    Replies: 51
    Last Post: 12-27-2009, 11:11 AM
  3. Should resource counter be moved near mini-map?
    By ArcherofAiur in forum StarCraft Discussion
    Replies: 93
    Last Post: 12-27-2009, 04:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •