[Modding] What exactly are Scope and TargetTypes? [Beta 5 Patch 3]

From the forums/discussions, I've had two modding ideas. The trouble is, I can't tell how to get either of them to work properly.

 

1. Research module on ships.

Initially I had the idea that ships could have ranged-based research bonuses - not unlike Starbases. They could provide small flat or % bonuses to nearby colonies, or even having to be stationed at one to affect it. This allows people to give a head-start to colonies - put them in a fleet with a colony ship to make the initial build-up easier, or simply to have them stationed around your capitals for extra boosts.

Ignoring range for now, the obvious problem is how to get them to affect research.

One way to do this:

Code
  1.     <Stats>
  2.       <EffectType>Research</EffectType>
  3.       <Target>
  4.         <TargetType>Faction</TargetType>
  5.       </Target>
  6.       <BonusType>Flat</BonusType>
  7.       <Value>10</Value>
  8.     </Stats>

It works, but it affects research as a whole. Not necessarily a bad idea, but not the one I'm after. So what I want to use instead is:

<TargetType>Colony</TargetType>

But what colony is this? Well, it's Local scope by default. I can change it to Global - surely that would affect all colonies, which would be a start. But it doesn't. IE, non-working code is:

Code
  1.     &lt;Stats&gt;
  2.       &lt;EffectType&gt;Research&lt;/EffectType&gt;
  3.       &lt;Scope&gt;Global&lt;/Scope&gt;
  4.       &lt;Target&gt;
  5.         &lt;TargetType&gt;Colony&lt;/TargetType&gt;
  6.       &lt;/Target&gt;
  7.       &lt;BonusType&gt;Flat&lt;/BonusType&gt;
  8.       &lt;Value&gt;10&lt;/Value&gt;
  9.     &lt;/Stats&gt;

 

This leads onto my 2nd idea

 

2. Faction-wide Pacing

Some people are fine with pacing affecting colony base research, but some people want a bit more. I though that if, instead of -50% base research, which is unnoticeable when you have +1000% from research facilities and capitals, you could have -50% total research.

The obvious thing here is to change it from Colony to Faction. Scope Local wouldn't make sense, as... what is a Local scope for a game setting? So we leave it as Global - it worked for Colony pacing, so why not globally affect all factions? Nope - didn't work. Why is it that I can affect my research faction-wide from a ship, but not from Pacing? Using exactly the same code? And why can I globally affect all colonies from Pacing, but not from a ship. What subtleties do Scope and TargetType hold that makes this not work?

 

Returning to 1.

Faction with default Scope (Local) seemed to work, so would Global and Faction affect all Factions?

Turns out, it doesn't. Global Factions seems not to include Local. That makes my head hurt.

I've even tried TargetRelationTypes set to Any, but that doesn't work either. The default is Self, so if I want it to affect others surely I'd set it to Any.

 

 

Once I get this figured out (hopefully thanks to helpful comments), I might then have an issue getting range-limits working. I know there's a RangeMax tag, but... time will tell.

 

TL;DR: Important issue in bold.

 

PS:

You might want to make the [ code="xml" ] actually readable. You can barely see wha's inside the tags without highlighting.

Code: xml
  1. &lt;Clear&gt;Hard to see &lt;/Clear&gt;

8,814 views 6 replies
Reply #1 Top

well i would suggest looking at something that does something similar namely starbases

heres a line from a manufacturing bonus

<Stats>
<EffectType>MaxManufacturing</EffectType>
<Scope>AreaEffect</Scope>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.1</Value>
</Stats>

you will still need to figure out how to make a ship generate an AOE

Reply #2 Top

Yes, I've already looked at that. It doesn't work. The only thing I can think of to make it have an AOE is to give it StarbaseRange, but that didn't seem to affect anything. I don't want to give it CanConstruct, which gives it the outline of that range, because I don't want people to construct from them. In any case, even giving them that doesn't work.

Regardless, the main question of "What the hell is going on with Scope and TargetType" remains unanswered. Why should AreaEffect work when Global doesn't? Why can in one place Global-Colony affect all colonies, but in another place Global-Colony doesn't do anything?

Reply #3 Top

I really like the idea of creating a hospital ship or factory ship to help a fledgling colony get on the road.  Was there ever a resolution to the question of a ship having an AreaEffect?

Reply #4 Top

v1.6 contains several mercenary ships which boost planetary production in one manner or another, might give you some new tags to leverage.

Examples:

  • +5 raw production
  • +5 wealth
  • +25% manufacturing
Reply #5 Top

Ashot in the dark, but is there any way to make these ship-based buffs trigger only when the ship is orbiting a planet and target only the planet orbited?

I like this idea much better than the proposed "ships as mobile economic starbases".

Reply #6 Top

^ There are a bunch of Merc ships that do just that.