Author Topic: How do I script for multi player module?  (Read 906 times)

Legacy_Decedion

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
How do I script for multi player module?
« on: March 03, 2012, 01:52:22 am »


               I was interested in creating a multiplayer module  for the community but I have questions regarding scripting and building. First, how do I determine the number of players? Is there something I need to do in the "on module enter " script?

Is there a function I need to implement ( in scripts) when speaking to an NPC regarding quest or at the end of a quest when giving xp to the entire party through npc dialog?

Are most players interested in hack and slash as a group? Or is story and dialog important to multiplayer or perhaps both?

And how would I join a multiplayer module if  I wanted to import a character just to experience multiplayer first hand?

Lastly, are there any recomendations for multiplayer modules to gauge what the community likes?

I created a single player module for NWN "Lich of the Tinder Box" Is there still any interest for modules created on this toolset for single player or is there more interest in other games with toolsets?
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
How do I script for multi player module?
« Reply #1 on: March 03, 2012, 03:58:37 am »


               Interest in all forms of module exists, though player numbers are down since the hayday, NWN still draws. A good module will get visitors. Some multiplayer is persistent world, some is smaller scale like 'module only' but all are possible, NWN is very flexible.

I run a PW if you'd like to see some of what we've done, let me know and we'll find a good day / time to meet online. You'd just run the game while your internet connection is running, click on multiplayer and then direct connect to my server at IP 66.232.100.90 ... to login you need CEP 2.1 or better tho.

Hope to hear from you.

Be well. Game on.
GM_ODA

http://playnwn.com
               
               

               
            

Legacy_Urk

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +0/-0
How do I script for multi player module?
« Reply #2 on: March 03, 2012, 07:17:22 am »


               There are ways to query the number of players on a server and/or the number of players in a given party but I don't know them offhand. When you need to find a specific scripting function go to the NWN Lexicon.

The trick to writing multiplayer mods is setting variables properly. By default the wizards bundled into the toolset (this includes the plot wizard and the script wizard bundled into the conversation editor) set variables on the PC triggering the script. This won't work for a multi-player module so you won't be able to use them. 

In order to make a working multiplayer module you need to use SetPLocalInt to set varaibles on the PC party, and GetPLocalInt to retrieve it. Now, this works with integer variables only. I don't know if there are similar functions for floats and strings, but I don't think so. Again, check the Lexicon to be sure.

Optionally you can use SetLocalFloatOnAll, SetLocalIntOnAll, and SetLocalStringOnAll. Instead of setting the variables on the party it can set the variable on everyone in the party. It's a subtle difference, but an important one. This works particularly well in PW settings, allowing party members to leave the party before the quest is done and not lose their progress, but complicating matters when new players to join parties mid quest. Stay away from this at the start though. PW scripting is complicated and if you use SetLocalVariableOnAll without also using SetPLocalInt or adding some important checks on existing party variables newbies joining quests can inadvertantly reset the entire party to zero. 

OK... this isn't nearly as complicated or difficult as I'm making it sound.

Used in combination these functions give you awesome power, but properly exploiting them can be a royal PITA. Try to stick with Set/GetPLocalInt.

Just FYI... the LS TK Script Generator supports multi-player modules.
               
               

               


                     Modifié par Urk, 03 mars 2012 - 07:43 .
                     
                  


            

Legacy_Decedion

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
How do I script for multi player module?
« Reply #3 on: March 03, 2012, 02:54:57 pm »


               ehye_khandee Thanks for your response and yes I would like to try your PW world. I played D&D Eberon on line for a bit and l liked it until I joined parties where the players would just run through dungeons and not give first timers a chance to experience the areas. I look forward to it and I'll check back on this thread to see when it's convenient for you.

Urk- Thanks for the response. You seem to have answered the questions I probably didn't phrase correctly but you knew what I was trying to ask. Thanks also for the script generator link.  PW's  are different from multi player mods I take it? PW's require a DM?

Is NWN OC designed for multi-player as well? I didn't see any of the functions you mentioned in the OC toolset (of course I didn't view every script).

Maybe I could download a good multiplayer mod to view it's toolset? And do you have any reccomendations? Thanks to both of you for your responses!
               
               

               
            

Legacy_Urk

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +0/-0
How do I script for multi player module?
« Reply #4 on: March 03, 2012, 04:10:19 pm »


               PW's don't necessarily need DMs, although the best ones have plenty of them around. But PW scripting discipline presents some very different challenges and is much more demanding. The most obvious difference is that vital information needs to be written to a database instead of just being stored to the module, but that's actually just the most obvious difference. For now just make a MP mod, then look back on it in the context of "What if this module was on ALL the time, with constantly shifting players and parties".

YVW on the script generator. It's a great way to get used to scripting, but it's no magic bullet and it has significant limitations. Don't rely on it too much. And working in MP has specific challenges. If you set a variable on the party make sure you retrieve it from there too. If you try to retrieve it from the PC it will come back null.
               
               

               


                     Modifié par Urk, 03 mars 2012 - 04:13 .
                     
                  


            

Legacy_Decedion

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
How do I script for multi player module?
« Reply #5 on: March 03, 2012, 04:43:05 pm »


               Thanks for putting the PW's and multiplayer in perspective for me Urk. I'll have to experiment with the scripting for multiplayer. You've definitley pointed me in the right direction and I appreciate your help!
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
How do I script for multi player module?
« Reply #6 on: March 03, 2012, 05:57:54 pm »


               *blushes* yeah, PW = Persistent World, one where the game is running all the time and PCs log in/out as they please. The key is in making it seem persistent, so things that happen last week impact play thereafter in some way - a PC logging out in bad health should be returned to bad health when they return, that sort of thing. '<img'>

My schedule is pretty flexible, I'm on the east coast USA and usually available most days from about 10am until about 5 pm and again from 7 pm until ???  I can also make other times available. What suits you well?

Be well. Game on.
GM_ODA
               
               

               
            

Legacy_Decedion

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
How do I script for multi player module?
« Reply #7 on: March 03, 2012, 07:07:05 pm »


               Hey ehye_khandee..I'm out west not quite the coast but I believe there's two hours different as I'm on MST. currently. It's coming up on noon my time. I'll go to whatever time is convenient for you. I work during the week but I do jump on in the afternoons and early evenings. Question..Do I have to create an account through the multiplayer button on my NWN game? If yes.. I should do that first. And to coordinate times should I use e-mail or is there a thread here in the forums for that?
               
               

               


                     Modifié par Decedion, 03 mars 2012 - 07:08 .
                     
                  


            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
How do I script for multi player module?
« Reply #8 on: March 04, 2012, 11:05:02 pm »


               Feel free to contact me, I sent you a PM with my info. I'll try to coordinate with you - let me know when is good for you (my schedule is flexible).

Be well. Game on!
GM_ODA