Jump to content

Changing a weapon's reticle


Shuma22

Recommended Posts

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.jpg

http://puu.sh/pvyqf/d0b3873fa9.jpg

http://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

  • 2 months later...

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 by robojumper
Link to comment
Share on other sites

 

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 by Shuma22
Link to comment
Share on other sites

 

 

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 by robojumper
Link to comment
Share on other sites

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 by robojumper
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...