Jump to content

Modding details? Ask away!


Amineri

Recommended Posts

Just figured out that Notepad++ also has a nice directory and in-file search for just that.

Found what you meant....dang, now how to get this to work with fresh Rookies.



function RandomizeStats()
{
local int iMultiple;

if( `GAMECORE.IsOptionEnabled( eGO_RandomRookieStats ) )
{
iMultiple = 5;
SetBaseMaxStat( eStat_Offense, RollStat( class'XGTacticalGameCore'.default.LOW_AIM, class'XGTacticalGameCore'.default.HIGH_AIM, iMultiple ) );

iMultiple = 1;
SetBaseMaxStat( eStat_Mobility, RollStat( class'XGTacticalGameCore'.default.LOW_MOBILITY, class'XGTacticalGameCore'.default.HIGH_MOBILITY, iMultiple ) );

iMultiple = 2;
SetBaseMaxStat( eStat_Will, RollStat( class'XGTacticalGameCore'.default.LOW_WILL, class'XGTacticalGameCore'.default.HIGH_WILL, iMultiple ) );
}
}

 

Edited by Hammerstein2k11
Link to comment
Share on other sites

  • Replies 399
  • Created
  • Last Reply

Top Posters In This Topic

 

Just figured out that Notepad++ also has a nice directory and in-file search for just that.

 

Found what you meant....dang, now how to get this to work with fresh Rookies.

 

 

 

function RandomizeStats()

{

local int iMultiple;

 

if( `GAMECORE.IsOptionEnabled( eGO_RandomRookieStats ) )

{

iMultiple = 5;

SetBaseMaxStat( eStat_Offense, RollStat( class'XGTacticalGameCore'.default.LOW_AIM, class'XGTacticalGameCore'.default.HIGH_AIM, iMultiple ) );

 

iMultiple = 1;

SetBaseMaxStat( eStat_Mobility, RollStat( class'XGTacticalGameCore'.default.LOW_MOBILITY, class'XGTacticalGameCore'.default.HIGH_MOBILITY, iMultiple ) );

 

iMultiple = 2;

SetBaseMaxStat( eStat_Will, RollStat( class'XGTacticalGameCore'.default.LOW_WILL, class'XGTacticalGameCore'.default.HIGH_WILL, iMultiple ) );

}

}

 

 

it's getting called every time the game creates a unit anyways, my main problem is that my code dosnt override the current code for some reason, i might be trying to get all the unit creation to be a Unit_NCE creation and it will call my function there

Link to comment
Share on other sites

I have a beginner's question.

I'm reasonable experienced in OOP, mainly C++ and Python. I never worked with Unreal before.

I'm very confused by the term "template". E.g. in the add weapon example they call it a template, but it seems all hard coded. Also the line

local array<X2DataTemplate> ModWeapons;

 

I don't get. It looks like a C++ code generation class template, but actually the class name X2Item_ModExample_Weapon is always used.

I looked also in the X2Item_DefaultWeapons.uc and was even more confused. Now there is not a a single weapon but the entire class holds a list or array of weapons and all properties are set hard coded but the default ini values.

So, is template class just a term or is there something more behind it. Maybe this is a unreal thing, so it would very kind to offer a link, the official online unreal documentation is rather sparse.

 

Thanks

 

So this use of "template" is a little more XCOM 2-centric, and not really an Unreal Engine 3 thing. It fits together something like so:

 

  1. Template base class (e.g. X2WeaponTemplate.uc).
    1. Extends X2DataTemplate.uc (root class)
    2. There's only one of these, and it defines all of the things that can be configured.
    3. It's a class and not just config data because templates can include delegate functions, which can't be defined in configuration files
  2. Template class instances (e.g. X2Item_DefaultWeapons).
    1. Extends X2DataSet.uc (root class)
    2. Creates a bunch of instances of X2WeaponTemplate and fills out details for each
    3. Native code runs any child class of X2DataSet to create the template instances when game is launched
    4. Not saved as part of savefile, but recreated each time game launches
  3. TemplateManager class instances (e.g. X2ItemManager.uc)
    1. Extends X2DataTemplateManager.uc (root class)
    2. Provides single access point to retrieve all data template instances created
  4. Gamestate instance (e.g. XComGameState_Item)
    1. Extends XComGameState_BaseObject.uc (root class)
    2. Creates a particular instance of something, such as a particular soldier's customized weapon
    3. Typically initialized using data from a template instance
    4. Saved as part of savefile, loaded from save when loading game

 

There is also an XComGameStateHistory that manages all of the gamestate objects, but that's more complex and getting away from your question about templates.

Link to comment
Share on other sites

Does anyone know how to add multiplayer units into the single player barracks? I have looked at the .ini's for the soldier classes and there is a variable bMultiplayerOnly. How would I make this so advent troops(from multiplayer) can be loaded/recruited into them? I know they would work in the stat department as you can nickname them online. However, from what I have seen, only human soldier pawns can be added to the barracks. Any help would be super useful. Thanks.

 

P.S I just really want an ADVENT MEC as a soldier.

 

The game makes certain assumptions about classes, but you may be able to to what you want in the ClassData.ini.

 

You'd need to add your new class to XComGame.X2SoldierClass_DefaultClasses section.

Then create a new section for [AdvSoldier X2SoldierClassTemplate] in the same config

Link to comment
Share on other sites

@Amineri

 

Do you have any pointers to where it would be good to hook up to something health/damage related where i could call a method on XComGameState_Unit to adjust the units aim based on the current health?

 

Aka Red Fog..

 

been trying to get help for days :(

Link to comment
Share on other sites

Is it possible to make the Tuturial mission playeble.

Like, timer, objetive go to the entracne of the facility, scout, engage, get reinforcment from explosive group,

Open door, find pod, escape.

And make a tight schedual like 5 or 6 turns, and more reinforcment from turn 4-6. So that you have to push to get away.?

 

This would require heavy work in Kismet, which is where most of the mission scripting is handled. Kismet is located inside the umap files. I'm not sure which is for the tutorial.

Link to comment
Share on other sites

@Amineri

 

Do you have any pointers to where it would be good to hook up to something health/damage related where i could call a method on XComGameState_Unit to adjust the units aim based on the current health?

 

Aka Red Fog..

 

been trying to get help for days :sad:

 

Sorry, I'm going to have to slow down on answering questions on how to develop specific mods -- basically only if it illustrates some general principle of modding. I wish I had the time to help everyone, but my own coding productivity that last few days has really tanked :(

 

I'll still be dropping in once a day, but need to get back to coding myself. Plus still a lot for me to learn :)

Link to comment
Share on other sites

Hi Amineri

 

Most of the posts in this forum (including my last question) seem to have disappeared for some reason.

 

Anyhow, I'm sure you can help me with this. I'm trying to override some of the functions in XComHumanPawn but the game crashes whenever I load a game. The soldier "lurking" in the foreground of the main menu screen also fails to appear. Even if I don't change anything the game still crashes when I override anything.

 

If I check the launch log I get these errors appearing:

Warning: SpawnActor failed because template class (XComHumanPawn) does not match spawn class (XComHumanPawn_BigHeads)

 

It looks like I also need to modify a template class somehow but I don't know where to look to do that. What am I missing here?

 

Thanks!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...