== Umfeldbeleuchtungs-Script ==
The ambient lighting script is used to illuminate the area of emergency vehicle. All environment lights must be defined as "Special Lights" in the editor.
The ambient lighting script has the name "VCmdSurroundingLights". "Cmd" is my personal brand of script naming. "VCmd" means "VehicleCommando".
The Script is offered as a download, as well as a code directly on this page. (surroundinglights.rar)
If error messages and problems occur, the author of the script can be contacted. For this, a detailed description of the fault and, optimally, a log file is to be added.
The ambient lighting script is used to illuminate the area of emergency vehicle. All environment lights must be defined as "Special Lights" in the editor.
1 Operation
The ambient lighting script has the name "VCmdSurroundingLights". "Cmd" is my personal brand of script naming. "VCmd" means "VehicleCommando".
For proper function the vehicle requires only "VCmdSurroundingLights" in the editor . How a vehicle is assigned to a command script, is explained in the editor instructions.
2 Script
The Script is offered as a download, as well as a code directly on this page. (surroundinglights.rar)
Code
const char DUMMY_HASSURLIGHTS[] = "DUMMYHasSurroundingLights";
// Here the name(!) of the image of the UI folder must stand .
const char IMG[] = "SurroundingLights";
int DummyGroup = 20;
// 1.0
object VCmdSurroundingLights : CommandScript
{
VCmdSurroundingLights()
{
SetIcon(IMG);
SetCursor(IMG);
SetRestrictions(RESTRICT_SELFEXECUTE);
}
bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;
if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}
return false;
}
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
return false;
if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}
return true;
}
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(Caller);
if (v.HasCommand(DUMMY_HASSURLIGHTS))
{
v.EnableSpecialLights(false);
v.RemoveCommand(DUMMY_HASSURLIGHTS);
return;
}
if (!v.HasCommand(DUMMY_HASSURLIGHTS))
{
v.EnableSpecialLights(true);
v.AssignCommand(DUMMY_HASSURLIGHTS);
return;
}
}
};
// 1.1
object DUMMYHasSurroundingLights : CommandScript
{
DUMMYHasSurroundingLights()
{
SetGroupID(DummyGroup);
}
bool CheckGroupVisibility(GameObject *Caller)
{
return false;
}
bool CheckPossible(GameObject *Caller)
{
return false;
}
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
return false;
}
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
}
};
Display More
3 Troubleshooting
If error messages and problems occur, the author of the script can be contacted. For this, a detailed description of the fault and, optimally, a log file is to be added.
Author: Bass-ti
Contact: Bass-ti@ddr-mod.de
Script name: SurroundingLights.script
Script version: V.1.0 Datum: 29.04.2006
Note: All subsequent environment lights shall be defined as Special Lights.