| Author | Sticky: Post Working Scripts Here |
| jordinn | Posted: Friday, 19 July 07:14AM |
| 1. Script Name: randominterior and
exitrandomtp 2. What it does: This pair of scripts takes players to randomly selected interiors when using doors and returns them back to their original location when they leave the interior space. 3. Notes: Here is a little script I put together to use for big cities where every building has some random filler content that isn't plot or important, but is filled in with possible encounters. Here is what you need to do: 1) Make 1-20 interior areas generically, and fill with items, encounters, etc. 2) Place a waypoint in each one with the TAG WP_RandomX where X = 1 to 20 (actually the tag is not name specific, but you'll need to specify the right tag in the script.) 3) On the door out, attach the exitrandomtp script to the OnAreaTransitionClick or OnOpen event. 4) Now for each door in the outer area you create, attach the randominterior script to the OnAreaTransitionClick or OnOpen event. This should take the party to a randomly selected interior let them fight, loot, etc, then take them back to the starting point when they use the door to get out. Notes: Currently not tested or written for multiparty modules or persistent worlds. The variables used will have to be adjusted or this could result in parties teleporting to each others locations. I haven't tested and optimized respawn settings for the interiors yet. My next enhancement will be to trigger a respawn timer on the exit of the last player, but I haven't gotten around to that yet. Some side effects of this are present, not sure I know how to avoid them at this point. First, the same door may take you to different interiors when revisting the door. Also if the party splits up and clicks multiple doors, they will end up in the same place. Not good for Hard Core RP Rules or "reality" in the game. Due to the random number functions available, I've set it so you can have 2, 3, 4, 6, 8, 10, 12, 20 possible unique locations. If you want 5, use the 6 function and just make a roll of 6 go to one of the 1-5 locations. Module Level variables used: iPartyCount - Used to track how many go in so you can get them all back out and reset at teh end. iRandomTPActive - Flag for determining if a current random Teleport is going on so all party members can be sent to same location. User Level Variables: lRandomTPLoc - THe loc a user teleported from so they can be returned to that location later. 4. The Script itself
|
|