Jump to content

kosmo111

Members
  • Posts

    33
  • Joined

  • Last visited

Nexus Mods Profile

About kosmo111

Profile Fields

  • Country
    None

kosmo111's Achievements

Explorer

Explorer (4/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. So I've been away from modding XCOM2 for a while but have come back to an old idea I wanted to play around with: adding the UT Announcer to Tactical Missions (Mah-Mah-Mah-MONSTER KILL-KILL-KILL). I was wondering if anyone has found a way to play custom SFX from a UIScreenListener? I appreciate any assistance. Thanks!
  2. If you want to look into making it passive, I would suggest looking into something like Ever Vigilant (located in X2Ability_SpecialistAbilitySet) -- but instead of granting overwatch grant an extra action like Run And Gun.
  3. Correct. During initialization I would do the following: function XComGameState_LifetimeStats_Unit InitComponent() { stats = new class'LifetimeStats'; stats.initComponent("Main"); return self; }
  4. I think you misunderstand-- the original object is a XComGameState_BaseObject and is added to XComGameState_Unit as a component object. What I'm trying to show here is that when using Component objects, it is not safe to use normal UnrealScript classes inside of the Component object.
  5. So I just ran into a very strange bug and I figured I would share it here so others might avoid the issue. The TLDR is that regular class member variables of GameState objects will persist fine during gameplay-- but will not survive being persisted to the save file. Loading a game does not load the object. ============================================= My mod LifetimeStats created a new XComGameState_BaseObject: XComGameState_LifetimeStats_Unit which was added as a component to XComGameState_Unit for all XCom soldiers. In a recent update, i switched from storing the stats of the soldier from primitives (ints and floats) to a helper class: LifetimeStats.uc LifetimeStats was a regular UnrealScript class. I had assumed that any fields of a XComGameState_BaseObject subclass would persist across saves and while I was testing it everything seemed to work. I would take shots and the shown values would update. I never bothered to test taking some shots, saving and then loading the game-- which in this case causes the data to be lost. I have since changed the way I am storing the data to instead have even the LifetimeStats object extend XComGameState_BaseObject. Like many other base classes however, I do not store the actual objects-- I store StateObjectReference's to them. To show this in a bit more detail, this is how the class used to be (and it worked fine) class XComGameState_LifetimeStats_Unit extends XComGameState_BaseObject config (LifetimeStats); var int numShots; var int numHits; var int numMisses; ... Here is how it was when it was broken: class XComGameState_LifetimeStats_Unit extends XComGameState_BaseObject config (LifetimeStats); var LifetimeStats stats; ... //In LifetimeStats.uc class LifetimeStats extends Object; var int numShots; var int numHits; var int numMisses; And here is how it is now: class XComGameState_LifetimeStats_Unit extends XComGameState_BaseObject config (LifetimeStats); var StateObjectReference mainStatsRef; ... //In LifetimeStats.uc class LifetimeStats_Stats extends XComGameState_BaseObject; var int numShots; var int numHits; var int numMisses; ... This was difficult to write and I'm sure its a bit confusing but I hope I got my point across. Let me know if you want me to describe the issue further or if anyone knows specifically why this failed. Thanks
  6. Or, as an alternative, use the Steam beta system to allow developers to test and fix their mods before the regular user base gets it.
  7. Well, I think the easiest way would just be to show you an example. In my mod I needed a way to update data every time a new soldier was 'focused' during tactical play. So I used this in a UITacticalHUD ScreenListener: `BATTLE.WorldInfo.MyWatchVariableMgr.RegisterWatchVariable( XComTacticalController(`PRES.Owner), 'm_kActiveUnit', self, updateStats); This is (to my understanding) saying that whenever the m_kActiveUnit variable located in the `Pres.Owner instance of XComTacticalController is directly changed (like, assigned via an = operator), call the updateStats function located in the 'self' object. You may be able to do something similar to achieve the same results if you can find a variable that can be watched and changes at the correct times. If you are curious, my Lifetime Stats mod does this in the LifetimeStats_ScreenListener.uc class (which is more updated on the Workshop than on the nexus).
  8. Could you maybe try getting around it by registering a watch? I have not played around with this screen, but would 'm_iSelectedSlot' be changed reliably enough to give you the update tick you need?
  9. Its worth mentioning that source control also gives you the ability to see the changes you've made over the history of the mod. This way you can tag each version and easily see which files have changed with each new version-- or if necessary revert back to a known working version without fear that some of your new code stuck around. I love version control and would never code without it. For my mods I use it even though I am the only developer. I don't even push the changes out anywhere, its a purely local system that I use just for the reasons mentioned above.
  10. I have been trying to use UIStatLists with AnimateScroll to show a large amount of data to the user, however there is an annoying bug I cannot seem to fix. If you modify the contents of the panel while it is scrolling, the panel does not properly reset. To clarify, this is exactly what the Shot Wings do (where it shows the breakdown of your hit and crit chances). If there are enough fields to require scrolling, and while the fields are scrolling you switch targets, the animation starts over without resetting back to the top. This leads to a situation where eventually all of the information might be off the screen. My Lifetime Stats mod uses a similar panel to show the breakdown of shots/hits/misses/... of a soldier and in order to get it to work properly I had to do really ugly things. I would much prefer if I could just call ClearScroll (as the API would seem to imply) rather than the duct tape code I had to write. Has anyone found a solution to this?
  11. Keep in mind that whenever you extend a class, you automatically inherit all of their member variables as well. In some cases, you inherit them even though you do not have access to them. This can lead to confusing situations where there is an ambiguity in which variable will actually get used based on the current scope. I do not know how unrealscript handles this, but in other languages I've used it all depends on the calling codes scope. If in the above example BaseGameClass has a function foo() that accesses BaseClassVar and you do not override foo in your subclass-- it would look at the only variable within its scope that matches that name. It is generally bad practice to do this because of the confusion it can cause as two functions that access a variable with the same name might access two totally different variables. For safety reasons, you should avoid declaring a variable with the same name as a variable in your parent-- some languages will not even allow you to do this.
  12. I have noticed that every time I update my mod on the Steam Workhop, the INI that I deploy with replaces their existing INI. To clarify, my mod uses its own INI file that allows them to configure various aspects of my mod. This is not relating to changing the default INI files the game comes with. I have a few settings in the INI that I would like to respect across updates. Is this possible? On a side note.... every time I deploy steam resets my name/description to the default and I have to update them manually on the workshop page. Is that normal?
  13. Alright, thanks for the tips guys. I don't think I need to play with the flash to do what I want to do anyway-- it was more just a growing interest I had as I found more and more references to them as a possible alternative to trying to do it all by hand.
  14. http://forums.nexusmods.com/index.php?/topic/3834670-cross-mod-function-calls/page-2 is the post davidlallen mentioned. Essentially you guys already touched on most of the related issues-- however towards the end of the thread tracktwo goes into slightly more detail on how to do it should you still be interested. One thing I am doing to hopefully help this issue in my mod is to keep a version number around. Essentially, for my own purposes or for others, I can check what version of the mod the user is currently using (based on objects saved in the GameState) that way the mod can be gracefully updated. If the mods you are trying to work with have this, you could always make sure that the version is one that you support before doing any cross mod function calls.
  15. I was wondering if anyone has played around with these systems at all? They seem to be how the 'fancier' displays are created within the game and are fairly well hidden to us in the unreal source code. A good example (and the one I happen to be interested in) is located in UIUtilities_Strategy.uc and pertains to the soldier ability summary list on the Armory screen. http://i.imgur.com/cVIsgTp.jpg I have taken a bit of code from various places to reconstruct how I believe the 'Soldier Abilities' list is populated as an example. Please note that this is pseudo code and will not compile as written, it is simply meant to show what is happening in a concise manner. local UIArmory Screen; // Assume is initialized properly for this example local XComGameState_Unit; // Assume is initialized properly for this example local string TmpStr; // Used when adding things to the UI // This sets the title of the ability list, in english to "Soldier Abilities' Screen.MC.FunctionString("setSummaryTitle", default.m_strAbilityListTitle); // This notifies UIMCController (the thing that interfaces with the flash UI) // that we are about to give it data about the AbilitySummaryList Screen.MC.BeginFunctionOp("setAbilitySummaryList"); // Pseudo-code to iterate over all abilities of a unit, just to show whats happening foreach AbilitiesToShow(AbilityTemplate) { // Adds this abilities icon to the list Screen.MC.QueueString(AbilityTemplate.IconImage); // Adds this abilities name to the list TmpStr = AbilityTemplate.LocFriendlyName != "" ? AbilityTemplate.LocFriendlyName : ("Missing 'LocFriendlyName' for '" $ AbilityTemplate.DataName $ "'"); Screen.MC.QueueString(TmpStr); // Adds this abilities description to the list TmpStr = AbilityTemplate.HasLongDescription() ? AbilityTemplate.GetMyLongDescription(, UnitState, CheckGameState) : ("Missing 'LocLongDescription' for " $ AbilityTemplate.DataName $ "'"); Screen.MC.QueueString(TmpStr); } // This notifies the UIMCController that we are done adding things to the AbilitySummaryList Screen.MC.EndOp(); My understanding of what is happening here is that somewhere not in unreal script a 'flash function' named setAbilitySummaryList exists and it takes a set of parameters in groups of three. Essentially, the Nth string is considered an icon, N+1 is considered a name and N+2 is considered a description-- then N is incremented by 3 until the list is exhausted. This allows them to build specialized UIs outside of unrealscript while still allowing the data to be easily and dynamically added/altered via scripts. Does anyone know if these flash functions can be created or added to existing screens? Or if there is any other way of interacting with them? Or at least getting the list of functions?
×
×
  • Create New...