Aller au contenu

Photo

Stealth Skill


  • Veuillez vous connecter pour répondre
14 réponses à ce sujet

#1
Kesaru

Kesaru
  • Members
  • 130 messages
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?

Modifié par Kesaru, 09 février 2010 - 05:47 .


#2
Kesaru

Kesaru
  • Members
  • 130 messages
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)));

Modifié par Kesaru, 09 février 2010 - 08:26 .


#3
Toryss

Toryss
  • Members
  • 41 messages
For the string, you could enter a new string and change the reference number in your ABI_base file.



Your lockpicking changes look good in theory. Are you compiling the scripts that reference those header files?

#4
Kesaru

Kesaru
  • Members
  • 130 messages
I have compiled them. I followed the instructions found here: http://www.dragonage...ticle.php?id=14
I saved the script, then compiled them. I then deleted every file generated other than the ones I wanted; Core_h and Placeable_h, which I put in a folder along with the 2DA files for DAModder to install as a mod.
I've also made sure another mod is not overriding them.

I did get an additional error when saving and compiling not mentioned in the tutorial; it had a yellow triangle with an exclamation point in it as a symbol before the line, and said something about how the module has no starting area defined (which, interestingly, it seems I'm incapable of defining one in the module properties. I can only choose one from a list, which is essentially blank). It generated the files anyway though, so I figured it was fine.

In regards to 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.

Modifié par Kesaru, 10 février 2010 - 01:34 .


#5
Gammastar

Gammastar
  • Members
  • 42 messages
Don't worry about altering it, just make a new string and change the ID number of the description reference in ABI_Base to the ID of your new string. (And don't forget to export the talktable)



Also, no starting area will not affect anything in your module unless it is standalone (which would obviously need a starting area).

#6
Kesaru

Kesaru
  • Members
  • 130 messages
Yeah, I guess I may as well just make new strings... That's one problem down. Now I need to get lockpicking to work on non-rogues.

I've got another little question; I'm trying to make some more skills in general now, and I've been tossing around the idea of one that would slightly increase critical chance (which unless I've missed something, seems pathetically low), and add a chance on any successful critical hit against a minion/critter rank enemy (25%/50%/75%/100%) to instantly kill them.
The rub here is I'd like to have it automatically trigger a deathblow animation when this happens, and I'm not sure how I would go about doing that or if it's even possible. It may also be necessary to only allow it on non-skill attacks.

Modifié par Kesaru, 11 février 2010 - 11:32 .


#7
Gammastar

Gammastar
  • Members
  • 42 messages
I'll look into it for you and see what I can come up with.

#8
Kesaru

Kesaru
  • Members
  • 130 messages
I think it's likely that my script changes aren't going into the game for some reason.
I did a test in which I gave every class the Rogue's hidden ability, and everyone gained the ability to pick locks (on top of having the same talents as a Rogue).
I checked every script in the toolset that referenced objects, skills, abilities, gameplay and rules, and none other than those two I changed called the hidden rogue ability or even anything about the Rogue in relation to locks or lockpicking.
I re-altered and compiled those scripts, and just left them where and how it made them without moving them or deleting the excess, and the changes still did not take effect.
Even if there were something else calling for the Rogue's hidden ability, there's no way lockpicking would still be working as normal. Even if others can't pick locks still, those changes I made should have broken it at least in some way for everyone.

Modifié par Kesaru, 12 février 2010 - 03:56 .


#9
Gammastar

Gammastar
  • Members
  • 42 messages
Well, did you remember to export the scripts? lol

#10
Kesaru

Kesaru
  • Members
  • 130 messages
I have to export also? I was following this tutorial (http://www.dragonage...ticle.php?id=14), which only said to compile them. It said nothing about exporting. Is that what you meant?

If not, which Export option do I choose, and do I do it before compiling?

#11
Gammastar

Gammastar
  • Members
  • 42 messages
Save first (compiles automatically when you save) then export without dependent resources.

All toolset resources are completely unusable in-game until they are exported.

Modifié par Gammastar, 12 février 2010 - 04:31 .


#12
Kesaru

Kesaru
  • Members
  • 130 messages
Exporting rather than compiling seemed to do the same thing, with the same effect :(

#13
Gammastar

Gammastar
  • Members
  • 42 messages
What do you mean? Still nothing has changed? Well then I'm not sure what the problem is. Perhaps something is wrong with the scripts, or they're not being called? I can't think of anything else.

#14
Toryss

Toryss
  • Members
  • 41 messages
If you're compiling placeable_core.nss, then it appears that it should be working. That's just from glancing at the scripts, so I could be wrong.



You can always try to override the corresponding event, but all of that seems unnecessary when you've given the character the pick_lock skill.

#15
Kesaru

Kesaru
  • Members
  • 130 messages
Ok, I've uploaded an alpha version of the mod to help figure this out.
http://dragonagenexu...ile.php?id=757.
I'd appreciate it if anyone else could see if the lockpicking works or not for them, and try replicating those script changes I made to see you can get them to work (in case I exported them wrong).

If you make a new human warrior, there'll be a locked door just through the door behind where you start which can be opened with 16 Cunning and the first Lockpicking skill, for easy testing.

Modifié par Kesaru, 13 février 2010 - 12:07 .