After:
Vehicle vec(Caller);
Create new line(enter) and add something like this:
Vehicle v(Caller);
if (v.IsCollidingWithVirtualObject(VO_ENGINE01) || v.IsCollidingWithVirtualObject(VO_ENGINE02) || v.IsCollidingWithVirtualObject(VO_TILLER))
return false;
No I assume you have more VOs then that, so you could use a SQUAD VO that covers the entire FS, but the engine would die to soon imo. Actually even this way it might die to soon..you might be better off usign the LAtoFireStation script like this:
else if(StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)
{
GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_TILLER, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
Mission::PlayHint(HINT_NOSPACE);
Game::ExecuteCommand(CMD_GOHOME, &v, &v);
return;
} else
{
ActorList l1 = Game::GetActors(VO_FP3);
ActorList l2 = Game::GetActors(VO_TURNTO3);
m.PushActionWait(ACTION_APPEND, 3.5f);
m.PushActionExecuteCommand(ACTION_APPEND, CMD_COMMAND, Caller, 0, false);
}
}
In this case CMD_COMMAND could be CMD_E1 and at the top of the tofs script with the constants for the OBJs and VOs add
const char CMD_E1[] = "Engine1";
Because you have decided the game is going to recognize this command as simply "Engine1" when you go to the editor to assign the command. If your going to do a separate script for each vehicle I would suggest naming this one object VcmdEngine1Noise : CommandScript
Also:
object Engine1 : CommandScript
{
Engine()
The Engine on the second lien should be Engine1 as well. Whatever comes afer object and before the : should always go on that following line:
object Engine1 : CommandScript
{
Engine1()