Navigation

    City of Arabel

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    XP issuse

    Scripting
    3
    8
    2384
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      darkelf24420 last edited by

      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.

      Cola Sane….... is now just a side

      Barakis- Vengeful Coward.

      1 Reply Last reply Reply Quote
      • D
        Deloril last edited by

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

        Deloril Points - Failure to arrest a pissed off monk.
        Cold Aerthur - Died of a broken heart.
        Garath - Fell in glorious battle, the way every wererat should.
        Pheonix Halenthen - Died the drunk fool he thought he was pretending to be.

        1 Reply Last reply Reply Quote
        • D
          darkelf24420 last edited by

          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) <= 1)
          {
          }

          Cola Sane….... is now just a side

          Barakis- Vengeful Coward.

          1 Reply Last reply Reply Quote
          • Snowstorm
            Snowstorm last edited by

            The problem is you must place the reward line in the if (GetHitDice(oPC) <= 1)

            #include "nw_i0_tool"
            void main()
            {
                object oPC = GetItemActivatedTarget();
            
                if (GetIsPC(oPC)) {
                    if (GetHitDice(oPC) <= 1) {
                        RewardPartyXP(1000, oPC, FALSE);
                    }
                }
            }
            

            From what I read, I assume you only want this to work on level 1 characters.

            Since you give XP to only one PC though, I would rewrite this like that:

            void main()
            {
                object oPC = GetItemActivatedTarget();
            
                if (GetIsPC(oPC) && GetHitDice(oPC) <= 1) {
                    GiveXPToCreature(oPC, 1000);
                }
            }
            

            White teddy bear

            1 Reply Last reply Reply Quote
            • D
              darkelf24420 last edited by

              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.

              Cola Sane….... is now just a side

              Barakis- Vengeful Coward.

              1 Reply Last reply Reply Quote
              • D
                Deloril last edited by

                @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 :D

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

                Deloril Points - Failure to arrest a pissed off monk.
                Cold Aerthur - Died of a broken heart.
                Garath - Fell in glorious battle, the way every wererat should.
                Pheonix Halenthen - Died the drunk fool he thought he was pretending to be.

                1 Reply Last reply Reply Quote
                • D
                  darkelf24420 last edited by

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

                  Cola Sane….... is now just a side

                  Barakis- Vengeful Coward.

                  1 Reply Last reply Reply Quote
                  • Snowstorm
                    Snowstorm last edited by

                    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) {.

                    White teddy bear

                    1 Reply Last reply Reply Quote
                    • 1 / 1
                    • First post
                      Last post