XP issuse



  • can't figure out why the script I have keeps giving XP to a PC. I want to to read what level they are and if over lvl x then they get nothing.
    Thank in advance.



  • If you post a copy of the script here, its likely the problem can be solved instead of writing a new one.



  • I used the wizard hat icon, yeah I know n00b. I can't find how to end it so that it only happens once. I have the scrpit making tool as well, but I'm still learning that.

    #include "nw_i0_tool"
    void main()
    {
    object oPC;

    if (!GetIsPC(GetItemActivatedTarget())
    ){

    return;}

    oPC = GetItemActivatedTarget();

    RewardPartyXP(1000, oPC, FALSE);

    if (GetHitDice(oPC) {
    }



  • The problem is you must place the reward line in the if (GetHitDice(oPC)



  • Its a starting area and I would like PC's to be Lvl 2 after they talk to the person there. Now I can't get it to activate. Sorry to be such an uber n00b.



  • @darkelf24420:

    can't figure out why the script I have keeps giving XP to a PC.

    By this I'm assuming you mean the way that if you roll through the conversation, get the xp, and don't level up, instead choosing to go through the conversation again, you get another 1000 xp (as technically you aren't level 2 yet). Snowy's way works awesomely if you have a variable stored on the likes of a PC token so that they can only get it once in a PC's lifetime, but if the area is only accessible on creation (like the Road to Arabel) I would do it like this:

    #include "nw_i0_tool"
    void main()
    {
    
        object oPC = GetPCSpeaker();
    
        if (GetIsPC(oPC)) {
            if (GetHitDice(oPC) == 1) {
                SetXP(oPC,1001);
            }
        }
    }
    

    @darkelf24420:

    can't figure out why the script I have keeps giving XP to a PC. I want to to read what level they are and if over lvl x then they get nothing.
    Thank in advance.

    Copy the code above into a new script, save it as something unique, then run through the conversation wizard on an NPC, and on the node you want the XP to be rewarded, under the Actions Taken tab (bottom right) put in the name of your script.

    Welcum 😃

    PROTIP: If you remove the line```
    if (GetHitDice(oPC) == 1) {



  • Thanks a ton guys. I'm slowly getting the hang of this. Work now to the way I want it.



  • Good.

    Clever idea Deloril. SetXP is far better in this case because there is no way of exploiting it. Unless some people want to delevel on purpose so you might want to keep if (GetHitDice(oPC) == 1) {.


Log in to reply