• Welcome to Freedom Reborn Archive.
 

m25's custom ai: enemies need exp also

Started by bearded, May 02, 2007, 01:22:00 PM

Previous topic - Next topic

bearded

can the m25 custom ai's use if then statements, like regular python?  if so, i think there could be a leveling system for npc's.  everytime a template is used on a mission, or a danger room, the custom ai python file is appended with the number +1.
so, lex luthor has been in 5 danger rooms against you, in total.  that would make him level 5.  (or a non linear progression formula)
the appended variable would be x, if x = 1 then blank strategy would be used, x = 2 another one.  the strategies could entail new powers.  would this work?  i'm just barely starting to delve into the custom ai interface.

tommyboy

Cool idea.
And of course quite beyond me to make it happen.
One potential problem that leaps to mind is that levels are set in the dat files and I'm not sure these can be written to in-game (but could be wrong, again). If thats the case the experience a villain gains would only last as long as the game was played, then next time he'd go back to "zero", unless you were using a saved game.
Since my Mods tend to ignore experience, pretty much (I tend to let everyone have all their powers from the start) , this is an area I'm especially weak on.

bearded

you misunderstand me.  the levels would be 'fake' levels, not corresponding to ingame lvl's at all.  it would just be a tally of the number of times a template has seen action, as appended to a custom py ai file.  so, it would last beyond the games, the number would be permenantly attached to that file.  just use python to read the last number in the ai, and add one to it.
the only thing i'm not sure about is whether you can use if then's in the ai files.

M25

The AI doesn't use if statements, or at least not in the way you are thinking.  You could add a custom subtype to the AI definition for every level, and then have certain statements require that subtype, but you'd end up with a bloated AI definition and it would run slowly.

You'd be better off creating a new AI definition for each level of experience you want to use and then assigning that AI to the character through custom scripting.

Or you could create a whole character for each level of experience, allowing you to customize the mesh/skin/powers as the character grows, and then have an AI for each character.  You could then override the spawning function in the danger room to spawn the character of the correct experience level.