Areas Scripts
NWN Script: random_interiors_001a.htm
| Author | Sticky: Post Working Scripts Here |
| jordinn | Posted: Monday, 22 July 09:13AM |
| MODS: This is an update to the post on page 28
for the same scripts, that post can be deleted, as all the information is
contained here. Script Name: randominterior and exitrandomtp 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. Description UPDATED TO VERSION 1.5 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. Once they leave the treasure will delay then respawn, encounters in the interiors will respawn at intervals set on the encounter. Notes: New in 1.5: Now henchmen, familiars, summoned, etc will come with you into the rooms. Treasure respawning code added to repopulate placeables that can contain loot. Future Improvements Pending: Set random chance to lock chest on treasure respawn. Use random doors unless character has a city map, then all doors stay static once visited. 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 suggest setting the encounter respawns to a minimum of 5 minutes and maximum of 7 minutes, depending on how close together the doors are. This is subject to your own testing based on the size of the areas you build for the interiors. The treasure respawn is set to 45 seconds after exiting, but this is adjustable to your needs. 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. 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. The Scripts:
|
|
All Areas Scripts
📄 ambient_npc_ani
📄 area_spawner
📄 change_lighting
📄 clean_trash_001
📄 clean_trash_002
📄 clean_trash_003
📄 despawn_mobs
📄 despawn_mobs_002
📄 disable_sound
📄 full_edge_transition_001
📄 full_edge_transition_002
📄 full_edge_transition_003
📄 full_edge_transition_004
📄 full_edge_transition_004a
📄 get_pcs
📄 guard_patrols
📄 keyed_transitions
📄 random_enc_001
📄 random_enc_002
📄 random_enc_003
📄 random_enc_004
📄 random_enc_006
📄 random_enc_009
📄 random_encounter_005
📄 random_interiors
📄 random_interiors_001a
📄 restrict_access
📄 sitting_area