x0_i0_infinite

Library for an infinite space system.

This isn't actually infinite, because infinite is very boring. But it is intended to convey the impression of a non-fixed space.

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:
- 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,
 and replace the definitions of the functions as appropriate):
    string INF_BASE;
    void INF_CreateRandomEncounter(object oArea, object oPC);
    void INF_CreateRandomPlaceable(object oArea, object oPC);
    string INF_GetEntryMessage();
    string INF_GetReentryMessage();
    string INF_GetReachStartMessage();
    string INF_GetReturnToStartMessage();
    string INF_GetReachRewardMessage();
    string INF_GetReturnToRewardMessage();
    string INF_GetPoolEmptyMessage();

- comment out #include "x0_i0_infdesert" in this file and include your new include file in its place.

- rename and recompile all the x0_inf_* scripts.

- 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.
In particular, you will have to make a set of generic areas with tags numbered consecutively starting from 1:
Example:
    INF_DESERT_AREA1
    INF_DESERT_AREA2
    ...
    INF_DESERT_AREA10
replacing INF_DESERT with the new value of INF_BASE.

NOTE: This file includes x0_i0_common and x0_i0_infdesert.

Constants

NameValueBrief Description
INF_AREAINF_BASE + "_AREA"Generic area tag.
INF_COMPLETEDINF_BASE + "_COMPLETED"Permanent completion variable on PC.
INF_CURRENTINF_BASE + "_CURRENT"Current starting point variable on the PC.
INF_ENTEREDINF_BASE + "_ENTERED"Permanent starting point variable on PC.
INF_FIXED_LOCINF_BASE + "_FIXED_LOC"Fixed location variable on transition.
INF_OUT_OF_POOLINF_BASE + "_OUT_OF_POOL"Out-of-pool variable on area.
INF_MSG_DELAY4.0
INF_NTRANSINF_BASE + "_NTRANS"Number of transitions passed variable on PC.
INF_REWARDINF_BASE + "_REWARD"Reward area.
INF_REWARD_KEYINF_BASE + "_REWARD_KEY"Key to reward area.
INF_RUNLENINF_BASE + "_RUNLEN"Run length variable on PC.
INF_STARTINF_BASE + "_START"Starting point/entry marker.
INF_TRANSINF_BASE + "_TRANS"Transition.
INF_WARNINF_BASE + "_WARN"Warning marker.

Functions

NameBrief Description
INF_AreaSetupSet up a generic area, possibly specific to the PC triggering.
INF_AreaCleanupClean up a generic area.
INF_CleanupPCClean up the PC on infinite run exit.
INF_CleanupTransitionClean up a transition.
INF_DoFirstTransitionHandle the first transition into an area.
INF_DoTransitionMaster transition function. This is what actually handles most of the work.
INF_GetAreaFromPoolRetrieve an area from the pool. If no area is available in the pool, return OBJECT_INVALID.
INF_GetCurrentStartingPointGet the starting point for this run.
INF_GetFixedLocationGet the fixed location of the transition, OBJECT_INVALID if not set.
INF_GetHasCompletedGet whether the PC has completed this run before.
INF_GetHasEnteredGet whether the PC has entered this starting point's run before.
INF_GetHasFinishedRunLengthReturns TRUE if the player has reached the end of the run length.
INF_GetIsInInfiniteSpaceDetermine whether the player is currently inside an infinite area.
INF_GetIsInPoolReturns TRUE if the area is not currently taken.
INF_GetIsPartyLeaderInRangeTRUE if the PC's party leader is in the same desert area but not in the same room.
INF_GetIsTransitionInternal function. Returns TRUE if the object is an infinite transition trigger.
INF_GetNearestTransitionInternal function. Get the nearest transition to the object.
INF_GetNumGenericAreasInternal function. Get the number of generic areas that exist (not necessarily the number that are currently available).
INF_GetNumberTransitionsPassedGet the number of transitions passed variable on PC.
INF_GetPartyHasRewardKeyTRUE if the player or a party member has the reward key.
INF_GetReturnTransitionGet the return transition in the destination area.
INF_GetRewardAreaGet the reward area, or OBJECT_INVALID if it doesn't exist.
INF_GetRewardKeyGet the reward area key item or OBJECT_INVALID if it doesn't exist.
INF_GetRunLengthGet the run length variable on the PC.
INF_IncrNumberTransitionsPassedIncrement the number of transitions passed variable.
INF_ItemCleanupHandle item cleanup.
INF_ReallySendMessageInternal function. This is the function that actually sends the message. Use INF_SendMessage instead.
INF_SendMessageSend 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_SetCurrentStartingPointSet the starting point for this run.

If OBJECT_INVALID is passed in for oStart, it will clear the variable.
INF_SetFixedLocationSet the fixed location of a transition.
INF_SetHasCompletedSet whether the PC has completed this run before.
INF_SetHasEnteredSet that the PC has entered this starting point's run before.
INF_SetIsInPoolMark the area as taken or not.
INF_SetNumberTransitionsPassedSet the number of transitions passed variable. The default is 0.
INF_SetRunLengthSet the run length on the PC.
INF_SetupPCSet up the PC on infinite run entry for the specified starting point.
INF_TransportToNewAreaSet up a new area and transport the PC through it.

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


  author: Mistress, contributor: Graewerld