Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2523 closed enhancement (fixed)

Make skirmish entities more mod friendly

Reported by: sanderd17 Owned by: Idanwin
Priority: Should Have Milestone: Alpha 17
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Currently, to adapt the skirmish entities to a mod that simply adds a civ, you need to copy the skirmish entities to the mod, and adapt a line on each of them.

This breaks loading multiple mods, as they overwrite each others changes.

Instead, it would be better to define a mapping of skirmish replacements in the civ.json files, and let the skirmish replacement component get the info from there (through the player component).

Attachments (3)

output.diff (16.2 KB ) - added by Idanwin 10 years ago.
output.2.diff (22.6 KB ) - added by Idanwin 10 years ago.
output.3.diff (22.8 KB ) - added by Idanwin 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Idanwin, 10 years ago

Owner: set to Idanwin
Status: newassigned

by Idanwin, 10 years ago

Attachment: output.diff added

comment:2 by Idanwin, 10 years ago

I uploaded a diff, if someone could have a look at it.

by Idanwin, 10 years ago

Attachment: output.2.diff added

comment:3 by Idanwin, 10 years ago

cleaned up the code

comment:4 by Idanwin, 10 years ago

Keywords: patch review added

comment:5 by sanderd17, 10 years ago

Looks very good. Just watch out for your indentation. We use one extra tab per indentation level. I also wonder if it's best to work with id's, instead of the template names (you can query the template name of yourself via the templateManager).

Maybe now keep the ids equal to the template names (so include _b for the basic soldiers, someone might want to make _a and _e templates),. That would make it easier to find, and if we ever need a distinction, it's ready.

in reply to:  5 comment:6 by Idanwin, 10 years ago

Replying to sanderd17:

Looks very good. Just watch out for your indentation. We use one extra tab per indentation level. I also wonder if it's best to work with id's, instead of the template names (you can query the template name of yourself via the templateManager).

Maybe now keep the ids equal to the template names (so include _b for the basic soldiers, someone might want to make _a and _e templates),. That would make it easier to find, and if we ever need a distinction, it's ready.

I didn't know how to query the template name (or even whether it was possible) I concur, that's a much more desirable option. I'll change it today.

by Idanwin, 10 years ago

Attachment: output.3.diff added

comment:7 by sanderd17, 10 years ago

Resolution: fixed
Status: assignedclosed

In 15159:

Make skirmish entities better moddable. Fixes #2523. Patch by Idanwin.

comment:8 by sanderd17, 10 years ago

Keywords: simple review removed
Note: See TracTickets for help on using tickets.