Build on Unowned Planet

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Post Reply
Message
Author
User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Build on Unowned Planet

#1 Post by Bigjoe5 »

Should this go on SourceForge under Feature Request? I dunno, but here goes:

Currently, there is no way to build a building on an unowned planet. This seems to be more of a UI thing than anything else and would be relatively easy to fix (afaik) if one was so inclined. The reason this would be nice is so that we could do this with asteroid mines:

BuildingType
name = "BLD_ASTEROID_MINE"
description = "BLD_ASTEROID_MINE_DESC"
buildcost = 1
buildtime = 1
maintenancecost = 1
location = And [
Planet Asteroids
ContainedBy Contains OwnedBy TheEmpire Source.Owner
]
effectsgroups = [
EffectsGroup
scope = ContainedBy And [
Contains Source
Contains Planet Asteroids
]
activation = OwnerHasTech "PRO_ASTEROID_MINE_II"
stackinggroup = "ASTEROID_LOCAL_EFFECT"
effects = SetMaxMining Target.MaxMining + 8

EffectsGroup
scope = ContainedBy And [
Contains Source
Contains Planet Asteroids
]
activation = OwnerHasTech "PRO_ASTEROID_MINE"
stackinggroup = "ASTEROID_LOCAL_EFFECT"
effects = SetMaxMining Target.MaxMining + 4
]
graphic = ""

Note the change in the location specification. If I could select asteroid belts in the production screen, I could use this to build multiple asteroid mines in a system with multiple asteroid belts. However, this would probably require getting rid of the stackinggroup and replacing it with a way to actually limit the player to one mine per belt... If this is all nonsense, feel free to tell me and ignore my request, of course; I know next to nothing of how the text files work - I only started browsing through them today.

BTW, by switching the order of the effectsgroups and changing the effect of the first group to +8, I was able to fix the problem of advanced asteroid mines not doing anything. The stacking effect was blocking the advanced asteroid mines even when I just switched the second effects group to +8 because it was being fed the lower number first. Maybe the stacking effects should be reworked so only the highest number is used, not the first number.
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Build on Unowned Planet

#2 Post by Geoff the Medio »

Bigjoe5 wrote:Should this go on SourceForge under Feature Request?
The "let me pick a planet I don't own as a production location" part is a feature request.
Currently, there is no way to build a building on an unowned planet. This seems to be more of a UI thing than anything else and would be relatively easy to fix (afaik) if one was so inclined.
It's actually coded specifically to not let you select unowned planets. What we really need is a smarter production screen that disables selection of planets where the selected production item can't be built, or which hides / disables production items that can't be built at the selected planet, and a way to switch between these modes easily.
I know next to nothing of how the text files work - I only started browsing through them today.
You seem to have figured out the basics of building and effect scripting.
BTW, by switching the order of the effectsgroups and changing the effect of the first group to +8, I was able to fix the problem of advanced asteroid mines not doing anything. The stacking effect was blocking the advanced asteroid mines even when I just switched the second effects group to +8 because it was being fed the lower number first. Maybe the stacking effects should be reworked so only the highest number is used, not the first number.
It might be better to have two separate stacking groups, one for the basic mine effect and another for the advanced mine effect.

If the desired situation was that mines give +4 with just mining researched, and +8 with advanced mining researched, then both effects would give +4. The downside to this is that it would probably show up as two identical but separate items in the effects accounting tooltip, each giving +4 with no indication of why that line is duplicated.

The reason I suggest this is that I'm not sure whether or not order of effects groups listed in the building / tech / whatever definition guarantees that the first effects group will be applied first and thus take priority in stacking limitation situations. It may work in practice, but I'd prefer to be safe. (And it might actually be safe as well as working always... I'm not sure.)

Post Reply