Jump to content

Modding details? Ask away!


Amineri

Recommended Posts

Hi, Amineri, one more question:

How to show any dialog on InstallNewCampaign?

I try to do that:

   local XComPresentationLayerBase presentationLayer;
    local Albeoris_RichHeritage_SelectFacilitiesDialog selectFacilitiesDialog;

    presentationLayer = XComPlayerController(class'UIInteraction'.static.GetLocalPlayer(0).Actor).Pres;
    selectFacilitiesDialog = presentationLayer.Spawn(class'Albeoris_RichHeritage_SelectFacilitiesDialog', presentationLayer);
    presentationLayer.ScreenStack.Push(selectFacilitiesDialog);

It displayd but instantly disappeared because into movie was played.

How can I avoid this?

 

P.S. I do not want to override any default functions, so as not to break compatibility with other mods.

 

Also I am try to handle Hide call but no one has hidden a my window.! O.o

simulated function Show()
{
    `log("Showing...");
    super.Show();    
    `log("Shown!");
}

event Destroyed()
{
    `log("Destroyed");
    super.Destroyed();
}

simulated function Hide()
{
    `log("Hiding...");
    super.Hide();    
    `log("Hidden!");
}
[0031.28] ScriptLog: Showing...  // <<<<<<<<<<<<<<<<
[0031.28] ScriptLog: Shown!  // <<<<<<<<<<<<<<<<
[0031.81] Log: --- LOADING MOVIE START ---
[0032.25] Log: Movie Started Event: CIN_TP_Intro
[0032.48] Log: ###### OnlineEventMgr waited 0.00 seconds for saves to complete
[0032.48] Log: LoadMap: Avenger_Root?Name=Player?Team=255?game=XComGame.XComHeadQuartersGame
[0032.64] Log:
[0032.72] Warning: Warning, Using a non-qualified name (would have) found: SwfMovie gfxStrategyComponents.gfxStrategyComponents.StrategyComponents
[0033.00] Log: Missing cached shader map for material OverWorld_Terrain_Master, compiling.
[0033.00] Warning: Redscreen: Compiling OverWorld_Terrain_Master at run-time, please ensure this is part of the cooking process
[0033.29] Log: Game class is 'XComHeadquartersGame'
[0033.36] Log: Bringing World Avenger_Root.TheWorld up for play (0) at 2016.02.13-17.53.25
[0033.37] Log: Bringing up level for play took: 0.076904
[0033.39] Log: ########### Finished loading level: 0.912885 seconds
// Has no message about hiding anything. O.O
Link to comment
Share on other sites

  • Replies 399
  • Created
  • Last Reply

Top Posters In This Topic

class XComGameState_Unit_RedFog extends XComGameState_Unit;


function InitializeMod()
{
	local object ThisObj;	
	ThisObj = self;
	`XEVENTMGR.RegisterForEvent(ThisObj, 'PlayerTurnBegun', OnTakeDamage);
	`XEVENTMGR.RegisterForEvent(ThisObj, 'AfterActionWalkUp', OnRemovedFromPlay);
	`log("redFog Initiated!");
} 
function EventListenerReturn OnTakeDamage(Object EventData, Object EventSource, XComGameState GameState, Name EventID)
{
	`log("redFog Activated!");
    ActivateRedFog(XComGameState_Unit(EventData));
    return ELR_NoInterrupt;
}
function EventListenerReturn OnRemovedFromPlay(Object EventData, Object EventSource, XComGameState GameState, Name EventID)
{
	`log("redFog DeActivated!");
    RedFogReturnToNormal(XComGameState_Unit(EventData));
    return ELR_NoInterrupt;
}

Hello, does someone has any idea why this wont proc when the events are triggered? the InitializeMod() was called and produced an output so i think it should work, this is probably my last hurdle to a working redfog

 

 

EDIT: nvm i figured it out, it just wasnt saved. Red Fog is done and should be on the store right now

Edited by Guest
Link to comment
Share on other sites

I have one final question and I'll stop bothering you, I promise!

 

Is it possible to override just a single function from a class without having to override the entire class? Failing that, how would I overwrite an entire class with another class which inherits it? A bit of context on what I'm trying to do:

 

I want to make Blademaster give +2 damage to conventional swords, +3 damage to magnetic swords and +4 damage to beam swords, as well as +0 armour penetration to conventional swords, +1 armour penetration to magnetic swords and +2 armour penetration to beam swords. Following the example of the Gremlin, I'll need to expand the X2WeaponTemplate class into, say, an X2RangerSword class. This new class will hold the added Blademaster extra damage and extra armour penetration values based on the sword's tech level. This brings up two problems:

 

1. I'll need to override three methods in "X2Item_DefaultWeapons.uc", specifically "CreateTemplate_Sword_Conventional()", "CreateTemplate_Sword_Magnetic()" and "CreateTemplate_Sword_Beam()" in order to have them build an X2RangerSword template, rather than an "X2WeaonTemplate" template, in order for me to add the extra damage and armour penetration for each individual sword.

 

2. I'll need to override one method in "X2Ability_RangerAbilitySet.uc", specifically "Blademaster()", such that it alters the damage buff it applies based on the sword's own tech level, as well as figure out a way to apply an armour penetration buff, which I'll probably end up pulling from the definition of AP rounds. *edit* Found the "X2Effect_APRounds.uc" which controls armour-piercing rounds, which is just a special-case "X2Effect_Persistent". I can make my own version of this, so that's that problem sorted.

 

