Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
Protected Attributes | List of all members
dp88_Ore_Miner Class Reference

Ore Miner. More...

#include <dp88_ar.h>

Protected Attributes

int m_aiState
 Current AI state.
 
int m_oreMined
 Current number of mined ore loads onboard.
 
int m_oreValue
 Cumulative value of all ore loads onboard.
 
int m_oreFieldId
 ID of the ore field we are currently mining ore from.
 
int m_oreFieldRand
 Used to prevent glitching by entering/exiting an ore field rapidly. 0 = not in ore field.
 
Cached Script Parameters
bool m_bUseAI
 Is AI enabled?
 
int m_oreCapacity
 Maximum number of mined ore units onboard.
 
float m_oreMiningTime
 Time required to mine one ore unit.
 
float m_oreDumpTime
 Time required to dump ore at a refinery.
 
const char * m_resourceName
 Resource name for strings>
 

Detailed Description

Author
Daniel Paul (danpa.nosp@m.ul88.nosp@m.@yaho.nosp@m.o.co.nosp@m..uk)

This class contains the basic logic for the ore miners used in Apocalypse Rising and supports both AI and player controlled miners. A miner can collect ore from any ore fields defined by a script zone with the dp88_AR_Ore_Field_Zone script attached to it, which determines the value of each ore 'unit' in that field, thus implicitly supporting gem fields with the same scripts.

The miner can hold up to a configurable number of ore units, each of which takes a configurable amount of time to mine from the ore field. Mining is achieved by remaining inside an ore field whilst ore units are 'collected'.

Miners can deposit ore at any time as long as they have at least one unit mined, with the total value of the deposit being based on the number of units collected and the value of each unit. Ore deposits are achieved by entering a script zone with the dp88_Ore_Dump_Zone attached to it with the team parameter matching that of the miner.

When the AI is enabled the miner will use the pathfind grid to locate the nearest ore field and drive to it to begin mining. Once it has collected a full load of ore it will locate the nearest ore deposit zone and drive there to unload it's ore. This will be repeated ad-infinitum until the miner is destroyed. If you have problems with the miner getting stuck on terrain or other objects you should place pathfind blockers around the problematic areas and re-generate pathfind data to make it route around those locations.

Parameters
Use_AISpecifies that this miner should use its AI to mine autonomously. 1 to enable AI, 0 otherwise
Ore_CapacityMaximum number of ore units this miner can store
Ore_Mining_TimeThe amount of time, in seconds, it takes to mine one ore unit from an ore field
Ore_Dump_TimeThe amount of time, in seconds, it takes to unload all ore units at an ore deposit zone
AI_Init_DelayIf the miner AI is enabled this specifies the initial delay before starting the first AI action, which is required to avoid the original Renegade Harvester AI overriding this one.
Dump_AnimationAn optional animation to be played when depositing ore at a refinery
Dump_SoundAn optional sound effect to be played when depositing ore at a refinery
Mining_AnimationAn optional animation to be played in a loop whilst mining in an ore field
Mining_SoundAn optional sound effect to be played each time the ore load level increases
Idle_AnimationAn optional animation to be played in a loop when the miner is not mining or docked
Resource_NameThe name of hte resource field (defaults to ore if none is specified)
Note
Because this script is designed to act as a base class for both types of AR miner it is not named after either teams miner and does not appear as an available script in LevelEdit. However, because there is no additional logic required for the Soviet War Miner there isn't actually a derived script for that at this time, thus the dp88_AR_War_Miner script in LevelEdit is really an instance of this base class script.