Repeated bonuses from race ability and/or gaining an artifact

Hello fellow modders!

I was attempting to create a new race ability called "insidious" that gives gradual bonuses to diplomacy and logistics as part of an evil diplomatic race that naturally evolves/learns over time. This would be similar to the "artifact" major event from GalCiv 2, and in fact I learned a couple things from https://forums.galciv3.com/467992/page/5/#3578740, namely that...

-There is no known "OnEachTurn" or similar trigger

-GalCiv 3 does have artifacts in it

 

The version of the ability I created is something like this

  <RaceTrait>
    <InternalName>InsidiousAbility</InternalName>
    <DisplayName>InsidiousAbility_Name</DisplayName>
    <DisplayNameShort>InsidiousAbility_ShortName</DisplayNameShort>
    <Description>InsidiousAbility_Desc</Description>
    <IsAbility>1</IsAbility>
    <Triggers>
      <OnEvent>OnStartTurn</OnEvent>
        <CriteriaTurnNum>15</CriteriaTurnNum>
      <Scope>Global</Scope>
      <Target>
        <TargetType>Faction</TargetType>
      </Target>
      <Lifetime>Instant</Lifetime>
      <Modifier>
        <EffectType>LogisticsCap</EffectType>
        <Target>
          <TargetType>Faction</TargetType>
        </Target>
        <BonusType>Flat</BonusType>
        <Value>1.0</Value>
      </Modifier>
    </Triggers>
    <Triggers>
      <OnEvent>OnStartTurn</OnEvent>
        <CriteriaTurnNum>30</CriteriaTurnNum>
      <Scope>Global</Scope>
      <Target>
        <TargetType>Faction</TargetType>
      </Target>
      <Lifetime>Instant</Lifetime>
      <Modifier>
        <EffectType>LogisticsCap</EffectType>
        <Target>
          <TargetType>Faction</TargetType>
        </Target>
        <BonusType>Flat</BonusType>
        <Value>1.0</Value>
      </Modifier>
    </Triggers>
    <Triggers>
      <OnEvent>OnStartTurn</OnEvent>
        <CriteriaTurnNum>40</CriteriaTurnNum>
      <Scope>Global</Scope>
      <Target>
        <TargetType>Faction</TargetType>
      </Target>
      <Lifetime>Instant</Lifetime>
      <Modifier>
        <EffectType>Diplomacy</EffectType>
        <Target>
          <TargetType>Faction</TargetType>
        </Target>
        <BonusType>Flat</BonusType>
        <Value>0.5</Value>
      </Modifier>
    </Triggers>
  </RaceTrait>

but with many more <Triggers> entries with delayed OnStartTurn events as a sort of workaround. This ability appears on the race editor screen next to all the others, but does not appear to work (as confirmed by my logistics not increasing).

Is there something wrong with having a large number of <Triggers> entries?
EDIT: I have discovered that the <Lifetime>Instant</Lifetime> entry is to blame here; apparently that should only be used for changing things like current population or wealth. Even so, an alternative is desirable.

Is there an OnEvent option for triggering every turn (preferable)?

Is there a way to assign an artifact to a player as part of an ability (even more preferable)?

Is there some list somewhere of all the OnEvent and Action options?

11,266 views 7 replies
Reply #1 Top

Is there some list somewhere of all the OnEvent and Action options?

