Announcement

Collapse
No announcement yet.

NWN Scripting Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NWN Scripting Question

    Just wondering, in neverwinter nights, how do you get a NPC to move from point A to point B in scripting?

    I was playing aroudn with the tool, but the compiler kept telling me that I was messing up and couldn't go from Area001 to Area002 with the commands I was giving... or even from Point A to Point B.

    Any help would be appreciated!
    -->Visit CGN!
    -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

  • #2
    Ah, I think I may be just the person to ask

    First, place the NPC on the map.
    Second, r-click on the NPC and place a waypoint.
    Third, r-clivk on the way point and look at the name of the waypoint. It should be something like WP_NPCname_00
    Fourth make a NEW way point where you want the NPC to walk to.
    Call the new waypoint WP_NPCname_01
    Add waypoints always using the same system.
    The NPC will automatically walk its waypoints as soon as it is spawned, in the order 00,01,02,03 untill the last one, then it works through them in reverse.

    To make the NPC NOT walk untill you want it to add ClearAllActions() to the end of the on-spawn script. To make it walk add ActionWalkWaypoints() to the script when you want it to do so.

    If that doesn't work, tell me exactly what you want, and I'll try and make a script for it.

    -Jam
    1) The crappy metaspam is an affront to the true manner of the artform. - Dauphin
    That's like trying to overninja a ninja when you aren't a mammal. CAN'T BE DONE. - Kassi on doublecrossing Ljube-ljcvetko
    Check out the ALL NEW Galactic Overlord Website for v2.0 and the Napoleonic Overlord Website or even the Galactic Captians Website Thanks Geocities!
    Taht 'ventisular link be woo to clyck.

    Comment


    • #3
      Okay, thanks, I'll try that!

      (I think I may have finally stabilized NWN to run on my computer after about a year of tinkering with it... so hopefully I can start enjoying the game!

      (the game has both graphics errors and program errors... and for some reason its files fragment themselves when I install the program ... very buggy thing... very buggy...) especially for an XP computer with 512 MB ram and 1.68 GhZ speed
      -->Visit CGN!
      -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

      Comment


      • #4
        Ah, you do have the lastest patches, yes? They really increase stability.
        Helpful links :



        Both of these pages are life-savers

        -Jam
        1) The crappy metaspam is an affront to the true manner of the artform. - Dauphin
        That's like trying to overninja a ninja when you aren't a mammal. CAN'T BE DONE. - Kassi on doublecrossing Ljube-ljcvetko
        Check out the ALL NEW Galactic Overlord Website for v2.0 and the Napoleonic Overlord Website or even the Galactic Captians Website Thanks Geocities!
        Taht 'ventisular link be woo to clyck.

        Comment


        • #5
          Oh, and another life-saver. If you want NPCs to walk about randomly a bit, instead of standing still, replace the onspawn script with :

          Code:
          void main()
          {
          AssignCommand (OBJECT_SELF, ActionRandomWalk());
          }
          Simple

          -Jam
          1) The crappy metaspam is an affront to the true manner of the artform. - Dauphin
          That's like trying to overninja a ninja when you aren't a mammal. CAN'T BE DONE. - Kassi on doublecrossing Ljube-ljcvetko
          Check out the ALL NEW Galactic Overlord Website for v2.0 and the Napoleonic Overlord Website or even the Galactic Captians Website Thanks Geocities!
          Taht 'ventisular link be woo to clyck.

          Comment


          • #6
            what graphics card do you have?

            Comment


            • #7
              what graphics card do you have?
              I've been trying to figure that out myself...

              -
              I have Directx 8.1, by the way.
              -
              thanks for the links
              -

              As for the patches, - all I have to do now is to find someone I know with DSL and a CDRW... and believe me, that isn't easy where I live oh well
              Last edited by DarkCloud; December 22, 2003, 00:37.
              -->Visit CGN!
              -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

              Comment


              • #8
                Thank you Jamski, the waypoints on spawn work... but I'm still having trouble with getting the character to walk to point X during a certain point in the conversation (I want him to lead the characters to point x)

                and I also want him to be able to go through area transitions with the character.

                Thanks in advance!
                -->Visit CGN!
                -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

                Comment


                • #9
                  Just FYI, I think he'll be away through christmas.
                  cIV list: cheats
                  Now watch this drive!

                  Comment


                  • #10
                    That's all right- I can wait. I've waited over a year to play the game since I first bought it... so I can wait some more
                    -->Visit CGN!
                    -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

                    Comment


                    • #11
                      Bumping for help from Jamski...

                      *please*
                      -->Visit CGN!
                      -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

                      Comment


                      • #12
                        Back again.

                        Hmmm.... you want them to follow through area transitions... not so easy.

                        Here's a workaround. At a certain point in the conversation when you want them to leave the area add the standard script nw_d2_leaverun to the actions in the dialoge editor. Place a waypoint called NW_EXIT where you want them to leave the area.

                        Upon reaching this point in the converstaion the NPC will now turn and run to the exit where you placed NW_EXIT - and destroy itself

                        Now comes the second part. Place a floor trigger on the other side of the area transition, so that the player will stand on it as soon as they come through the door/gate/whatever and make this transition spawn a copy of the NPC (make sure it only does it once ) Give the copy of the NPC a different file name and also different dialogue. Its a bit clumsy, but trying to get NPCs to go through area transitions is almost impossible.

                        Tell me if it works.

                        -Jam
                        1) The crappy metaspam is an affront to the true manner of the artform. - Dauphin
                        That's like trying to overninja a ninja when you aren't a mammal. CAN'T BE DONE. - Kassi on doublecrossing Ljube-ljcvetko
                        Check out the ALL NEW Galactic Overlord Website for v2.0 and the Napoleonic Overlord Website or even the Galactic Captians Website Thanks Geocities!
                        Taht 'ventisular link be woo to clyck.

                        Comment


                        • #13
                          And... any luck?

                          -Jam
                          1) The crappy metaspam is an affront to the true manner of the artform. - Dauphin
                          That's like trying to overninja a ninja when you aren't a mammal. CAN'T BE DONE. - Kassi on doublecrossing Ljube-ljcvetko
                          Check out the ALL NEW Galactic Overlord Website for v2.0 and the Napoleonic Overlord Website or even the Galactic Captians Website Thanks Geocities!
                          Taht 'ventisular link be woo to clyck.

                          Comment


                          • #14
                            Well Jamski, I can't even seem to get the character able to move to a waypoint in the middle of a conversation tree.
                            (I know very little of C++...)

                            But here's the best I could do; after the void main()

                            {
                            AssignCommand (OBJECT_SELF, ActionWalkWaypoints(WP_caretaker_05);

                            }

                            and it told me that (ActionWalkWaypoints) was an undefined identifier.

                            -
                            After I work out his movements, I'll try the screen-to-screen thing

                            Just wondering since the NWN site says that this is possible:
                            -
                            3. What if I want part of the circuit to cross an area transition... like going into a house or something?
                            As I understand it (according to a recent conversation with Preston, who wrote the AI), this works fine. I suspect you would have to have a regular area transition created by the wizard, however.
                            I recently tried this out, creating a peasant who walked four waypoints, two of them being in another area (inside a house). I then planted a house tile in the main area and connected the two with a door. He left the door open after he used it the first time, but otherwise it worked fine.
                            Do you think that it might be possible to create a cleaner transition in-conversation movement between the areas?
                            Since it does seem that they can move between screens?

                            Also about waypoints- can I make a character stop at one and wait until he is approached by the player.

                            -
                            and another question on conversations: can I get my character to OnSpawn go to the player and talk to him if he sees the character...
                            In the module the character is in one room and the caretaker is in another... the caretaker takes a circuit and I want him to say hello when he sees the player.

                            I've been reading through the guides, but am sill looking for how to do this.

                            ---
                            um... if I'm overburdening you, please say so- I'm registered on the NWN boards (but find it difficult to psot there because of thread loading times... I do save threads from here however, thanks to your advice)
                            -->Visit CGN!
                            -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

                            Comment


                            • #15
                              Hmm, I need to think about this a moment. I'll get back to you soon. It CAN be done that the NPC sees the player and comes up and starts a conversation.... just must remember how...

                              Give me an hour to try a few ideas out.

                              -Jam
                              1) The crappy metaspam is an affront to the true manner of the artform. - Dauphin
                              That's like trying to overninja a ninja when you aren't a mammal. CAN'T BE DONE. - Kassi on doublecrossing Ljube-ljcvetko
                              Check out the ALL NEW Galactic Overlord Website for v2.0 and the Napoleonic Overlord Website or even the Galactic Captians Website Thanks Geocities!
                              Taht 'ventisular link be woo to clyck.

                              Comment

                              Working...
                              X