Event Trigger Question for Dev

Moderator: MOD_DW2

Post Reply
User avatar
ChrisGb
Posts: 130
Joined: Thu Mar 21, 2024 8:10 pm
Location: Spain

Event Trigger Question for Dev

Post by ChrisGb »

1. How I stop en event from firing if the Race is AI controlled ?
2. How trigger event for Race only if Race=Player ?

Basically to have 2 sets of same event to fire one for Race=AI only, the other for if Race=Player only with slightly diff actions


I tried literally all possible combinations of NonTriggerRaceId, PlacementRaceId, RaceId but no matter what...it always fires anyway for the Race, no matter if AI or Player.
Is this even possible ?
Image
Conquest: Terran Frontier Wars - Return to Terra (Terran Campaign DLC) Release 28/7/2025
https://forums.matrixgames.com/viewtopic.php?t=412258
Image
Sabranan
Posts: 486
Joined: Wed Feb 24, 2016 4:05 pm

Re: Event Trigger Question for Dev

Post by Sabranan »

As far as I'm aware the 255=Player value only applies for PlacementRaceId. In most any other context Race Id 255 would be one of the pirate factions.

There's another way to do this though, you can use a condition. This can be placed on the game event itself or in an individual placement action or individual trigger action, depending on exactly what you need.

So you could use:

Code: Select all

<GameEventCondition>
	<Type>EmpireIsPlayer</Type>
</GameEventCondition>
to set it to only work if the empire is a player one or:

Code: Select all

<GameEventCondition>
	<Type>EmpireIsNotPlayer</Type>
</GameEventCondition>
to set it to work if the empire is an AI one.
User avatar
ChrisGb
Posts: 130
Joined: Thu Mar 21, 2024 8:10 pm
Location: Spain

Re: Event Trigger Question for Dev

Post by ChrisGb »

Sabranan wrote: Thu May 15, 2025 2:35 am As far as I'm aware the 255=Player value only applies for PlacementRaceId. In most any other context Race Id 255 would be one of the pirate factions.

There's another way to do this though, you can use a condition. This can be placed on the game event itself or in an individual placement action or individual trigger action, depending on exactly what you need.

So you could use:

Code: Select all

<GameEventCondition>
	<Type>EmpireIsPlayer</Type>
</GameEventCondition>
to set it to only work if the empire is a player one or:

Code: Select all

<GameEventCondition>
	<Type>EmpireIsNotPlayer</Type>
</GameEventCondition>
to set it to work if the empire is an AI one.
I never was aware of this response, just find it now after searching the topic in the search function.
Thank you very much, even is very late...found this condition tag couple weeks after my original question but abandoned the idea that triggered it.
Como back to it eventually later ;)
Conquest: Terran Frontier Wars - Return to Terra (Terran Campaign DLC) Release 28/7/2025
https://forums.matrixgames.com/viewtopic.php?t=412258
Image
Post Reply

Return to “Distant Worlds 2: Tech Support”