In the Schema files:-

  <xs:simpleType name="OnEventTypes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="OnConstructShip"/>
      <xs:enumeration value="OnConstructImprovment"/>
      <xs:enumeration value="OnPlanetTileOwnerChangeToForeign"/>
      <xs:enumeration value="OnPlanetTileOwnerChangeToSelf"/>
      <xs:enumeration value="OnGenocidePlanet"/>
      <xs:enumeration value="OnCollideAtAnomaly"/>
      <xs:enumeration value="OnArriveAtAnomaly"/>
      <xs:enumeration value="OnEventChoice"/>
      <xs:enumeration value="OnUPResolutionPassed"/>
      <xs:enumeration value="OnCultureTraitUnlock"/>
      <xs:enumeration value="OnColonizePlanet"/>
      <xs:enumeration value="OnConquerPlanet"/>
      <xs:enumeration value="OnConquerPlanetFirstTime"/>
      <xs:enumeration value="OnPlanetRebellionComplete"/>      
      <xs:enumeration value="OnHomeworldConquered"/>
      <xs:enumeration value="OnConversationResponse"/>
      <xs:enumeration value="OnTechResearched"/>
      <xs:enumeration value="OnStartTurn"/>
      <xs:enumeration value="OnObjectDestroyed"/>
      <xs:enumeration value="OnConstructShipyard"/>
      <xs:enumeration value="OnConstructStarbase"/>
      <xs:enumeration value="OnPlayerDead"/>
      <xs:enumeration value="OnTechAgeReached"/>
      <xs:enumeration value="OnCollideWithCampaignWaypoint"/>
      <xs:enumeration value="OnScreenUnhidden"/>
      <xs:enumeration value="OnInitialShips"/>
      <xs:enumeration value="OnStartMegaEvent"/>
      <xs:enumeration value="OnTurnCountSinceTrigger"/>
      <xs:enumeration value="OnFinishBattleVictory"/>
      <xs:enumeration value="OnCreateTradeRoute"/>
      <xs:enumeration value="OnConstructModule"/>
      <xs:enumeration value="OnMeetMercenary"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ActionTypes">
    <xs:restriction base="xs:string">
      <xs:enumeration value="StatusEffect"/>
      <xs:enumeration value="RemoveStatusEffect"/>
      <xs:enumeration value="GiveObjectToTileOwner"/>
      <xs:enumeration value="KillPopulation"/>
      <xs:enumeration value="AwardModulePoints"/>
      <xs:enumeration value="AwardDominantIdeologyPoints"/>
      <xs:enumeration value="AwardFreeImprovement"/>      
      <xs:enumeration value="AwardRandomShip"/>
      <xs:enumeration value="AwardShipOfClass"/>
      <xs:enumeration value="AwardStartingShip"/>
      <xs:enumeration value="AwardShipOfClassToAllColonies"/>
      <xs:enumeration value="CompletePercentOfCurrentTech"/>
      <xs:enumeration value="AwardCommander"/>
      <xs:enumeration value="FinishCurrentTech"/>
      <xs:enumeration value="FinishNearestPlanetProject"/>
      <xs:enumeration value="Wormhole"/>
      <xs:enumeration value="BattleEncounter"/>
      <xs:enumeration value="UPResolutionRedistributeWealth"/>
      <xs:enumeration value="UPResolutionRedistributeTech"/>
      <xs:enumeration value="UPResolutionCancelAllWars"/>
      <xs:enumeration value="UPResolutionCancelAllRebellion"/>
      <xs:enumeration value="UPResolutionDefiantRaceRemoval"/>
      <xs:enumeration value="UPResolutionCancelResearch"/>
      <xs:enumeration value="ChangePlanetTileToType"/>
      <xs:enumeration value="PlayerClaimAllPlanetsInRebellion"/>
      <xs:enumeration value="PlayerClaimAllStarbasesInRebellion"/>
      <xs:enumeration value="AwardResearchAmount"/>
      <xs:enumeration value="TerraformTilesOnPlayerPlanets"/>
      <xs:enumeration value="TerraformTilesOnPlanet"/>
      <xs:enumeration value="DiscoverNearbyPlanetOfClass"/>
      <xs:enumeration value="FlipForeignPlanet"/>
      <xs:enumeration value="SpawnPlanetNearOtherFaction"/>
      <xs:enumeration value="SpawnPlanetNearUs"/>
      <xs:enumeration value="DeclarationOfWarByNeutralPlayers"/>
      <xs:enumeration value="DoActionPlayerCancelAllRebellion"/>
      <xs:enumeration value="PlayerChangeTradeRouteType"/>
      <xs:enumeration value="DestroyObject"/>
      <xs:enumeration value="PlaceWaypoint"/>
      <xs:enumeration value="EnableObjective"/>
      <xs:enumeration value="CompleteObjective"/>
      <xs:enumeration value="EnableScenarioTrigger"/>
      <xs:enumeration value="DoScenarioConversation"/>
      <xs:enumeration value="DisableUIControl"/>
      <xs:enumeration value="UnhideUIControl"/>
      <xs:enumeration value="DestroyObjectByCampaignID"/>
      <xs:enumeration value="PlaceAnomaly"/>
      <xs:enumeration value="TriggerGlobalEvent"/>
            <xs:enumeration value="TriggerMegaEvent"/>
            <xs:enumeration value="DisableMegaEvent"/>
      <xs:enumeration value="TriggerColonizationEvent"/>
      <xs:enumeration value="ShowStartingPositions"/>
      <xs:enumeration value="SpawnFaction"/>
      <xs:enumeration value="SpawnArtifact"/>
      <xs:enumeration value="AwardArtifactToWeakestPlayer"/>
      <xs:enumeration value="AwardArtifactToStrongestPlayer"/>
      <xs:enumeration value="SpawnAnomaly"/>
      <xs:enumeration value="ConvertDeadPlanet"/>
      <xs:enumeration value="ConvertDeadPlanetToThulium"/>
      <xs:enumeration value="ConvertAsteroidsToDurantium"/>
      <xs:enumeration value="ConvertGasGiantToPromethion"/>
      <xs:enumeration value="SpawnElerium"/>
      <xs:enumeration value="SpawnAntimatter"/>
      <xs:enumeration value="SpawnRelic"/>
      <xs:enumeration value="SpawnEleriumProportional"/>
      <xs:enumeration value="SpawnAntimatterProportional"/>
      <xs:enumeration value="SpawnRelicProportional"/>
      <xs:enumeration value="Assassination"/>
      <xs:enumeration value="GrantRandomTechToAll"/>
      <xs:enumeration value="ConvertDeadPlanetProportional"/>
      <xs:enumeration value="ConvertDeadPlanetToThuliumProportional"/>
      <xs:enumeration value="ConvertAsteroidsToDurantiumProportional"/>
      <xs:enumeration value="ConvertGasGiantToPromethionProportional"/>
      <xs:enumeration value="FlipNonCapitalPlanetInAreaEffect"/>
      <xs:enumeration value="UnhideScreen"/>
      <xs:enumeration value="AwardMercenaryShip"/>
            <xs:enumeration value="AwardRandomMercenaryShip"/>
    </xs:restriction>
  </xs:simpleType>

 

