Shuma22 Posted June 17, 2016 Share Posted June 17, 2016 So i've been working on a weapon mod and there's one thing that i haven't been able to figure out, how to change the weapon reticle which is different for every weapon tier, in case you don't know what i mean i'm talking about this: http://puu.sh/pvyqS/c00f93e975.jpghttp://puu.sh/pvyqf/d0b3873fa9.jpghttp://puu.sh/pvyrA/7431ea263e.jpg I haven't even been able to find the textures in the SDK, or what references the textures, the only thing i have managed to figure out is that this line in the weapon template: Template.WeaponTech = 'beam';Can change that reticle a weapon uses, even if you remove the line it just defaults to the conventional reticle. But i don't know what that line actually does, does it just change the reticle or does it do something else? I have no idea. So in short, i'd like to be able to create a new reticle for my weapons, but i have no idea how to make my weapons use them and i would also like to know that template.weapontech line does. Link to comment Share on other sites More sharing options...
fxsjosh Posted June 17, 2016 Share Posted June 17, 2016 The reticles are set via XComGameState_Ability:GetUIReticleIndex. There is currently no way to extend or replace them (short of entirely replacing that UI element - which is handled in UITacticalHUD). Link to comment Share on other sites More sharing options...
Shuma22 Posted June 17, 2016 Author Share Posted June 17, 2016 Weeelp, that super sucks. One would think changing a reticle would be simple, but i guess not. Thank you. Link to comment Share on other sites More sharing options...
zyrrashijn Posted August 26, 2016 Share Posted August 26, 2016 So, just to be clear (i have no idea of coding), it is not possible to use a say tech tier 2 (magnetic) reticle on a weapon that is set to tech tier 3 (beam)? Link to comment Share on other sites More sharing options...
robojumper Posted September 1, 2016 Share Posted September 1, 2016 (edited) To be clear - you can NOT create new reticles. This is hardcoded in TacticalHUD.swf/TargetingReticle.as: function setMode(mode) { var _loc2_ = ""; switch(mode) { case TargetingReticle.MODE_OVERSHOULDER: case TargetingReticle.MODE_OFFENSE: _loc2_ = "_offense"; break; case TargetingReticle.MODE_DEFENSE: _loc2_ = "_defense"; break; case TargetingReticle.MODE_SWORD: _loc2_ = "_sword"; break; case TargetingReticle.MODE_ADVENT: _loc2_ = "_advent"; break; case TargetingReticle.MODE_ALIEN: _loc2_ = "_alien"; break; default: trace("ERROR: Unknown mode enum \'" + mode + "\' passed to RAC."); return undefined; } this.targetMode = mode; this.gotoAndPlay(_loc2_); this.bg.gotoAndPlay("intro"); this.SetAimPercentage(this.aimPercentage); } You can, by overriding UITargetingReticle.uc, switch them around. Replacing Beam Weaponry Reticles with Mag Tier Reticles is easy, if you want, I can write a quick mod for that. If you want more fine control, you need to either override UITacticalHUD (don't do this, a lot of mods are coded badly so that an override would break them) or XComGameState_Ability (Don't do this too. Incompatibilities for such a simple mod are just not worth it.) http://steamcommunity.com/sharedfiles/filedetails/?id=756315744 Edited September 1, 2016 by robojumper Link to comment Share on other sites More sharing options...
Shuma22 Posted September 1, 2016 Author Share Posted September 1, 2016 (edited) Replacing Beam Weaponry Reticles with Mag Tier Reticles is easy But is it possible to do this just for specific weapons? Or would it be a global change? Edit: Oh wow, well that was fast. Thank you, i'll take a look. Edited September 1, 2016 by Shuma22 Link to comment Share on other sites More sharing options...
robojumper Posted September 1, 2016 Share Posted September 1, 2016 (edited) Replacing Beam Weaponry Reticles with Mag Tier Reticles is easy But is it possible to do this just for specific weapons? Or would it be a global change? Edit: Oh wow, well that was fast. Thank you, i'll take a look. This is a global change. As I said, finer changes will make compatibility suffer greatly. The example is commented out in the ini file, I chose your suggestion as the example. Edited September 1, 2016 by robojumper Link to comment Share on other sites More sharing options...
Shuma22 Posted September 2, 2016 Author Share Posted September 2, 2016 Alright thanks, i'll implement this in my mod and give you full credit, unless you prefer i just point people to your mod that's fine too. Link to comment Share on other sites More sharing options...
robojumper Posted September 2, 2016 Share Posted September 2, 2016 (edited) You know how it is - I slept over it and woke up with a better solution. Since only one mod can override a class at a time, I recommend making my mod some kind of base mod that is optional. Anyway, I updated the mod - http://steamcommunity.com/sharedfiles/filedetails/?id=756315744 You can now create a file in your mod's config folder XComReticleMod.ini. It then should look like this: [ReticleMod.RM_UITargetingReticle] ;this will give the conventional cannon the melee reticle +WeaponOverrides=(Nm="Cannon_CV", Ret=3) ;this will give the rupture ability the defensive reticle +AbilityOverrides=(Nm="BulletShred", Ret=2) feel free to play around. My mod, if installed, will pick it up and automatically check for weapon/ability. Ability has a higher priority than weapon. Edited September 2, 2016 by robojumper Link to comment Share on other sites More sharing options...
Shuma22 Posted September 3, 2016 Author Share Posted September 3, 2016 That's awesome, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts