• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

grundy122

Private
Dec 9, 2022
22
0
the whole of my code is, right now;

on_death = {
events = {
TestEvent.1
}
}

And the test event fires when the character the player is controlling dies, but nobody else's death triggers it.
 
No, it fires whenever any character dies. Did you declare a namespace for your event, or does your event have (pre-)triggers that would restrict it to players only?
 
I didn't put any triggers on it, and the namespace is declared.

Someone on reddit suggested the event is firing, but since it's scoped to an character, the character is the one "seeing" it, not me. I'll test that later
 
Someone on reddit suggested the event is firing, but since it's scoped to an character, the character is the one "seeing" it, not me. I'll test that later

I hope that's not too surprising. You're not seeing all other events for other characters either, after all. Character events fire for the appropriate character.
 
Ya in hindsight it sounds kind of obvious.

Sounds like you'll figure it out soon enough.
You can use log = "Stuff" to see if events you can't see are working properly. The results end up in game.log, if you've enabled the correct level of logging. See the Troubleshooting wiki page for more info on that.
 
OKAY, SO, PROBLEM SOLVED

Thanks to your suggestion of using the Log feature (which I didn't know was a thing), I managed to figure out that this was actually a two-layered issue.

The first layer was that my test event had ai = no on it, so it wouldn't actually fire when a character other than the player died at all, because, duh

The second layer was that even without ai = no, it would fire the event in a way that only the AI could see it. What I did was, then, create a second test event, and have the first even scope the second event unto the player

Or to put it more simply, it goes:

on_death = {
events = {
TestEvent.1
}

}


Which triggers TestEvent1, that only the AI can 'see'. But changed it to;

character_event = {
id = TestEvent.1

immediate = {
any_player = {character_event = { id = TestEvent.2 }}
}

}

Now, I'll never see event 1 (even though it totally fires still, I could put stuff in there if I wanted it to be hidden), but event 2 will always show up when a character dies.

The downside is that the event will fire for all players playing, but since my mod is intended for single player only this won't be an issue.