Might Also be worth looking at the Mega Events, soem of them are timed. Blah for 25 turns ect.

Reply #2 Top

Wouldn't the onstartturn trigger work?

i would also take a look at the ideology buildings the preparedness centre provides .2 ideology per turn 

you might be able to add something like that to a race unique diplo building 

Reply #3 Top

the onstartturn trigger only fires once (it will not fire at all if you don't specify a turn).

I'm more than a little interested in the three spawn/award artifact actions. Which schema file is that? Is it just in there with the rest of the .xml files and I didn't notice?

EDIT: sadly it appears that even SpawnArtifact doesn't have any additional criteria and just gives it to the weakest player as per the console command. The best approach I'm seeing is to create your own artifact, momentarily make yourself the weakest player, then award the artifact and revert whatever prior change you made. A clunky solution at best.

I also don't see any way to choose a specific artifact, so you would probably need to modify the default one.

Also also, the temples and such give a bonus to CulturePerTurnX (e.g. CulturePerTurnBenevolent, etc.). The fact that they have these sorts of 'workaround' stats makes me think that there isn't any real way to make something happen every turn other than artifacts and repeated use of the OnStartTurn event.

Reply #4 Top

Its from ModifierEffectTypes.xsd

Reply #5 Top

tried including the "PerTurnStats" line from ArtifactDefs.xsd inside of RaceTraitDefs.xsd just below the "Mod" definition line, but the game just silently crashes on startup.

Reply #6 Top

Messing wiith the schema is a real bad idea. They do not take to been modded. Think of them as a "bridge" between the dll/exe and the xml's, mess with the bridge and its likely to collapse. 8C