Help with EffectsGroups

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

Moderators: Oberlus, Committer

Message
Author
User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Help with EffectsGroups

#106 Post by eleazar »

Geoff the Medio wrote:
eleazar wrote:How does this work (if at all) with Gas Giants and Asteroids?

Code: Select all

    case SZ_GASGIANT:   return 6;   break;
    case SZ_HUGE:       return 5;   break;
    case SZ_LARGE:      return 4;   break;
    case SZ_MEDIUM:     return 3;   break;
    case SZ_SMALL:      return 2;   break;
    case SZ_TINY:       return 1;   break;
    default:            return 0;   break;
These can be changed as required...
From the results in very recent builds, it looks like there is no size assigned to asteroids. So even if the asteroid is a species EP, their population there will be 0, since it works like this:

Code: Select all

accountinglabel = "GOOD_ENVIRONMENT_LABEL"
effects = SetTargetPopulation Value + 3 * Target.SizeAsDouble
Ultimately i'd love for asteroid belts to come in different sizes. Short of that perhaps we should have them return a size of 3.

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

Re: Help with EffectsGroups

#107 Post by Bigjoe5 »

IIRC, using SetPlanetType on asteroids or gas giants will create tiny or huge planets, respectively. Unless that's changed, and/or these planets are given different size levels, it would probably be most consistent to use 1 and 5 as the size for those planet types.
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Help with EffectsGroups

#108 Post by eleazar »

Bigjoe5 wrote:IIRC, using SetPlanetType on asteroids or gas giants will create tiny or huge planets, respectively. Unless that's changed, and/or these planets are given different size levels, it would probably be most consistent to use 1 and 5 as the size for those planet types.
I've got no objection.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Help with EffectsGroups

#109 Post by eleazar »

I'm trying to get an effect that will repair a ship by 25% of its total structure. The following gives no errors, but it can totally repair a ship in one turn from at least half damage. It is fairly hard to rig a fight that i survive but get damaged.

Code: Select all

    effectsgroups =
        EffectsGroup
            scope = And [
                OwnedBy TheEmpire Source.Owner
                Ship
            ]
            effects = SetStructure Value + (Target.MaxStructure/4)

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

Re: Help with EffectsGroups

#110 Post by Geoff the Medio »

Is it just applying the effect twice, or more than twice in some semi-consistent manner? There are a variety of reasons that could be happening, either due to an issue with the effects engine, or what content the effect is attached to and how its scope and activation are set up.

Or is it just firing once, but getting the wrong result from Target.MaxStructure/4 ?

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Help with EffectsGroups

#111 Post by eleazar »

I think i figured it out and got it working. There were multiple techs doing repairs, and also the readout seems to be glitched.
odd structure.jpg
odd structure.jpg (30.75 KiB) Viewed 1098 times
Note that by the cursor structure is reported as 10, but in the tooltip is is 9. Oddly enough in my limited testing, this disagreement only happened on the turn before structure was to be fully repaired.

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

Re: Help with EffectsGroups

#112 Post by Geoff the Medio »

eleazar wrote:There were multiple techs doing repairs, and also the readout seems to be glitched.
Any meter predictions that are affected by effects that modify meters that have persistence will likely be buggy, as I don't think those predictions will take into account effects.
Note that by the cursor structure is reported as 10, but in the tooltip is is 9.
That's quite normal looking in of itself; the single-value statistic icons generally show the estimated value for next turn (based on a probably-incorrect meter growth estimate), rather than the current turn value. This way, changes in the UI to things like focus settings that will change the meter value next turn have an immediate apparent effect on the shown meter values.

User avatar
qsswin
Pupating Mass
Posts: 93
Joined: Tue Oct 18, 2011 6:48 pm
Location: UTC-5

Re: Help with EffectsGroups

#113 Post by qsswin »

I was trying to script some stuff involving outposts, and was trying to figure out the "standard" way to determine outpost status (there isn't one, to wit: some use TargetPopulation, some Population, some use low = 1 (which seems like a bad idea) and some use NOT <condition> high = 0) and I had a few questions.

TargetPopulation low = 0 high = 9999 is used sometimes. Shouldn't that match all planets?
What does "Planet Population low = <number> high = <number>" mean? How is it different from simply the "Population" condition (places where it is: species.txt, 2629, 2781 techs.txt, 792)?

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

Re: Help with EffectsGroups

#114 Post by Geoff the Medio »

qsswin wrote:What does "Planet Population low = <number> high = <number>" mean?
The Effects article section on meter value conditions describes this accurately:
...LOW specifies the lowest allowed value of the meter, and HIGH specifies the highest allowed value. Either of the LOW and HIGH parameters may be omitted, in which case there is no limit on the meter value in that direction. For example, if only LOW is specified, there is no upper limit on the allowed meter value.
How is it different from simply the "Population" condition
The "Planet" is a separate condition that appears to have been placed on the same line as the Population condition.

User avatar
qsswin
Pupating Mass
Posts: 93
Joined: Tue Oct 18, 2011 6:48 pm
Location: UTC-5

Re: Help with EffectsGroups

#115 Post by qsswin »

Geoff the Medio wrote:
qsswin wrote:What does "Planet Population low = <number> high = <number>" mean?
The Effects article section on meter value conditions describes this accurately:
...LOW specifies the lowest allowed value of the meter, and HIGH specifies the highest allowed value. Either of the LOW and HIGH parameters may be omitted, in which case there is no limit on the meter value in that direction. For example, if only LOW is specified, there is no upper limit on the allowed meter value.
How is it different from simply the "Population" condition
The "Planet" is a separate condition that appears to have been placed on the same line as the Population condition.
Ah, I understood the high and low, I just hadn't realized you could have multiple conditions on the same line. I thought the parser demanded line breaks.

Post Reply