Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement - Kill Off Remaining Units Upon Elimination #79

Open
Neptune3215 opened this issue Mar 18, 2023 · 3 comments
Open

Enhancement - Kill Off Remaining Units Upon Elimination #79

Neptune3215 opened this issue Mar 18, 2023 · 3 comments

Comments

@Neptune3215
Copy link

Can an enhancement be made so all remaining traders and villagers instantly die when a player is eliminated?

@rbrash1287
Copy link

I have been researching this, testing it, basically trying anything from my little book of .lua and moddings.. its been mentioned in main AOE discord as well as the unofficial discord.

Of the thousands of games using AGS setts and mostly Forest Nothing, this is by far the worst. Wish I could contribute and from studying lua commands I would think a clever script could be made that would remove all entities idle/defeared on a map...

@Woprok
Copy link
Owner

Woprok commented Apr 5, 2023

It's not that complicated to kill off remaining units. Moment player is eliminated is well known and as long as he was not yet killed by C++ calls, you can gather information about player units and buildings. EGroup/SGroup get all player entities / squads exists if I remember correctly. Only thing left is to find exact place where you want to invoke this, for AGS that would be right here:

https://github.com/Woprok/AOE4-AdvancedGameSettings/blob/master/assets/scar/coreconditions/ags_conditions_match.scar

function AGS_SetPlayerDefeated(player_id, presentation_function, defeat_reason, opt_objective_pop)
        -- most likely as first call, might work as second or third
	AGS_SetOnePlayerDefeated(player_id, presentation_function, defeat_reason, opt_objective_pop)
	Core_CallDelegateFunctions("OnPlayerEliminated", Core_GetPlayersTableEntry(player_id), defeat_reason)
end

@Woprok
Copy link
Owner

Woprok commented Apr 5, 2023

But as any other change to this mod, I don't have time & motivation to do it currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants