| Author | Sticky: Post Working Scripts Here |
| skibei_neko | Posted: Sunday, 23 June 04:30AM |
| 1. Immigration 2. This is a very usefull script for semi-persistant worlds. When implimented, it keeps track of the areas the player has last been in. If the player logs off the server and back on, or if the player goes to another server running the same module with this script implimented, the player character will jump to the last area he/she was at. Actually, it does not have to go to the last area...the Builder reduce scripting work by selecting only certain areas to impliment. The best way to describe the usage is to compare it to Diablo 2; when a player logs on, they will appear at the last town of the Act that they last played. This script allows that functionality accross different servers and can be used cooperatively between Builders. Note...its my first time scripting and programming. I'm sure people out there can make this better. 3. Basically this script checks a token passport item in the characters inventory and jumps the player to a corresponding waypoint. If there was no passport item, the script creates one. In order to impliment, you need several components. First, for every area that can be a "save area", you need to create a "passport" item. In this script, the passports are "oOutTown", "oStagingArea", and "oWestDock". If the player discards this passport, they are SOL. I created these three areas. StagingArea is a 1X1 room. This script "immigration" is attached to the "OnEnter" of Staging Area. The other areas need to have waypoints. In this script, the waypoints are "MULTI_OutTown", "MULTI_WestDock". Those areas run corresponding "imm_" scripts on enter. ONE VERY IMPORTANT ITEM is the TOTALAREAS constant. I don't know how to automate the counting of the number of save areas. Each time a save area is added to the module, you need to add to the TOTALAREAS constant in this script and in each of the imm_scripts. Yeah, that means that you have to always go back and modify a lot of scripts . I don't know how to do this better. I suppose that if you can create the passport object in a particular inventory slot, alot of things can be simplified. I just worry about what happens if the player moves it to a different slot. fendis_khan and others helped me make this. Thanks to all the friendly NWN community people who helped me learn how to script. There are a bunch of testing messages in here that you will need to delete later. Also, see the corresponding "imm" scripts after this.
|
|