X0 i0 infinite

From NWN Lexicon



[edit] x0_i0_infinite

Library for an infinite space system.<br /><br /> This isn't actually infinite, because infinite is very boring. But it is intended to convey the impression of a non-fixed space.<br /><br /> This is going to be used for the infinite desert system, but could also be used for other types just as easily. To create a different infinite system, just do the following:<br /> - create an include file like x0_i0_infdesert which defines the following global constants and functions (easiest: just copy x0_i0_infdesert, change INF_BASE,<br />  and replace the definitions of the functions as appropriate):<br />     string INF_BASE;<br />     void INF_CreateRandomEncounter(object oArea, object oPC);<br />     void INF_CreateRandomPlaceable(object oArea, object oPC);<br />     string INF_GetEntryMessage();<br />     string INF_GetReentryMessage();<br />     string INF_GetReachStartMessage();<br />     string INF_GetReturnToStartMessage();<br />     string INF_GetReachRewardMessage();<br />     string INF_GetReturnToRewardMessage();<br />     string INF_GetPoolEmptyMessage();<br /><br /> - comment out #include "x0_i0_infdesert" in this file and include your new include file in its place.<br /><br /> - rename and recompile all the x0_inf_* scripts.<br /><br /> - of course, you have to create the areas, warning markers, etc., all of which should use the value of INF_BASE in their tags instead of INF_DESERT.<br /> In particular, you will have to make a set of generic areas with tags numbered consecutively starting from 1: <br /> Example:<br />     INF_DESERT_AREA1<br />     INF_DESERT_AREA2<br />     ...<br />     INF_DESERT_AREA10<br /> replacing INF_DESERT with the new value of INF_BASE.<br /><br /> NOTE: This file includes x0_i0_infdesert.

[edit] Constants

Name Value Brief Description
INF_AREA INF_BASE + "_AREA" Generic area tag.
INF_COMPLETED INF_BASE + "_COMPLETED" Permanent completion variable on PC.
INF_CURRENT INF_BASE + "_CURRENT" Current starting point variable on the PC.
INF_ENTERED INF_BASE + "_ENTERED" Permanent starting point variable on PC.
INF_FIXED_LOC INF_BASE + "_FIXED_LOC" Fixed location variable on transition.
INF_OUT_OF_POOL INF_BASE + "_OUT_OF_POOL" Out-of-pool variable on area.
INF_MSG_DELAY 4.0
INF_NTRANS INF_BASE + "_NTRANS" Number of transitions passed variable on PC.
INF_REWARD INF_BASE + "_REWARD" Reward area.
INF_REWARD_KEY INF_BASE + "_REWARD_KEY" Key to reward area.
INF_RUNLEN INF_BASE + "_RUNLEN" Run length variable on PC.
INF_START INF_BASE + "_START" Starting point/entry marker.
INF_TRANS INF_BASE + "_TRANS" Transition.
INF_WARN INF_BASE + "_WARN" Warning marker.


[edit] Functions

Name Brief Description
INF_AreaSetup Set up a generic area, possibly specific to the PC triggering.
INF_AreaCleanup Clean up a generic area.
INF_CleanupPC Clean up the PC on infinite run exit.
INF_CleanupTransition Clean up a transition.
INF_DoFirstTransition Handle the first transition into an area.
INF_DoTransition Master transition function. This is what actually handles most of the work.
INF_GetAreaFromPool Retrieve an area from the pool. If no area is available in the pool, return OBJECT_INVALID.
INF_GetCurrentStartingPoint Get the starting point for this run.
INF_GetFixedLocation Get the fixed location of the transition, OBJECT_INVALID if not set.
INF_GetHasCompleted Get whether the PC has completed this run before.
INF_GetHasEntered Get whether the PC has entered this starting point's run before.
INF_GetHasFinishedRunLength Returns TRUE if the player has reached the end of the run length.
INF_GetIsInInfiniteSpace Determine whether the player is currently inside an infinite area.
INF_GetIsInPool Returns TRUE if the area is not currently taken.
INF_GetIsPartyLeaderInRange TRUE if the PC's party leader is in the same desert area but not in the same room.
INF_GetIsTransition Internal function. Returns TRUE if the object is an infinite transition trigger.
INF_GetNearestTransition Internal function. Get the nearest transition to the object.
INF_GetNumGenericAreas Internal function. Get the number of generic areas that exist (not necessarily the number that are currently available).
INF_GetNumberTransitionsPassed Get the number of transitions passed variable on PC.
INF_GetPartyHasRewardKey TRUE if the player or a party member has the reward key.
INF_GetReturnTransition Get the return transition in the destination area.
INF_GetRewardArea Get the reward area, or OBJECT_INVALID if it doesn't exist.
INF_GetRewardKey Get the reward area key item or OBJECT_INVALID if it doesn't exist.
INF_GetRunLength Get the run length variable on the PC.
INF_IncrNumberTransitionsPassed Increment the number of transitions passed variable.
INF_ItemCleanup Handle item cleanup.
INF_ReallySendMessage Internal function. This is the function that actually sends the message. Use INF_SendMessage instead.
INF_SendMessage

Send a message to the PC after a delay.

Replaces with the name of the area the PC is in, if the message contains that.

INF_SetCurrentStartingPoint Set the starting point for this run.

If OBJECT_INVALID is passed in for oStart, it will clear the variable.
INF_SetFixedLocation Set the fixed location of a transition.
INF_SetHasCompleted Set whether the PC has completed this run before.
INF_SetHasEntered Set that the PC has entered this starting point's run before.
INF_SetIsInPool Mark the area as taken or not.
INF_SetNumberTransitionsPassed Set the number of transitions passed variable. The default is 0.
INF_SetRunLength Set the run length on the PC.
INF_SetupPC Set up the PC on infinite run entry for the specified starting point.
INF_TransportToNewArea Set up a new area and transport the PC through it.

Can also do this with a specified reward area as an argument.
INF_TransportToPartyLeader Send the PC to join the party leader, if in range.
INF_TransportToStartingPoint Send the PC back to the starting point.
INF_TransportToTransition Internal function. Send the PC to a good position inside the given transition.



  author: Mistress, contributor: Graewerld

Personal tools
Categories