Jump to content

Deleted32045420User

Account closed
  • Posts

    185
  • Joined

  • Last visited

Everything posted by Deleted32045420User

  1. Thanks Everyone! Worked perfectly Amineri, what would we do without you :laugh:
  2. I am trying to create Commander's choice and the actual code part should be easy enough, the main problem is the UI isnt responding to my tries to override it. Class UIArmory_Promotion_CommandersChoice extends UIArmory_Promotion; var bool b_UseCC; var UIMechaListItem ccMechaItem; var XComGameState_Unit Unit; simulated function InitPromotion(StateObjectReference UnitRef, optional bool bInstantTransition) { super.InitPromotion(UnitRef, bInstantTransition); Unit=XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(UnitRef.ObjectID)); `log("CC Activated!"); //if(Unit.GetRank()==1 &&b_UseCC) //{ ccMechaItem = Spawn(class'UIMechaListItem', self); ccMechaItem.InitListItem(); ccMechaItem.SetPosition(0, 120); //} } simulated function PopulateData() { Super.PopulateData(); ccMechaItem.UpdateDataButton("Switch Class Button","Switch Class",UpdateCC); Super.PopulateData(); } function UpdateCC(UIButton ccButton) { local array<X2SoldierClassTemplate> Templates; local X2SoldierClassTemplateManager SoldierClassManager; local int rnd; SoldierClassManager = class'X2SoldierClassTemplateManager'.static.GetSoldierClassTemplateManager(); Templates= SoldierClassManager.GetAllSoldierClassTemplates(); rnd=RAND(Templates.length); `log("Switched Class to: " @Templates[rnd].DisplayName); //Unit.SetSoldierClassTemplate(Templates[rnd].DisplayName); } defaultproperties { b_UseCC = true } (in the ini) [Engine.Engine] +ModClassOverrides=(BaseGameClass="UIArmory_Promotion", ModClass="UIArmory_Promotion_CommandersChoice") Now, i have checked for leftover ModClassOverrides and i found none in my configs in the SDK folder, i would love a quick UI tutorial or some guidance. Thanks in advance for everyone!
  3. hmmm seems interesting, i'll have to look if that'll help me detect HP changes
  4. i suggest "Long Live The Resistance" LLR. I've been doing that "Second Wave Reborn" as a future contribution to any big mod
  5. Also Maybe Something that'll let multiple mods to override the same UI Class unless they clash, i mean i want to add some options for my mod when starting new games but it'd make bronzeman mod incompatible
  6. ahh thanks all sounds very promising. right now i am just taking all the current healing templates(stuff like medikits,gremlin heals and restoration,soul steal and regular old regeneration) and adding event triggers for them to enable my redfog mod to catch them before stuff like panic or disorientation is applied to the unit, i dont think it's good for mod intercompatibility since i am just taking the base code and if anybody tries to get them it'll just be an override war, is there another better way to do this kind of stuff? since i tried to override the medikit effect but it didnt fire. Yeah i checked but it's not that for some reason it dosnt let me override the X2Effect_MedikitHeal (or whatever that's named)
  7. David what did you say? i mean this exactly what i dreamed! i love you guys! oh yeah: glad the devs proved you wrong for once. Now for some real questions: What about class overrides? are these getting any more stable? because me and a couple of others have begun to stay clear of those in favor of inefficient stuff like UI listeners. Some people have requested for a function added to the DLCinfo Class that activates once for each load of any game (not just ones not containing the mod) a lot of stuff would benefit greatly from that kind of behaviour, or if it'll cause froblems with several mods trying to use the same function overriding the same class you could even implement a simple fake UI screen we can set up a listener for that would activate once.
  8. 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!"
  9. We NEED a firaxis dev here with us, answering questions on threads from time to time, i mean right now we are shooting darts blindfolded at the code- sometimes we hit bullseye and sometimes we hit the big dude on the other side of the bar and getting beaten up(hard crashes and stuff)
  10. Well i think this is probably the only place experienced people come to talk modding, reddit is junk for help with mods and well i havnt checked 2k forums really but i cant believe there is a larger community of modders there willing to help than here
  11. 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
  12. it's on where the regular logs are on Documents\my games\XCOM2\XComGame\Logs
  13. "Easily moddable"...."More accessible than ever!" they were right but sadly those words are feeling kinda empty over here, at least for us coders...or it could just be me frustrated and tired
  14. ahh yeah i know that feeling.... man how much would i have liked if this was in UE4 and C++ /Blueprints instead.... Yeah templates are overriden on game start but i dont think the ContentInfo loads every time but just the first time, another idea is again with listeners- listen to the start of a turn and filter out if your sword is already in the template manager if not just insert it in there, should be less intensive than just adding it over and over each time but more expensive than the overriding code working like it was written by professionals
  15. Thing is, I'm already using a child of the weapon template: class X2SwordTemplate extends X2WeaponTemplate; Not sure what else I can do about that. The editor compiles just fine, but for some reason the game uses its own default values. How the hell does it even do that? Does the override fail somehow? idk, it should work but again i have given up on overriding stuff and just currently try to work around problems. OK, that's pretty interesting. After staring at it for a bit, I think I see what you're doing. You've created an event listener which listens to a 'HealedSoldier' event, which you're firing manually inside the "OnEffectAdded()" function. OK, that gives me a starting point to figure out how event listeners work (though the X2EventManager class has a whole lot of virtual functions...), and it seems like this is backwards from what I'm used to. In Java, you register listeners with objects, and those objects notify their subscribed listeners directly. Here, it seems like I need to register a listener for an event itself. This still brings up the question, though - what happens when the listener fires? I'm presuming it runs the code in the last block, but where is that code located? Inside a method? Inside a class? How does the listener know to run that particular bit of code? This is the link I'm missing. 'HealedSoldier' and... Then what? How do I set which code runs? Oh, and it brings up one other question - how do I listen to a game loading event? I can't listen to the ability itself because the Blademaster ability is passive. I'd need to fix it just once when the game loads to ensure that the change happens at least once after the game has booted up initially but before the player has a chance to attack with the ability. Presumably I'd need to register an object with a listener, but what would that listener listen for? Oh yeah i forgot that... function EventListenerReturn GrabStats(Object EventData, Object EventSource, XComGameState GameState, Name EventID) { A BUNCH OF REALLY WEIRD AND MESSY CODE FOR GRABBING UNIT STATS BEFORE THE GAME APPLIES DEBUFFS Return ELR_NoInterrupt; } You dont need to listen to the ability you can override the template from wherever you want, the listener and triggers are there to notify you of when stuff happens, there is a bit of code that handles the loading, and try and look for somewhere you can put an event trigger in there, you could even possibly trigger once on each tactical mission start which would make for much less spam and there is already an eventTrigger for that one, i used it for some time for red fog but it was too wasteful for me as i needed just to take hit events and nothing else, talking about that i could call the medikit template replacement code from something similar to that to reduce spam but that'll come when i have a reason to reorganize my code to be readable to other human beings
  16. Sure why not, i am all for more people on the team
  17. It's possible it will do it but i am not enough of a ui expert to tell you, we should set an experiment. On the whole "low signal-to-noise ratio on the workshop" well i cant agree more- i mean the number of "mods" there is absurd! i mean there are like hundreds of nations and soldier packs and barely like 50 actual real modding, and changing 2 ini files is barely modding in my eyes, the hidden potential thing is good and is modding but the "MORE SQUAD SIZE!" which is a simple edit isnt at least in my eyes. or at the least shouldnt be on the workshop with actual mods
  18. I'd like to contribute as this would definitely benefit my mod as a significant gameplay feature what mod are you making? you mean this fatigue system? because by all looks of it it'll need some code to implement. which reminds me i should document my code...
  19. Yeah i have too much on my hands right now, i would love to implement this though... does anyone want in on "Second Wave Reborn"? full credits and all, it's just that i'm swamped with ideas and fixes and another head or two or ten wouldnt hurt!
  20. sure. i was thinking about it a couple of days ago- mainly it could be done with a persistent list that will take soldiers and divide them into the 3 groups, the hard part is probably tracking the time(which i havnt gotten into so it could just be extremely easy)
  21. yup kvalyr is right, screen listeners handle almost everything for me, it's pricey but reliable
  22. i think that because of the template only accepts weapon templates and it's child objects. class X2Effect_ApplyMedikitHeal_RedFog extends X2Effect_ApplyMedikitHeal; simulated protected function OnEffectAdded(const out EffectAppliedData ApplyEffectParameters, XComGameState_BaseObject kNewTargetState, XComGameState NewGameState, XComGameState_Effect NewEffectState) { local XComGameState_Unit TargetUnit,SourceUnit; local int SourceObjectID ; Super.OnEffectAdded( ApplyEffectParameters, kNewTargetState ,NewGameState, NewEffectState); SourceObjectID = ApplyEffectParameters.SourceStateObjectRef.ObjectID; SourceUnit = XComGameState_Unit(NewGameState.CreateStateObject(class'XComGameState_Unit', SourceObjectID)); TargetUnit= XComGameState_Unit(kNewTargetState); `log("Medikit ACTIVATED!"); `XEVENTMGR.TriggerEvent('HealedSoldier',TargetUnit ,SourceUnit,NewGameState); } and then i listen with `XEVENTMGR.RegisterForEvent(ThisObj, 'HealedSoldier', GrabStats); and i change the templates here local X2AbilityTemplateManager AbilityTemplateManager; ThisObj=self; AbilityTemplateManager = class'X2AbilityTemplateManager'.static.GetAbilityTemplateManager(); AbilityTemplateManager.AddAbilityTemplate(Class'X2Ability_RedFogMedikit'.static.AddMedikitHeal( 'MedikitHeal', class'X2Ability_DefaultAbilitySet'.default.MEDIKIT_PERUSEHP),true); AbilityTemplateManager.AddAbilityTemplate(Class'X2Ability_RedFogMedikit'.static.AddMedikitHeal( 'NanoMedikitHeal', class'X2Ability_DefaultAbilitySet'.default.NANOMEDIKIT_PERUSEHP),true);
  23. well what i do with my medikit change for red fog is just setting a listener and updating each time it's initialized, it's not very efficient but it's super effective, X2Item_DefaultWeapons.uc has all default weapon templates. X2Ability_DefaultAbilitySet.uc has all default ability templates. you can search and replace with the: AbilityTemplateManager.AddAbilityTemplate(AbilityTemplate template,bool OverrideCurrent) but i have yet to find the X2WeaponTemplate overrider but there is a getall function in the X2ItemTemplateManager
  24. there is one it's called ETeam and has neutral, alien and xcom but it's native so that's not where i would look (though i havnt looked into it much yet)
×
×
  • Create New...