• 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.

Pancakelord

Lord of Pancakes
44 Badges
Apr 7, 2018
3.375
12.292
  • Cities: Skylines - Green Cities
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Ancient Relics
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Imperator: Rome
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Imperator: Rome Deluxe Edition
  • Magicka: Wizard Wars Founder Wizard
  • Stellaris: Nemesis
  • Europa Universalis IV
  • Stellaris: Necroids
  • Sword of the Stars
  • Crusader Kings III
  • War of the Roses
  • Cities: Skylines
  • Stellaris: Federations
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Lithoids
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Sword of the Stars II
  • March of the Eagles
  • Darkest Hour
So, because I love pain, I'm trying to setup a few "battle awarded" traits for generals.

The basic premise is I run this when either side wins a ground battle (or, put another way, this script runs for the winner always - need to add a trigger for default countries only, later).
1638230651012.png


My goal in the red bit below, is to try and scope to the general of the winning army in a ground invasion so I can give them a trait. This doesnt work.

1638230619562.png
1638230850743.png

However, it doesnt scope to the general - possibly because they return to orbit on-victory. I think I've been staring at this too long and need a fresh perspective. Does anyone know of a less messy (and actually workable) way to scope to a general, from a planet, using the above 2 on-actions?
 
Try:
Code:
# Triggers when ground combat starts
# This = planet
# From = country attacking
on_ground_combat_started = {
}
and track generals from there.

This can also help in tracking additional generals joining later:
Code:
#An army has been killed in ground combat
# This = owner
# From = army
# FromFrom = opponent
# FromFromFrom = planet
on_army_killed_in_combat = {
    events = {
        emperor.450
        necroids.15
    }
}
 
Try:
Code:
# Triggers when ground combat starts
# This = planet
# From = country attacking
on_ground_combat_started = {
}
and track generals from there.

This can also help in tracking additional generals joining later:
Code:
#An army has been killed in ground combat
# This = owner
# From = army
# FromFrom = opponent
# FromFromFrom = planet
on_army_killed_in_combat = {
    events = {
        emperor.450
        necroids.15
    }
}
thanks I'll give that a go. Even more direct scope grabs dont work for some reason when i re-write it like this.
1638233961249.png


Right now my test setup is 7 clone armies invading a world. I have a feeling I can directly grab the generals on the defender side - if they win - as they should "be" on the planet (from what I gather, generals are never "on" planets. They're always attached to an army, which is, in-turn, on a planet).
 
Ah figured it out!. Now my general will gain an affinity fighting on cold worlds whenever he wins a fight on one cold one (there's a little more to it than that, but yeah)
1638235362995.png

1638235625723.png
The trait will rank up after 5, and then 10 victories on an arctic world (+50%/+75% army dmg, rather than the base +25%, on cold worlds).

so - for anyone interested - my general ID script, still using on_planet_attackers_win / on_planet_defenders_win [need to test def side] on actions, is as follows:
1638235476362.png

One last question, unanswered, is what happens with general selection in multi-army scenarios. like with 2-3 armies defending / attacking. A very rare event, will have to figure out a good way to test it.
 
Last edited:
  • 1Like
Reactions: