Jump to content

Modding details? Ask away!


Amineri

Recommended Posts

So I found out - Kelly is generated by TutorialSoldierAppearance which is set in XComGameData.ini (each body part separately) so I think she is not taken directly from character pool.

In theory I can create new array and then create soldier from that.

 

 

But I still have questions about scripts. Why does this script (I tool it from Load character pool) works for this mod but when I try to compile it project can't be built?

static event OnLoadedSavedGame()
{

    local CharacterPoolManager pool;
    local XComGameState_Unit poolUnit;
    local TDialogueBoxData kDialogData;
    local String dialogueText;
    local String dialogueTitle;

    dialogueText = "Test message";
    dialogueTitle = "Test message from Tomm";



    kDialogData.eType = eDialog_Normal;
    kDialogData.strTitle = dialogueTitle;
    kDialogData.strText = dialogueText;
    kDialogData.strAccept = "OK";
    Menu.Movie.Pres.UIRaiseDialog(kDialogData);
}

The problem is in last line - Menu.Movie.Pres.UIRaiseDialog(kDialogData); . It initiates message box, doesn't it?

I can't believe SDK doesn't have a script checker which tells me what line is wrong/

 

 

 

I DO get message about which lines have errors -- you may need to check the VS Shell verbosity settings.

 

The problem with your particular code is that the token "Menu" is probably out of scope in your mod class. I'd try changing the last line to something like :

 

`HQPRES.UIRaiseDialogue(kDialogueData);

 

Also, dialogues generally define a callback delegate that specifies which code to execute on each button-press respones.

Link to comment
Share on other sites

  • Replies 399
  • Created
  • Last Reply

Top Posters In This Topic

Hi hi,

 

How do I add mitigation, mitigation chance and stuff to armors? I can't find the Uscript that defines these things and they aren't defined for the Medium Plated Armor, Kevlar and Light variations of all armors.

 

Thank youuu!

 

These are generally defined via an X2Effect class, in particular a child of X2Effect_Persistent.

Link to comment
Share on other sites

 

 

It's unrealscript. I didn't know anything about it either, just mimicked the syntax and structure of existing code.

 

Aha! OK, that would explain why it's so unfamiliar to me. I've done C++ back in the university and C# for Space Engineers Coding Blocks, but this looks like neither of those. "Unrealscript." That puts a name on the enemy and gives me something to work with. Thank you kindly :smile:

 

*edit*

And for the record, a token search now that I know what I'm searching for revealed that the ` is a "preprocessor" used to define code macros - simplifications to the extended into full code before compilations. The one that was really stumping me in the code files was always `HISTORY, which I now suspect is a shorthand macro for a more complicated method call. It's not in the UDK default macros list, so I presume it's XCOM specific, which means it must be defined somewhere in the class inheritance chain. I feel less lost now, thank you.

 

 

The list of macros is defined in a file globals.uci in the /XCOM 2 SDK/Development/SrcOrig/Core/ directory. In practice I find I very rarely reference that file, though -- just copy/paste from Firaxis source.

 

Also, if anyone happened to be using UE Explorer to look at the decompiled code in the XComGame.u, there won't be any macros, of course, because UE Explorer doesn't know about that. :)

 

Some handy links for people picking up Unrealscript (which is pretty much a dead language since Unreal 4 and Unity both use C#) :

 

https://udn.epicgames.com/Three/UnrealScriptHome.html

https://wiki.beyondunreal.com/UnrealScript_overview

Link to comment
Share on other sites

 

 

Tried adding the NonNativePackages and ModClassOverrides lines directly to DefaultEngine.ini and still no effect.

 

For starters, I have code in a class extending X2AbilityToHitCalc_StandardAim, overriding InternalRollForAbilityHit and GetHitChance, that should show Aim Assist modifiers in-game by moving the handling code from InternalRollForAbilityHit (well after GetHitChance is called and thus hidden) to the main body of GetHitChance, where I call AddModifier to insert Aim Assist effects like any other aim/crit/dodge modifier. Also plenty of log calls so that even if I screwed up somewhere there should at least be extra log output if my class is being used at all.

 

...and now I'm pretty lost as to how else to accomplish this.

 

 

I'm not really sure why it's not working, then. So far I haven't tried to override that class, just add new abilities/effects that adjust stats, which can accomplish a lot of the same effect, since such effects can be persistent and dynamic.

 

I might play around with trying to replace it later, if I have the time.

Link to comment
Share on other sites

Amineri (or anyone else that would already know about this sort of code trick, btw)....

 

In the LWS_OfficerPack.. is there an indirect way to alter the default Abilities Training time of 8 days to any other values via a newly exposed config setting call?

I understand we still could just use the INSTANTTRAINING=false toggle already included -- but to me having control over that delay would be more appropriate in terms of difficulty levels (Veteran to Legend, etc) and their steep MIN/MAX curves.

 

I simply don't want to touch that UC code. :wink:

 

It's me! Of course I made that configurable....

 

If you scroll down a bit in that same file XComLW_OfficerPack.ini, you'll find TrainingDaysForRank array, which defines the number of days required to train each particular rank. So you can make early training quicker, and later training slower, or whatever you prefer.

 

There's also the "RequiredRankPerOfficerRank", which controls what regular class rank is required to allow training of a particular leader rank. In both cases there are commented out versions with to allow much quicker testing.

 

You should be looking at the XComLW_OfficerPack.ini that's in the Mods folder in the game folder, not any version that may pop up in My Games.

Link to comment
Share on other sites

 

I am trying to make a variant of an advent trooper to add into the game. I am not trying to make something with reskins or different weapons, just want to make another type of Advent trooper that has some armor. Using the information here I created the X2_Character.uc and created an entry in the XcomGameData_CharacterStats. Since I am basing loot, ai, loadout, and art on the original Advent trooper, do I need to do anything else?

 

 

Also looking at the Centurion X2_Character.uc code I found this at the top

 

class X2Character_MutonM2 extends X2Character config(LW_MutonM2);

 

Is the that config file needed to making a variant of an existing unit in game if I am not changing anything damage or rangewise?

 

 

Yes, the config(LW_MutonM2) definition specifies that all config class variables in the class will be defined in a config file name XComLW_MutonM2.ini.

 

The XCom prefix is always assumed for all config files (replacing the Default prefix in the main game config folder). Each class can specify which config file it uses. So you can have a bunch of smaller configs, or fewer larger ones.

Link to comment
Share on other sites

Hi Amineri!

 

I know you've already said you don't handle the art side of things, but I was wondering if you can help me. I have a history as a 3D artist already, so the creation of assets isn't new to me, but I am new to modding, and I'd like to try putting my own Guns and Props into XCOM2 as a starting point.

 

Problems is, I have no idea where to start with this. I'm guessing it's pretty simple, and done mostly through the UDK bundled with the ModBuddy program, but if you could give me some information on how to get started and what have you, that'd be excellent :D

 

Probably the best bet would be to skip the Unrealscript side of things, and just jump into UnrealEd.

 

From there, you can make cosmetic changes by making copies of existing archetypes and linking them to new art. The whole Unreal art pipeline on that side is designed to be accessible to artists that aren't code-savvy.

Link to comment
Share on other sites

hello amineri do you know of a way of enabling/disabling the loading of ini files on demand?

 

 

"The whole Unreal art pipeline on that side is designed to be accessible to artists that aren't code-savvy." unlike the code part which is barely documented for us code savy people, not to talk of new coders

Edited by Guest
Link to comment
Share on other sites

 

 

I think I found the problem. The X2Ability_AdventMEC example is an exception to the rule, since many other ability templates do not use "new" to create X2AbilityToHitCalc. In the parent class X2Ability there are default properties:

DefaultProperties
{
	...

	Begin Object Class=X2AbilityToHitCalc_StandardAim Name=DefaultSimpleStandardAim
	End Object
	SimpleStandardAim = DefaultSimpleStandardAim;

        ...
}

and most abilities (including X2Ability_WeaponCommon.AddStandardShot) use this default instead:

Template.AbilityToHitCalc = default.SimpleStandardAim;
Template.AbilityToHitOwnerOnMissCalc = default.SimpleStandardAim;

..I'm not really sure how to go about getting all of the different abilities to use a different default HitCalc.

 

 

Very good find.

 

You're right about that. So, I guess you'd have to write a bunch of code to go through all abilities in the X2AbilityTemplateManager and change the Template.AbilityToHitCalc definition. Except that you don't want to do it in ALL cases, because some abilities have legitimate other to-hit functions, some of which are child classes of the base one.

 

So this may just be a case where the change is fundamental enough that it would require a replacement XComGame.upk to make happen.

Link to comment
Share on other sites

hello amineri do you know of a way of enabling/disabling the loading of ini files on demand?

 

 

AFAIK, the configuration file management is all stock Unreal Engine 3, unmodified by Firaxis. I'm not sure if the config merging is handled in native code (in XCom2.exe) or in one of the packages like Core.upk or Engine.upk.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...