User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Modding (leader) abilities dynamically

Mon Jun 16, 2014 3:32 pm

I'm getting somewhat experienced modding and I have a question/suggestion. I think it would be cool to be able to add abilities to a model (in particular, a leader) dynamically. That is, I could add an ability based on an event firing without having to "tech upgrade" the leader. This would allow the leader to be upgraded with different abilities for whatever reason I like. I'm thinking about CW2, but I think the question is more general.

In the CW2 model DB there are columns for 9 abilities and the most that any model has is 5. Let's say I create an ability called "abiCincinatti" which increases cohesion, maybe, and has an image similar to but different from Cavalryman. Cincinatti was a horse that was given to Ulysses S. Grant in 1864 and was very good looking. Then I could create an event which fires in 1864 (or has a chance to fire or whatever) and "upgrades" Grant to add this ability. By 1864 Grant often has accrued a lot of experience and, if I understand correctly, might have different leadership statistics from those he starts with.

So I could create a model called, say, $ldrabi_USA_Cincinatti with most everything "NULL" except Ability6 set to $abiCincinatti.

Then my event actions would be:
"...
SelUnqSubUnit = Ulysses S. Grant
AltercuSubUnit = ApplyToList|Model $ldrabi_USA_Cincinatti
..."

Would this work? If I wanted, could I use the same model and give Cincinatti to a different general or even multiple generals (another example, I could make a model called $ldrabi_USA_Malaria which affects activation, maybe, and is all "NULL" except Ability7 set to $abiMalaria, which could be given to any general who is in Florida to long or something).

The reasons this might not work include:
Ability7 is only read if Ability6 exists, which might not be true for all generals.
Each dynamic ability could only be assigned to a single variable, so only 4 dynamic abilities would be possible as the model DB currently looks.
Leaders can only be upgraded to the model which is in variable "TechUpg" or "TrainUpg" (and I don't think I'd want to use "TrainUpg").
The program would want to read something in the TemplateUID variable which would overwrite the statistics (it would be possible for TemplateUID to be set to Grant's model in the Cincinatti example).
Leaders can only be given a small number of abilities in this way (could be increased if more Ability variables were added).

If this wouldn't work, is there any other way to get dynamic abilities to work? I'm not sure how much people like things like this, but it would allow modders to increase the RPG aspect of leaders. It would also allow for lots of flavor abilities (entourage, skills developed while on campaign, etc).

Jagger2013
General of the Army
Posts: 641
Joined: Sat Apr 27, 2013 2:14 am

Mon Jun 16, 2014 9:22 pm

My understanding is for a general to have an ability, the ability must be listed for the general in the unit/model database. The model/unit database is fixed. An ongoing game will not make changes to the model database. It is read only from the database, no writing, I believe.

So you could give a general a new ability and introduce that ability later in his career by event but you must have a pre-existing model/unit with that ability in the database to replace the current model/unit. So I don't believe dynamic abilities would work because you would have to have perhaps 100s or 1000s of models/units of each and every general to represent all the possible combinations of dynamic abilities which might or might not pop up.

At least that is my understanding.

User avatar
Pocus
Posts: 25659
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Tue Jun 17, 2014 1:00 pm

That's not a possibility in the engine but it has been considered at time indeed...
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Tue Jun 17, 2014 1:32 pm

Ahh, too bad. Jagger2013's suggestion is an alternative. Certainly not every general needs to have every flavor ability, but a few could be added. It wouldn't be as much fun that way, though.

Another alternative, at least for adding an entourage, is to create units. To force the player to keep an entourage with a stack you have the unit carry no supplies but consume 1 supply (so it will die if not in a stack). Otherwise, maybe you could use events to keep a unit in a stack with a certain leader. Neither of those methods seem as much fun, either.

Do any of the games or game mods have entourage units already? How is it done in these?

Jagger2013
General of the Army
Posts: 641
Joined: Sat Apr 27, 2013 2:14 am

Wed Jun 18, 2014 12:58 am

Also, it sounds like everything I said was wrong. :) I can only guess each scenario has a set of the model/unit database attached which can be modified as the game plays out. Something must happen because random leadership for generals wouldn't work without modifying the database.

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 3 guests