Search the Community
Showing results for tags 'instance'.
-
Can't say if this has been adressed recently but I'm getting this error message upon installing certain mods, or trying at least. "Object reference not set to an instance of an object". I recently had to reinstal Fallout 4 but since I didn't have to reinstall Skyrim, I didn't bother uninstalling the Nexus Mod Manager. Now, this message appears when I try to install certain mods. It started with the CBBE body type but after a while, I managed... somehow... then a gun, the MP40. Didn't bother trying again. Now, with Do it Yourshelf and Movies of the Wasteland. OCDecorator was acting up but, again, out of nowhere, it installed correctly. If anyone can help, I'd be grateful. And no, do not direct me to that locked 5 year old thread. That's as out of date as troglodytes.
-
Short Background: I had an idea for a "simple" (aren't they all..) mod for the Enemy Unknown, tried it, was too hard to make work, and promptly forgot about it. Enter in XCOM 2 with official modding support and the old idea came back to me. Good news, I've been able to get the mod working, after many trials and tribulations (while the mod is still simple in terms of what it changes, it's a purely gameplay/programing and the new games systems are much more involved requiring more learning/trial and error). While I'm happy that it's working, I have the feeling that I'm probably not doing it in the "best" way and in order to do that I probably need to know more about how the underlying game is setup. Which leads to my question.. What is the difference between Templates and the standard XCom Classes? The best example is probably X2Ability and X2AbilityTemplate? Obviously they are both technically classes, which I understand fine in the Object Oriented stance, but for whatever reason I'm finding it a bit unintutive how the game is actually *using* these things. I've tried to read as much as I can, search, tutorial guides, but can't find anything that lays it out bare (just bits and pieces I've been able to hopefully glean and try and piece together). If there is place where it's all spelled out that I've somehow missed, I'd be terribly grateful if anyone can point me the correct direction. I am *guessing* that many of the "Non-template" classes aren't used in the traditional ways? (where they are instanced into Discrete Objects, possibly many of them, and those Objects are used, modified and manipulated through the course of their existence). My particular mod has the modest goal of changing the RNG Roll probability distribution in toHit Calculations (trying to make it *appear* subjectively to be more "fair". Currently trying out a crude average Sum of 2 Rand rolls, but that discussion is for a different topic...), and that required Overriding a few toHitCalc Class/Object(s) which was straightforward enough and fine. However those object(s) are used by Abilities and are "attached" to them, and due to a quirk in the way the vanilla game is set up, the Abilities that used my new overriden Classes/Objects weren't set up to automatically attach. Which required me to look into those problematic Abilities and try to "fix" it myself, which is where the confusion arouse. What my current (at best incomplete, and more likely completely wrong) idea is that the Game doesn't actually use say X2Ability in the regular sense. This class is NOT instantiated into an X2Ability Object, which would then represent the ability in the game, called to handle any time a weapon uses that ability, and then it uses it's own toHitCalc objects etc, to do the "work" of using that ability? Instead it seems like this X2Ability Class, is maybe instantiated once (or a small number of times) into an object, and this object is then used to "produce" an Ability Template Class/Object (specified by X2AbilityTemplate). Essentially it creates and then "fills out" all the required (predetermined) fields of this Template object, and sends it out into the world. And at that point the work of the X2Ability Object is done? Further then, this newly Created/Filled out X2AbilityTemplate object is also NOT technically used in the typical way in that there are not many copies/instances of it out there being used to handle the "work" of an ability when weapons are fired/used etc like mentioned above. It is not the games internal representation of an Ability either, and doesn't live a life, being changed or whatnot etc? But rather this Template object (and maybe again only a single copy/instance) is kept on hand by the game and actually used to construct another Class/Object, the final result a type of GameState object. These gamestate objects are linked to their base-template, in the sense that they refer to them to do certain things, but they themselves ARE the games internal representation of an entity, and contain all the information (that may be updated,changed etc) as that entity goes through it's existence in the game? This is where things start to really decouple in my mind, as I guess I can follow that train if we are talking about a Soldier or whatnot, but with respect to an Ability, the distinction between AbilityObject, AbilityTemplateObject and then AbilityGameStateObject really starts to break down/blur. I guess it seems odd to me that it would be broken out this way with so many individual pieces, instead of just a single object? With respect to my specific mod, I need to make sure that the correct "Abilities" are refering to my modified toHitCalc Object. I can just start overriding classes left right and center (which in my first version I have), however those numbers start to add up as it seems all "information" regarding what we'd outside of the game describe as an "entity", is spread out over multiple classes/objects. This is the part that feels like I'm not doing it the "right" way, especially if some of those classes exist in only certain, brief, circumstances, it might be unnecessary to go replacing them all at will. A possibly better way to put it, if my above understanding it's too flawed (a big "if"...) is that do I need to replace the entire "factory" (X2Ability Object) if it's only ever producing a single "flawed" product (an X2AbilityTemplate object), or would it be better/easier/possible just to "fix" (modify and/or replace?) directly and leave the factory untouched. My apologies again if I've missed something glaringly obvious. I guess it's only fitting that my initial idea for such a "simple/small" mod would be one that actually touches a variety of system components. Thanks for any input, help and or advice.
-
Hey guys, I've been trying to add looping sound to an armor enchantment but I've had problems to make the sound stop when the item is unequipped. Here's my script: Sound Property MySound Auto Actor Player Event OnInit() Player = Game.GetPlayer() EndEvent Event OnEffectStart(Actor akTarget, Actor akCaster) If (akTarget == Player) || (akCaster == Player) MySound.Play(Player) Else MySound.Play(Player) Int InstanceID = MySound.Play(Player) Sound.SetInstanceVolume(InstanceID, 0.5) EndIf EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) Int InstanceID = MySound.Play(Player) Utility.Wait(0.2) Sound.StopInstance(InstanceID) EndEvent The sound doesn't stop onEffectFinish because the InstanceID is no longer the same one it was "OnEffectStart" so it loops forever. I've been trying to ID the instance in a seperate function but get the same result. I solved this by passing my sound as music and using Add() and Remove() - which works fine but is unsatisfactory as it ducks the main background music for as long as the item is equipped. Anybody has an idea how I could remedy that? Many thanks and Happy New Year to all :). Hoamaii
-
This is something I couldn't find a solution for. I don't necessarily mind that the dialog exclamation markers after a story event or combat encounter go away if you ignore them, but it would be nice if they lasted longer, like enough to revive fallen party members. I would also like it to never go away if you're already in dialogue with someone; example: After Malady brings the Lady Vengeance back from the Hall of Echoes, there is a forced dialogue with her, and my companions also have instanced dialogues waiting, but to have any chance of getting to those, I have to skip through the Malady conversation, which is character and plot significant. What I ended up doing was doing the Malady dialog normally, memorizing the options I wanted, then reloading, spamming through it and then talking to my companions, but this is hardly the fun way to play.
-
- instance
- exclamation marker
-
(and 3 more)
Tagged with:
