davidlallen Posted February 18, 2016 Share Posted February 18, 2016 Why wouldn't you use `log and the launcher option -log? That is what the uc authors seem to do all over the place. Link to comment Share on other sites More sharing options...
Deleted32045420User Posted February 18, 2016 Share Posted February 18, 2016 Why wouldn't you use `log and the launcher option -log? That is what the uc authors seem to do all over the place.i use it all the time in red fog, it gives me soooooooo much information on what went wrong and where, once finalized i could remove them but it's unnecessary right now Link to comment Share on other sites More sharing options...
SteelRook Posted February 18, 2016 Author Share Posted February 18, 2016 Why wouldn't you use `log and the launcher option -log? That is what the uc authors seem to do all over the place. Mostly because I don't know how to use it. I don't know what you're referring to by -log and I've still not been able to find the `log files. My own fault, obviously, but still. Link to comment Share on other sites More sharing options...
Deleted32045420User Posted February 18, 2016 Share Posted February 18, 2016 Documents\my games\XCOM2\XComGame\Logs the `log(string str) command prints out anything inside the brackets, with the @ sign as an additive sign: `log("This is my int: "@SomeInt @" I Love my Int So much!"); let's say the int is 7 the output will be: "This is my int: 7 I Love my Int So much!" Link to comment Share on other sites More sharing options...
SteelRook Posted February 18, 2016 Author Share Posted February 18, 2016 I'll try that out, thank you. Although a pop-up in the middle of the game to tell me if the thing I was expecting to happen just happened would also help. Link to comment Share on other sites More sharing options...
davidlallen Posted February 18, 2016 Share Posted February 18, 2016 If you launch the game from the debug menu of the sdk, don't you see an extra console window come up and start spewing print statements? You can also get this extra window by right clicking the game in your library, properties menu, set launch options button, and enter -log into the field. Link to comment Share on other sites More sharing options...
SteelRook Posted February 19, 2016 Author Share Posted February 19, 2016 (edited) Minor problem not related to difficulty: Do you guys know of a good way to get access to the damage effects of an AbilityTemplate? The Blademaster ability has only one target effect - a single instance of X2Effect_BonusWeaponDamage. However, the XCOM 2 script is written with a lot of setter functions, but next to no getter functions. It's easy to add a X2Effect_BonusWeaponDamage effect, but doesn't seem very easy to actually pull that out of ability template. Now, I know they're all saved in a variable in there called AbilityTargetEffects, which is an array of type X2Effect. Since it only has one effect, I thought I could just reference that array directly and pull its 0 element, then typecast that to X2Effect_BonusWeaponDamage and try to pull data from that. This does not appear to work in the slightest, however. Something's clearly going wrong and I'm not entirely sure what. The reason I'm trying to do this is so I can pull the base Blademaster damage from the old Blademaster ability and transplant it into the new one without trying to dig into the ini files, but also in such a way that changing that in the ini files will nevertheless affect my mod. I'm not having much luck now. I'll have to try and follow your advise on logging to see what the hell is going on behind the scenes. *edit*Interesting... According to the logs, the 'Blademaster' ability has no AbilityTargetEffects - the array is empty and actually uninitialised, which is... odd. I know for a fact that the AddTargetEffect() function is called on the ability at least once in X2Ability_RangerAbilitySet. The only thing I can figure is the variable is somehow protected and not accessible outside the class. It's declared as "protectedwrite," which as far as my research could uncover is not actually a "protected" variable, in the sense of being unusable outside the class and its subclasses. "protectedwrite" seems to make the variable unable to be written to outside its own class and its subclasses, but that shouldn't make it incapable of being read... Should it? If that's the case then what's the point of the keyword when "protected" does the same thing? Clearly I'm missing something here. Oh, boy... Can I typecast an object to a class that it's very clearly not if the class I'm casting to is a subclass of the object's actual class? Would that even do anything? Edited February 19, 2016 by SteelRook Link to comment Share on other sites More sharing options...
Kvalyr Posted February 19, 2016 Share Posted February 19, 2016 (edited) Oh, boy... Can I typecast an object to a class that it's very clearly not if the class I'm casting to is a subclass of the object's actual class? Would that even do anything? I wish. I've been trying to bypass unreliable ModOverrides by downcasting existing objects (such as Units or UIScreens) to my own subclasses of their class; but sadly that doesn't appear to be possible in UnrealScript. Objects can be cast to parent classes of their class, but not to subclasses.Trying to cast to a subclass silently fails and returns None. I had hoped that I'd be able to do things like replacing every XComGameState_Unit with a custom subclass with overriden methods instead, for instace; but alas no. Not without doing funky things like silently firing/hiring soldiers (which actually just crashed the game, too). Fun. As to your earlier questions about difficulty-variants of templates at the main menu, Amineri already confirmed what I've said about it (i.e.: It doesn't work):http://forums.nexusmods.com/index.php?/topic/3798185-added-a-new-gamestate-object-to-all-soldiers/?p=34716670http://forums.nexusmods.com/index.php?/topic/3798185-added-a-new-gamestate-object-to-all-soldiers/?p=34717290 I think your best bet is to just accept that it can't be done at the main menu and just handle it with a loop and temporary difficulty-change at the AvengerHUD OnInit. If you do it right, there's no reason to think that it will affect a players' achievements or difficulty state etc. Edited February 19, 2016 by Kvalyr Link to comment Share on other sites More sharing options...
SteelRook Posted February 19, 2016 Author Share Posted February 19, 2016 (edited) As to your earlier questions about difficulty-variants of templates at the main menu, Amineri already confirmed what I've said about it (i.e.: It doesn't work): http://forums.nexusmods.com/index.php?/topic/3798185-added-a-new-gamestate-object-to-all-soldiers/?p=34716670http://forums.nexusmods.com/index.php?/topic/3798185-added-a-new-gamestate-object-to-all-soldiers/?p=34717290"When templates are retrieved in the shell, it defaults to difficulty 1 -- Veteran." Have you ever had the urge to grab a programmer by the lapels, shake them and yell "What were you thinking?!?" in their face? Getters and setters are basic OOP functionality. Yes, you don't always need or indeed want them for everything, for you generally want specific getters and setters for major stuff that multiple classes are going to need. XCOM 2 doesn't seem to have that for objects. It HAS getters in the form of Find____, but they're all internally obfuscated to filter your search in ways that you can't control. What was the big issue with simply creating a "find" function which accepts a name and a difficulty tag, then overloading it with the "more common" find function which only accepts a name tag and pull difficulty directly? I'm starting to get really, really frustrated now. What the hell was the point of giving us modding tools if half the stuff is hidden in pre-cooked C++ functions and the other half is set in stone? Sorry, sorry... It's just getting frustrating to me. Not your fault at all. Thank you for the advise. I think your best bet is to just accept that it can't be done at the main menu and just handle it with a loop and temporary difficulty-change at the AvengerHUD OnInit. If you do it right, there's no reason to think that it will affect a players' achievements or difficulty state etc.Unfortunately, that's not an option. Weapon stats reset themselves every time the game starts. What this means is that if I save my modded game in a mission and then quit because it's time for dinner, my modded weapons will "un-mod" themselves when I come back tomorrow and reload my tactical save. This basically means that the mod will break if you close the game in the middle of a mission. I HAVE to re-run the script every time the game starts. That leaves me with two options. One is Animeri's advise here: It's possible to set one up listening to "none" (and hence all) UIScreens. Then test whether the game is in either strategy or tactical in order to exclude the shell, and you should be able to modify difficulty variant templates.I'm honestly not entirely sure how to do that, but that bit is on me. Advise on that is somewhere in the examples you've given me, I believe. However, it's also an example that's starting to make me feel increasingly uncomfortable working around the awkward way in which so much of the game is hard-coded, so it may be time to cut my losses and run. Which brings me to my second option: Do skills differ with difficulty? Because if they don't, I could just NOT modify weapons at all and modify the skill itself directly. All I want is to alter Blademaster, which I can do without altering the swords. I'll just do either a Switch or a bunch of ifs to determine weapon tech level, then just alter the skill itself. I presume I can put two X2DamageEffects on the same skill, no? That'll avoid having to re-write the skill template itself where I can just add to it. Hopefully. I had very high hopes for modding XCOM 2, but with the amount of stuff we simply can't do seemingly because nobody thought we'd need to... My enthusiasm is waning. Edited February 19, 2016 by SteelRook Link to comment Share on other sites More sharing options...
eXecator Posted February 19, 2016 Share Posted February 19, 2016 Do skills differ with difficulty? Because if they don't, I could just NOT modify weapons at all and modify the skill itself directly. Since AbilityTemplates defaultproperties dont change bShouldCreateDifficultyVariants it should be "false". This would imply that abilities in fact will not differ with difficulty. Do not despair good Sir. As I understand SDK updates are thought about. Its two weeks past release, things will only get better. =) Link to comment Share on other sites More sharing options...
Recommended Posts