Planet buff to give player non-credit resources.

So, basically I hate the resource asteroid mechanic and I'm curious if there is a way to design a planet buff that would give the owning player a steady income of resources in lieu of having orbital crystal and metal asteroids. I asked Lavo if he knew of a way to do it and he came up empty, so I figured I would ask here. I realize there are downsides to something like this, as it subverts several mechanics in the game, but at this point I'm mostly just curious if it's possible.

18,298 views 18 replies
Reply #1 Top

Yep it's possible. The buff you're looking for is below.

Just add your own resource amount and finish time.

TXT
entityType "Buff"
onReapplyDuplicateType "PrioritizeNewBuffs"
buffStackingLimitType "ForAllPlayers"
stackingLimit 1
allowFirstSpawnerToStack FALSE
buffExclusivityForAIType "ExclusiveForAllPlayers"
isInterruptable TRUE
isChannelling TRUE
numInstantActions 0
numPeriodicActions 0
numOverTimeActions 1
overTimeAction
buffOverTimeActionType "EarnResources"
earnRate
Level:0 0.000000
Level:1 0.000000
Level:2 0.000000
Level:3 0.000000
numEntityModifiers 0
numEntityBoolModifiers 0
numFinishConditions 2
finishCondition
finishConditionType "TimeElapsed"
time
Level:0 0.000000
Level:1 0.000000
Level:2 0.000000
Level:3 0.000000
finishCondition
finishConditionType "OwnerChanged"

Reply #2 Top

mostly is correct, though IIRC this buff structure gives you both crystal and metal. I do not think there is a way to only get one with abilities.

Reply #3 Top

You are correct, it ONLY gives metal AND crystal, tt isn't possible to give only one resource through the ability (which I think is the only way to give yourself resources aside from asteroids).  I made it an ability in 7DS that is attached to a structure.  You could esentially make a "Resource Factory" planet module, that has the above "give resources" buff, then make it have a single finish condition of "ownerchanged" so that when it gets blown up you stop getting the resources.

 

Reply #4 Top

That's exactly what I use it for. I've got a really expensive refinery structure that every so often gives a load of resources to the player. 

If you only want metal OR crystal I suppose you could make the ability cost a certain amount of crystal or metal and then match that value in the buff? That way the metal or crystal cost would cancel each other out and you'd end up with the other resource amount only. Not sure if there's a metal or crystal use ability cost though . :S

Reply #5 Top

Quoting mostly80, reply 4

That's exactly what I use it for. I've got a really expensive refinery structure that every so often gives a load of resources to the player. 

If you only want metal OR crystal I suppose you could make the ability cost a certain amount of crystal or metal and then match that value in the buff? That way the metal or crystal cost would cancel each other out and you'd end up with the other resource amount only. Not sure if there's a metal or crystal use ability cost though .
End of mostly80's quote

You could do that for an active ability, however it sounds like Unikraken wants a passive ability on a planet to generate resources. So you can't use resource costs to balance a passive ability.

Reply #6 Top

Quoting GoaFan77, reply 5


Quoting mostly80, reply 4
That's exactly what I use it for. I've got a really expensive refinery structure that every so often gives a load of resources to the player. 

If you only want metal OR crystal I suppose you could make the ability cost a certain amount of crystal or metal and then match that value in the buff? That way the metal or crystal cost would cancel each other out and you'd end up with the other resource amount only. Not sure if there's a metal or crystal use ability cost though .

You could do that for an active ability, however it sounds like Unikraken wants a passive ability on a planet to generate resources. So you can't use resource costs to balance a passive ability.
End of GoaFan77's quote

I thought about that but was stumped by the passiveness it seemed like Unikraken wanted and the what if scenario below:

Suppose your ability is supposed to gather metal (meaning that it costs crystal). What if the player doesn't have any crystal and therefore cannot use the ability designed with the sole intent of increasing metal over time, no questions asked. Well this player would be S.O.L. because they couldn't afford to cast the ability, at least not anyway I know of.

Reply #7 Top

How about using it as an active ability and using the autocast and use anytime? Give it a short time elapsed counter so it repeats itself on a regular basis. 

As for the point WOEaintME makes, you could make a passive ability on your starting planet that gives both resources. That way you'd have a steady stream of all resources and would never end up in the vicious spiral where you didn't have enough resources to cast the ability but then had no way of gaining those resources. That would also add vital tactical importance to defending your home world!

Reply #8 Top

Quoting mostly80, reply 7

How about using it as an active ability and using the autocast and use anytime? Give it a short time elapsed counter so it repeats itself on a regular basis. 

As for the point WOEaintME makes, you could make a passive ability on your starting planet that gives both resources. That way you'd have a steady stream of all resources and would never end up in the vicious spiral where you didn't have enough resources to cast the ability but then had no way of gaining those resources. That would also add vital tactical importance to defending your home world!
End of mostly80's quote

But you can't give planets active abilities, they must be passive, defeating the point if the goal is to get rid of resource extractors and have planets generate resources directly. Thus it only makes sense to do it if you want both resources to be generated.

Reply #9 Top

