Krazyguy75 Posted August 26, 2013 Share Posted August 26, 2013 I've seen work done on pods having unique abilities, like pod leaders being more powerful and having new perks and bonus HP and such. I'm looking at ways of making pods more versatile, with different potential tactics. I was wondering exactly how much of a pod member's stats can you change: Can you change their base abilities, movement options, loadouts, etc? What about giving the leaders of certain pods infinite grenades and such things that are not normally tied to perks or abilities? Which variables can be changed specifically for the leaders and followers of pods (without changing the base races)? Link to comment Share on other sites More sharing options...
Amineri Posted August 26, 2013 Share Posted August 26, 2013 With the way it's set up currently in the Long War mod (since version 1.9), each alien can be set up uniquely. Right now it's handled in the vanilla function XGUnit.DebugAnims (which was renamed XGUnit.#AlUpgrade in Long War 2.0). The way it is set up #AIUpgrade is called for each AI-controlled alien unit immediately after it is initialized. The class variable XGUnit.m_iSmokeGrenades is used to pass the level of the leader (which can be zero). The AIUpgrade function can then adjust stats for each alien based on the information available, which include unit type, time elapsed in game, leader level. Currently Long War only does two upgrades : leader upgrades and 'navigator' upgrades. After a certain point of time each alien (leader or not) has a small chance to be upgraded with an extra perk and a small HP increase. However, any of the stats (e.g. mobility, aim, defense) could also be modified. However, this requires hex editing -- it's not set up at all to be configurable via the DGC.ini. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted August 26, 2013 Author Share Posted August 26, 2013 Is it just those stats, or could I potentially do things like change the available movement (climb ladders, break windows, etc) or even modify the aliens' loadouts? Link to comment Share on other sites More sharing options...
Amineri Posted August 26, 2013 Share Posted August 26, 2013 I'm not sure if the alien units use the same m_iAlienGrenades field defined in XGUnit (that is the field that holds the number of alien grenade charges for XCOM units, at least). Given that the XGUnit.UpdateItemCharges function that sets these variables is called for alien units as well (in SpawnAlien), it looks possible. The call to the #AlUpgrade function happens just after the SpawnAlien call, so you should be able to change the number of charges of alien grenade (and it wouldn't be overridden later). It might be nice to give the alien the Grenadier perk anyhow so that the player (if they've done the autopsy) can see that the alien has the perk and would be able to plan around the alien having multiple grenades. I haven't had any success with trying to change the mesh/animation loadout of the alien, and the weapons in general are already loaded onto the alien in SpawnAlien. Movement modes ... hmmm... I hadn't tried it, and am not sure where they are stored, but it might be possible. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted August 26, 2013 Author Share Posted August 26, 2013 I think that movements are applied in XGTacticalGameCoreNativeBase as by changing kCharacter.aTraversals. So I'd think that would be changeable? As for loadouts, would it not be possible to just write the function to change the loadout.item[#]? Would that not apply for some reason? Of course, I'm still really new to all this, and most of my experience is with changing constants, not writing scripting, so I might be thinking about this all the wrong ways. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted August 29, 2013 Author Share Posted August 29, 2013 Where can I find the coding you put in long war to do that?Also, where are individual units' stats generated? Link to comment Share on other sites More sharing options...
Amineri Posted August 29, 2013 Share Posted August 29, 2013 The function where all of the unit stats are currently set in Long War was originally named XGUnit.DebugAnims, but we renamed it #AlUpgrade to try and make things a little less confusing. The loadout isn't just a 'state' -- there are several steps in the process of loading out a unit, which includes spawning copies of the item class, making sure that mesh/animation data is loaded, as well as linking the spawned class into the unit's XGInventory. I'm not saying that it's not possible, but it will probably be a bit more involved than just swapping one data value. When I've tried swapping mesh/animation sets I've at times made units 'invisible' and have caused the game to crash. Just a heads up :) -- The alien stat templates are stored in a TCharacter struct (actually so are the XCOM soldiers, SHIVs, and civilians). There is one master copy of these templates which is loaded using the DGC.ini data. The master templates are then updated using the difficulty-based DGC.ini info. I hacked in the 'generalized' alien upgrades over time by altering this mechanism. When a new unit is created a copy of the XGUnit class is spawned and the TCharacter info is copied into it (this is how each unit gets the copy of the template stats). For aliens this happens in the SpawnAlien function. In Long War just after Spawn Alien is called the #AlUpgrade function is called, which allows changing the stats for the individual unit. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted September 2, 2013 Author Share Posted September 2, 2013 So, after a fair bit of searching, and solving most of my non-loadout problems, I noticed SeqAct_GiveItems, and that (at first glance) seems to add an item to an inventory and possibly update the item in game, but I'm not sure if it replaces the existing items (for example if you try to put another pistol in, it would replace the existing one), or if it just increases the number of items in the inventory. I'm also still not sure how Sequence Actions work, I know they're for Kismet, but can they be referenced in unrealscript at all? Link to comment Share on other sites More sharing options...
Recommended Posts