Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
List of all members
JFW_Repair_Zone_2 Class Reference

Repair Zone (Extended) More...

#include <jfwzone.h>

Detailed Description

Author
jonwil
Daniel Paul (danpa.nosp@m.ul88.nosp@m.@yaho.nosp@m.o.co.nosp@m..uk) (added WaitForKeyhook and wrote documentation)

This script should be attached to a script zone to create an area in which vehicles can be repaired for a fee based on the price of the vehicle, or for free if Credits is set to 0.

When WaitForKeyhook is set to 1 (the default) the driver must press the button on their keyboard which is bound to the "Repair" event to start repairing their vehicle, otherwise the vehicle will start being repaired as soon as it enters the repair zone. Note that only one vehicle can be repaired at a time.

Parameters
Player_TypeSpecify which teams can repair vehicles in this zone... 0 for Nod, 1 for GDI, 2 for both
Repair_DistanceThe maximum distance from the center of the script zone the vehicle can move before repairs stop. This should be greater than the size of the actual zone or you might find vehicles trigger the script beyond this distance and then bug out, requiring the driver to leave and re-enter the zone
Repair_HealthThe amount of health to restore every second
SoundThe name of a sound preset to be played to the vehicle driver when the keyhook is installed, unless WaitForKeyhook is set to 0
CreditsA divisor applied to the cost of the vehicle to determine the cost of each repair tick... see the notes below, it's not exactly a straightforward calculation to figure out the actual cost
RepairSoundThe name of a sound preset to be played to the vehicle driver when repairing begins
RepairStopSoundThe name of a sound preset to be played to the vehicle driver once their vehicle is repaired
WaitForKeyhookSet to 1 to wait for the player to press the key bound to the "Repair" event on their keyboard or 0 to repair as soon as they enter the zone
Note
I'm not entirely sure why the repair cost is calculated this way, nor how to explain it in an easy to understand way so I'll simple write out the process used...
For each repair "tick", which occurs once per second, the cost is calculated as (vehicle_cost>2) / Credits (the script parameter), where vehicle_cost is the price to purchase the vehicle. Thus if a vehicle costs 1000 credits and you've set Credits to 4.00 the value will be;
(1000/2)/4.00 = 125
If the driver has at least 125 credits the script will then repair Repair_Health health and also Repair_Health armour, if either or both of them need repairing. If only health was repaired the cost will be halved, otherwise the full price is charged for that "tick". Note that even if it only repairs 1 health and 1 armour you'll still get charged 125 credits.