Jump to content

Stealth Skill


ShadowDragyn

Recommended Posts

I'm working on this mod that turns Stealth into a skill rather than a Rogue talent, as well as granting Warriors and Mages a skill every other level just like Rogues so they can afford that and other skills.

 

It's basically done so far, but I need to edit the description strings for the stealth skills so they no longer call you a Rogue. The problem is, I don't know where to find them in the toolset.

Does anyone know how to find and edit existing strings?

Link to comment
Share on other sites

Okay, I could really use some help here.

I decided to make Lockpicking a skill as well, but as most of you know Rogues have an innate ability to pick locks, and Lockpicking simply improves that.

I looked it up, and supposedly everything relating to how Lockpicking works can be found inside of the scripts Core_h.nss and Placeable_h.nss.

Looking inside of those scripts, Core_h handles how the skill improves your chances, and only runs if you're a Rogue. I changed that so it would only run if you have the first Lockpicking skill (ABILITY_SKILL_LOCKPICKING_1).

I then opened Placeable_h, which seems to handle how a locked object reacts when you activate it. It had some lines that would only run if you were a Rogue. I changed that to require the first Lockpicking skill, just like in Core_h.

But when I go in-game, Rogues are still the only ones capable of opening locks.

Same lock, same number of skill points in Lockpicking, same Cunning, and the non-Rogue gets the "insufficient skill" message while the Rogue opens it successfully.

 

Here are the scripts, I only changed the lines referencing ABILITY_TALENT_HIDDEN_ROGUE near the start:

Core_h before

float GetDisableDeviceLevel(object oCreature)
{
float fPlayerScore = 0.0f;

if (HasAbility(oCreature, ABILITY_TALENT_HIDDEN_ROGUE))
{
	fPlayerScore = GetAttributeModifier(oCreature, PROPERTY_ATTRIBUTE_INTELLIGENCE);

	#ifdef DEBUG
	Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "Intelligence Modifier = " + ToString(fPlayerScore));
	#endif

	int nSkillLevel = 0;
	if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_4))
	{
		nSkillLevel = 4;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_3))
	{
		nSkillLevel = 3;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_2))
	{
		nSkillLevel = 2;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_1))
	{
		nSkillLevel = 1;
	}
	fPlayerScore += (10.0f * nSkillLevel);

	#ifdef DEBUG
	Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "With Skill = " + ToString(fPlayerScore));
	#endif
}
return fPlayerScore;
}

 

Core_h after

float GetDisableDeviceLevel(object oCreature)
{
float fPlayerScore = 0.0f;

if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_1))
{
	fPlayerScore = GetAttributeModifier(oCreature, PROPERTY_ATTRIBUTE_INTELLIGENCE);

	#ifdef DEBUG
	Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "Intelligence Modifier = " + ToString(fPlayerScore));
	#endif

	int nSkillLevel = 0;
	if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_4))
	{
		nSkillLevel = 4;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_3))
	{
		nSkillLevel = 3;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_2))
	{
		nSkillLevel = 2;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_1))
	{
		nSkillLevel = 1;
	}
	fPlayerScore += (10.0f * nSkillLevel);

	#ifdef DEBUG
	Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "With Skill = " + ToString(fPlayerScore));
	#endif
}
return fPlayerScore;
}

 

Placeable_h before

			   // If still locked and key not required then rogues can attempt to pick lock.
			if (!nActionResult && !bKeyRequired && HasAbility(oUser, ABILITY_TALENT_HIDDEN_ROGUE))
			{
				// player score
				float fPlayerScore = GetDisableDeviceLevel(oUser);
				float fTargetScore = IntToFloat(nLockLevel);

				Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "nLockLevel = " + ToString(nLockLevel));
				Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "Final Value = " + ToString(fPlayerScore));

				nActionResult = (fPlayerScore >= fTargetScore);
			}
		}

		if (nActionResult)
		{
			// Success
			UI_DisplayMessage(OBJECT_SELF, (bUsedKey ? UI_MESSAGE_UNLOCKED_BY_KEY : UI_MESSAGE_UNLOCKED));
			PlaySound(OBJECT_SELF, GetM2DAString(TABLE_PLACEABLE_TYPES, "PickLockSuccess", GetAppearanceType(OBJECT_SELF)));

 

Placeable_h after

			   // If still locked and key not required then rogues can attempt to pick lock.
			if (!nActionResult && !bKeyRequired && HasAbility(oUser, ABILITY_SKILL_LOCKPICKING_1))
			{
				// player score
				float fPlayerScore = GetDisableDeviceLevel(oUser);
				float fTargetScore = IntToFloat(nLockLevel);

				Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "nLockLevel = " + ToString(nLockLevel));
				Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "Final Value = " + ToString(fPlayerScore));

				nActionResult = (fPlayerScore >= fTargetScore);
			}
		}

		if (nActionResult)
		{
			// Success
			UI_DisplayMessage(OBJECT_SELF, (bUsedKey ? UI_MESSAGE_UNLOCKED_BY_KEY : UI_MESSAGE_UNLOCKED));
			PlaySound(OBJECT_SELF, GetM2DAString(TABLE_PLACEABLE_TYPES, "PickLockSuccess", GetAppearanceType(OBJECT_SELF)));

 

 

 

Now in regards to the issue with editing the Strings, I've made another step forward. You can find the ID numbers for strings in ABI_Base.2DA.

Now though, after opening the string I still cannot figure out how to alter it.

Link to comment
Share on other sites

  • 3 weeks later...

I solve my problem with detect and disarm trap and I think your problem is the same

 

If i was you I will try that.

 

1: Don't touch core_h and placeable_h

 

2: Create a new script call by exemple newskill_core_h with the NEW GetDisableDeviceLevel function. See that i put NS add the and of the name's function because we need

a new function and no an override function. And just remove the rogue condition (the 3 lines with //) don't replace ABILITY_TALENT_HIDDEN_ROGUE by ABILITY_SKILL_LOCKPICKING_1 because I think it doesn't work if you have lockpicking lvl 2 (but maybe I've wrong)

 

#include "log_h"
#include "effect_constants_h"
#include "2da_data_h"
#include "core_difficulty_h"

float GetDisableDeviceLevelNS(object oCreature)
{
float fPlayerScore = 0.0f;

//	if (HasAbility(oCreature, ABILITY_TALENT_HIDDEN_ROGUE))
//   {
	fPlayerScore = GetAttributeModifier(oCreature, PROPERTY_ATTRIBUTE_INTELLIGENCE);

	#ifdef DEBUG
	Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "Intelligence Modifier = " + ToString(fPlayerScore));
	#endif

	int nSkillLevel = 0;
	if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_4))
	{
		nSkillLevel = 4;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_3))
	{
		nSkillLevel = 3;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_2))
	{
		nSkillLevel = 2;
	} else if (HasAbility(oCreature, ABILITY_SKILL_LOCKPICKING_1))
	{
		nSkillLevel = 1;
	}
	fPlayerScore += (10.0f * nSkillLevel);

	#ifdef DEBUG
	Log_Trace(LOG_CHANNEL_SYSTEMS_PLACEABLES, GetCurrentScriptName(), "With Skill = " + ToString(fPlayerScore));
	#endif
//	}
return fPlayerScore;
}

 

 

You need also modify placeable_h and probably placeable_core. I can't help you now because i haven't this scripts here (i'm at work... :P)

 

I can help you tomorrow for next steps

Link to comment
Share on other sites

  • Recently Browsing   0 members

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