EffectsGroup
scope = And [
System
Object id = Source.SystemID
]
activation = And [
Size high = 3
Random probability = 0.5
]
effects = [
CreatePlanet type = asteroids planetsize = asteroids name = "NEW_ASTEROIDS_NAME"
]
EffectsGroup
scope = And [
System
Object id = Source.SystemID
]
activation = And [
Size high = 3
Random probability = 0.5
]
effects = [
CreatePlanet type = barren planetsize = small name = "NEW_PLANET_NAME"
]
EffectsGroup
scope = And [
System
Object id = Source.SystemID
]
activation = And [
Size high = 3
Random probability = 0.5
]
effects = [
CreatePlanet type = asteroids planetsize = asteroids name = "NEW_ASTEROIDS_NAME"
]
EffectsGroup
scope = And [
System
Object id = Source.SystemID
]
activation = And [
Size high = 50
]
effects = [
If condition = Random probability = 0.5
effects = CreatePlanet type = asteroids planetsize = asteroids name = "NEW_ASTEROIDS_NAME"
If condition = Random probability = 0.5
effects = CreatePlanet type = barren planetsize = small name = "NEW_PLANET_NAME"
If condition = Random probability = 0.5
effects = CreatePlanet type = asteroids planetsize = asteroids name = "NEW_ASTEROIDS_NAME"
]
I will try to include some more possibilities and then create a new pull request.
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.
Geoff the Medio wrote:Other than the meter-effect restriction (though the problem with them remains), this should work now:
Sounds very good. I'm a bit under the weather right now and my brain seems to object to working much, so could you do me the favor of explaining the reasoning for the meter-effect restriction? If you are expecting the restriction to stick around long term then we should probably add some kind of error check for it into the Effect::Conditional constructor.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Dilvish wrote:...explaining the reasoning for the meter-effect restriction?
Meter accounting handles meter-modifying effects separately from other effects. The If/Else effect is not (at least presently) a meter-modifying effect, even if it contains one. Consequently, accounting doesn't properly handle any meter-modifications done within an If/Else effect execution.
Geoff the Medio wrote:Meter accounting handles meter-modifying effects separately from other effects. The If/Else effect is not (at least presently) a meter-modifying effect, even if it contains one. Consequently, accounting doesn't properly handle any meter-modifications done within an If/Else effect execution.
Ok, so at least theoretically, we could, for example, make another conditional effect, Meter_If, which would do the same thing but for meter effects, and it could be accounted for properly. That's obviously not a great sounding name, and there might be some other better solution, but it sounds like some sort of solution should be possible, at least.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
I've created a pull request for an updated version. Besides the scripting update it includes functional changes:
1. Added some more variations to the nebula collaps (tiny and inferno planets, gas giants).
2. Raised the size threshold for the collapse a little (because it was hard for a player to keep track of the nebula just before it becomes important).
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.
Dilvish wrote:...make another conditional effect, Meter_If, which would do the same thing but for meter effects, and it could be accounted for properly.
Probably not necessary or really very helpful... the problem is more so in the wrapping code that checks if things are meter effects, and if so, does some extra stuff at different times. The SetMeter effect itself doesn't do much different as far as I recall.
That's obviously not a great sounding name, and there might be some other better solution, but it sounds like some sort of solution should be possible, at least.
In the FOCS script, it could probably still be written If/Else in that case.
It will randomly pick, at execution time, one of the values in the list. Duplicates can be used to adjust the probabilities. Should work as well for strings, numbers, object types, planet types, star types...
Ooh, like that, been seeing a few weirdnesses with some of the natives that set planet size recently, I've put it on my long term list of things to tweak, that'll make it a lot easier to balance some of those effects.
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.