Ophiuchus wrote: ↑Thu Oct 15, 2020 11:05 am
I'd like to correct the code, but I don't understand where to get the ship's name ?
For the ship name to be known, the sitrep effect needs to reference the created ship.
In order to do that it needs to be one of Target/Source/*Candidate. The content where the macro is used is actually a planet special, so the Source is the planet.
I suggest to go for Target. In order for that you need to move the sitrep to an additional effects group. Something similar to
Code: Select all
EffectsGroup
scope = AND [
Ship
RootCandidate.Age = 1
OwnedBy affiliation = AnyEmpire
]
activation = AND [
Planet
OwnedBy affiliation = AnyEmpire
]
effects = [
GenerateSitRepMessage
message = "EFFECT_TAME_MONSTER_HATCHED"
label = "EFFECT_TAME_MONSTER_HATCHED_LABEL"
icon = "icons/monsters/@[email protected]"
parameters = [
tag = "ship" data = Source.ID
tag = "predefinedshipdesign" data = "SM_@1@_1"
]
empire = Target.Owner
]
Then you can use %ship% in the sitrep (NB: Age = 1 is probably not correct.)
Thanks.
Alas, I dabbled a little bit into FOCS, but not enough to understand the implications of what you're writing here.
I mean, after a lot of efforts I finally understand what you're suggesting, but I don't get every piece of code.
The FOCS Scripting details page is not easy to understand...
For the Monster Nest macro, where you suggest adding the EffectGroup, the Source.ID would be the ship because the ship is in the scope ?
But I thought the Source.ID would be the ship's internal ID, while we want its name ? Shouldn't it be Source.Name then (I checked that the variable name is supposed to exist) ?
Also, I absolutely do not understand what happens when EffectsGroups are put one after another : do they happen independantly ?
We want the sitrep generated only if the random activation of the hatching occured : I don't get how this conditionality happens if you put one EffectGroup after another ?
In the MonsterNest macro, there are two separate EffectGroups, each with it probability, one for the unowned Nests and the other for the the tamed ones. I don't see a dependancy between the two ? By the way, the random number for the unowned monsters is hardcoded but passed as a parameter for tamed monsters, is that on purpose ? That means that unowned monsters have a general probability of 0,12 to spawn while tamed monsters have varied (but always lower) probabilities to spaw, respectively 0,5 0,6 and 0,8 for Krakens, Juggernauts and Snowflakes.
In your example the EffectGroup would be triggered by the existence of a newly born ship ? But what if the outpost is settled and has a shipyard ?
The ship is the RootCandidate because its existence is the first condition tested in the scope ? Wouldn't that mean that any ship produced in a shipyard in the same planet would trigger this sitrep ?
The Monster Body FOCS file calls the Sitrep effect with
Code: Select all
[
tag = "system" data = Source.SystemID
tag = "predefinedshipdesign" data = "SM_SNOWFLAKE_2"
]
but not with the ship name: should I just add this name as another tag (and then call it as the third parameter in the Sitrep effect)? Where to get it ? It doesn't appear in the file. Is it something like Source.ID ?
But the Source is the former monster, which is destroyed before a new one is created, if I understand the code correctly.
The designame after CreateShip is the name of the ship design, not the name of the ship ?
Also, I noticed that the code for generation of Monster Nests after the first turn is
Code: Select all
activation = Not Turn low = 1
stackinggroup = "GAME_START_MOD_STACK"
accountinglabel = "ADD_NEST_SPECIAL_EFFECT_1"
effects = AddSpecial name = "SNOWFLAKE_NEST_SPECIAL"
for Snowflakes,
Code: Select all
activation = Not Turn low = 1
stackinggroup = "GAME_START_MOD_STACK"
effects = AddSpecial name = "JUGGERNAUT_NEST_SPECIAL"
for Juggernauts
and
Code: Select all
activation = Turn high = 2
stackinggroup = "GAME_START_MOD_STACK"
effects = AddSpecial name = "KRAKEN_NEST_SPECIAL"
for Krakens.
I'm not sure to understand the syntax of "turn high" and "not turn low", but I guess that they have the same meaning (not generating Nests on the first turn through this code) ?
Looking at the stacking group, I guess it's only to prevent the planet to be later turned into a barren one by Philosopher or Honeycomb special ? But why, if this Nest creation is happening after turn 1 ?
And is there a reason for only Snowflake nests to have the "ADD_NEST_SPECIAL_EFFECT_1" ? It seems to not be in any other FOCS file, is grep told me the truth.
Oberlus wrote: ↑Wed Oct 14, 2020 1:59 pm
Feel free to make any modification of your choice, playtest it and eventually make a PR to integrate your contributions into the game.
You're definitely right, but slightly modifying random numbers brings very difficult to isolate variations : when I'll get a Monster (tamed or not), how will I know that it spawned specifically in the range I modified rather than outside (i.e, that it would not have spawned if not for my modifications) ?
It would require a lot of comparative playtesting to get any meaningful info from it...