There are still other things I'm not entirely sure how to do, such as add new entries to the ini files and actually have them read (can always hardcode, would like to not have to do that) and handle armour penetration since I don't know if a buff for that even exists, but that's solvable through more code diving. My primary issue right now is I'm missing the starting point. How do I alter the behaviour of an existing in-game class without overriding too much code? How would that even happen? I'm used to programming where I control the starting point - the main method - from where everything is called. How do I ensure my newly-created classes get added to the game without literally changing the game's own files?

 

Apologies for the scattershot questions. I'm trying to gain a deeper understanding of how UnrealScript works on a fundamental level, and this exercise seems like a good starting point since it's mostly stuff the game already does by itself. I'm missing the starting point, though.

Edited by SteelRook
Link to comment
Share on other sites

 

Hello again Amineri.

 

I've encountered an issue where skeletal meshes, such as the magazine and the trigger, connected to my weapon mod are in places they shouldn't be when in-game. When I load the skeletal mesh in the AnimSet Editor and put on Extra Meshs onto the Base of the weapon they are placed in their correct spots. I'm not entirely sure what may be causing this issue and I was wondering if you knew anything that could cause this problem. If you need me to provide pictures of what I'm talking about please let me know.

 

Thanks!

 

If you based your model off of something like the Assault Rifle, but modified the skeleton for your own weapon, then this is likely the culprit. We experienced this same issue with the SMGs.

 

The problem is likely the re-use of the AssaultRifle (or what you based on) animation set, as defined via the weapon archetype. When you actually play the animation, it will snap the skeleton back to the original Assault Rifle positions. So if you modify the skeleton, you properly should create a new animset.

 

Also, weapon attachments shouldn't be previewed via the "Extra Meshes" -- attachment are connected via Sockets, so you should preview attachments by loading the preview mesh in the Socket Manager for the Skeletal Mesh. Note that some of the sockets aren't connected to the root bone, but are connected to other bones instead. Hence if the skeleton deforms during the weapon animation, and the socket is attached to a bone that is moving, the attachment will move. This is often a desired feature :smile:

 

The way we got around this for the SMGs (in particular the conventional one where the Magazine bone is in a completely different place) was to attach the Mag socket to the root bone instead of to the Magazine bone. That way when the animation deformed the skeleton, the socket didn't move.

 

Hope this helps!

 

 

Hello again!

 

I was able to resolve the issue by adjusting the sockets to different places, so thank you for the help on that. However there's another issue. Whenever the soldiers are in-game and shoot at an enemy the magazine and charging handle slide to a different place. After the soldier has finished firing his shots the magazine and charging handle go back to their previous place. I'm assuming there's another animation that takes place right after the soldier lines his rifle up with an enemy, but I'm not entirely sure. Would you happen to know what might be causing this?

 

Edit: This happens even if I switch the animation sequences, I took from the conventional assault rifle, with animation sequences from the magnetic rifle.

Edited by Negativz
Link to comment
Share on other sites

I'm having some difficulty with audio issues. My goal is just to replace one sound with another, external sound. I've imported an appropriate file, set up the sound cue for it in it's own package. Playing that cue works fine in the editor. Then I went into the soldier_ANIM.AS_Soldier, and replaced the original akEvent with my new sound cue. Playing it in the animation set editor plays the correct sound, however I'm not sure what I have to export/write in the IDE to make it work in the game. I've included both the new upk, and the soldier_anim.upk, everything builds fine, but the debug won't play the sound when appropriate. I've looked at other mods that incorporate .upks, but I didn't see any specific .uc or anything that mentioned the upk to be included. What am I missing?

Link to comment
Share on other sites

Figure I might ask here as well as the topic I made, in case some only look here.

 

The things I most want to learn to do when modding this game currently, is introducing additional classes, and attempting to bring back elements of Enemy Within that seem to have gotten scrapped in XCOM 2.(The Meld stuff, Genemods and MECs)

 

I assume MECs would be a rather drastic undertaking, but aside from not knowing how to use modbuddy just yet, I feel like making a class or implementing genemodding might be somewhat simpler. Can anyone help me get started with such an undertaking? I can likely fiddle a lot more once I have a baseline understanding of what I'm doing with modbuddy. Thanks in advance!

Link to comment
Share on other sites

Hello, guys. Nice thread you have here Amineri.

 

Probably a stupid question but it seems that I can't find the PCS/gun mod loot table. I just finished a run that is not anywhere near rushed and for some reason I've only seen a single piece of Perception PCS. I found it on the Blackmarket. It's really weird that RNG gave me one of these when I have dozens upon dozens of other PCS/gunmods. I'm thinking that one mod I installed accidentally messed up the loot table or something.

 

P.S. Is the Long War crew going to do another Long War or Long War-like for XCOM 2? I really feel the game is... Kinda empty after experiencing Long War.

Edited by xanieeee
Link to comment
Share on other sites

Simple question. I need to add class exclusivity to a grenade, but can't figure it out. I want the grenade to be equippable only by the Psi Operative. I've tried to use "Template.Requirements.RequiredSoldierClass = 'PsiOperative';" but it doesn't seem to work. Thanks in advance.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...