Have you thought about digging into the new DLC resource focus planetary upgrade. Though that would still cause the problem of And not or, unless you had it increase off existing resource asteroids in orbit. Like income based on income sort of thing. Though that's just a theory I jsut made this up after reading the forum post, I have no idea where to begin with this

Reply #10 Top

In ResourceAsteroidCrystal and ResourceAsteroidMetal, your solution is in these two lines.

nearPlacementDistOffset 0.000000
farPlacementDistOffset 9000.000000

 

Just place them outside the move area and make them invisible/invincible.

 

Spawn the mines and switch already existing mines ownership, all from the colonization ability, you've got the IsResourceExtractor constraint to make it simplistic to do.

 

You've now got "mines" that don't visibly or tactically exist, that take care of their own existence independent of your actions, can be custom tailored for diversity in planet revenues, and be altered via resource impacting abilities.  A much better solution than a resource income ability.

Reply #11 Top

That's a good idea psychoak, but doesn't it make invading enemy ships try and attack the invisible asteroids, do they not get preoccupied with trying to destroy invincible objects Outside the gravity well? Haven't had a chance to try it out.

 

Reply #12 Top

Quoting mostly80, reply 11

That's a good idea psychoak, but doesn't it make invading enemy ships try and attack the invisible asteroids, do they not get preoccupied with trying to destroy invincible objects Outside the gravity well? Haven't had a chance to try it out.

 
End of mostly80's quote

Well they would be invincible as well naturally.

Reply #13 Top

*EDIT* Man, my reading comprehension at times sucks.  Just deleted some from this post that made no sense cause I misread another post.  Everything below is still from my original post and applies.

Another thought would be to look at the "homeworld" upgrade in the planet entity files (the one that designates your capital) as it has a couple of values in it that cause a +x value increase to resource and taxes, regardless of the existence of population or extractors.  I'm just not sure if it can be used anywhere other than the homeworld upgrade itself.

Reply #14 Top

Did anyone ever get this to work?

I'm trying something similar. I want to give planets an ability that gives resources to the owner. It works when it's applied to owned planets but if it's applied to neutral planets then it causes a mini-dump. I'm assuming it's because the ability is trying to give resources to a planet owner that doesn't exist.

Is there anyway of applying a constraint to a passive ability?

Reply #15 Top

Quoting mostly80, reply 14

Did anyone ever get this to work?

I'm trying something similar. I want to give planets an ability that gives resources to the owner. It works when it's applied to owned planets but if it's applied to neutral planets then it causes a mini-dump. I'm assuming it's because the ability is trying to give resources to a planet owner that doesn't exist.

Is there anyway of applying a constraint to a passive ability?
End of mostly80's quote

Well, that is unfortunate, as this will make the buff much more complicated.

Getting around the fact that the planet starts out unowned is easy enough. Make the ability apply a buff with no finish condition that applies another buff that ends when the owner changes and give it an apply buff to self with an OnBuffFinish condition, which will apply the resource generating buff you originally had.

Most of the time you can assume that the planet will be bombed out before the next player takes control of it, so it is a fairly simple matter of switching between the "neutral" buff and the "owned" buff, the latter of which generates resources. However, if this is a mod with the vanilla races you have the problem of the Coronata titan's ultimate ability, which will require some fancy conditional buff logic. If its a total conversion and you don't have any ability that instantly captures planets like that you should be good to go.

Reply #16 Top

Thanks GoaFan77, it's for a total conversion mod so this should work nicely.  k1

Reply #17 Top

For a TC, you might be able to edit the planets directly, too.  In the following snippet, just give the credit/resource modifiers for the first stage a non-zero number (and increase the modifier for the second stage).  In theory, it should work.  This would allow for different metal/crystal values per planet (as well as between planets), although I don't think it'd be affected by research like the buff could potentially be.  Maybe even combine the two methods?

    path:Home
        stageCount 2
        stage
            price
                credits 0.000000
                metal 0.000000
                crystal 0.000000
            upgradeTime 0.000000
            isHomePlanet FALSE
            homePlanetTaxRateBonus 0.000000
            homePlanetMetalIncomeBonus 0.000000
            homePlanetCrystalIncomeBonus 0.000000
        stage
            price
                credits 2000.000000
                metal 300.000000
                crystal 200.000000
            upgradeTime 75.000000
            isHomePlanet TRUE
            homePlanetTaxRateBonus 4.000000
            homePlanetMetalIncomeBonus 0.400000
            homePlanetCrystalIncomeBonus 0.400000

Reply #18 Top

overTimeAction
    buffOverTimeActionType "EarnResources"
    earnRate
        Level:0 0.500000
        Level:1 0.760000
        Level:2 1.000000
        Level:3 2.000000

??

 

shove non stacking buff on something that's always around at the planet, like...  Constructors?

you could even make it a Limitless Range Aura, that effects all planets, friend or foe so any constructor in the world, would make sure all planets have this ability to produce crystal/metal.

 

then planets earn, metal and crystal?

not ideal, but it would work, you could hide the ability in ability 4

but all planets would have identical metal / crystal income!

 

not sure what removing the crystal and metal extractors would do to the AI tho.