Jump to content
mariuswww

Lights While Moving.

Recommended Posts

Is it possible to make for example "Red Lights" category (or any other) to flash while the unit moves and stop flashing when the unit stop?

 

Here is the move script I want to edit. (From LA Mod edited by Manhattan Mod)

 

 
const char DUMMY_NEED_EX[] = "DummyChange";
 
object MoveTo : CommandScript
{
MoveResult mr;
bool TankCanMove;
MoveTo()
{
SetValidTargets(ACTOR_FLOOR | ACTOR_OBJECT | ACTOR_VIRTUAL | ACTOR_HOUSE | ACTOR_OPEN_HOUSE);
SetHighlightingEnabled(false);
SetDeselectCaller(false);
//SetActivationByLeftClick(true);
}
 
bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid() || Caller->HasCommand("DummySniper"))
return false;
if (Caller->GetType() == ACTOR_VEHICLE)
{
Vehicle v(Caller);
if (v.GetNumPassengers() == 0)
return false;
if (v.HasCommand("EngineOns"))
return false;
if (StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/01 US Army Camo/abrams.e4p") == 0 || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/01 US Army Camo/bradley.e4p") == 0)
{
PersonList l1 = v.GetPassengers();
TankCanMove = false;
for(int i=0; i < l1.GetNumPersons(); i++)
{
if (!TankCanMove && StrCompare(l1.GetPerson(i)->GetPrototypeFileName(), "mod:Prototypes/Persons/01 US Army/tank_crew.e4p") == 0)
TankCanMove = true;
}
if (!TankCanMove)
return false;
}
}
return true;
}
 
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
mr = Commands::CheckMoveConditions(Caller, Target, childID);
if(mr.Mode == MOVE_ABORT)
return false;
if (Caller->GetType() == ACTOR_VEHICLE)
{
Vehicle v(Caller);
if (v.GetNumPassengers() == 0 && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/01 US Army Camo/us_army_supply_truck.e4p") != 0)
return false;
}
return true;
}
 
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
if(mr.Mode == MOVE_ABORT)
return;
 
switch(mr.Mode)
{
case MOVE_TO_POSITION: // directly to target
{
if(Caller->GetFirehoseID() > 0)
{
Caller->PushActionMoveWithHose(ACTION_NEWLIST, mr.Target);
return;
}
Caller->PushActionMove(ACTION_NEWLIST, mr.Target, true);
break;
}
 
case MOVE_INTO_HOUSE: // into house, to target
{
Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
Caller->PushActionEnterHouse(ACTION_APPEND, &mr.EnterHouse);
Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
break;
}
 
case MOVE_HOUSE_TO_HOUSE: // out of house, into other house, to target
{
Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
Caller->PushActionLeaveHouse(ACTION_APPEND, &mr.LeaveHouse);
Caller->PushActionMove(ACTION_APPEND, mr.Intermediate2, true);
Caller->PushActionEnterHouse(ACTION_APPEND, &mr.EnterHouse);
Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
break;
}
 
case MOVE_HOUSE_TO_POSITION: // out of house
{
Caller->PushActionMove(ACTION_NEWLIST, mr.Intermediate1, true);
Caller->PushActionLeaveHouse(ACTION_APPEND, &mr.LeaveHouse);
Caller->PushActionMove(ACTION_APPEND, mr.Target, true);
break;
}
}
 
if (Caller->GetType() == ACTOR_VEHICLE)
{
Vehicle v(Caller);
//if (v.IsLightOn())
//Caller->PushActionLightOn(ACTION_INSERT,false);
if ((v.GetVehicleType() == VT_AMBULANCE_RTW || v.GetVehicleType() == VT_AMBULANCE_ITW) && !v.IsBlueLightEnabled() && v.GetNumTransported() > 0)
v.EnableBlueLights(true);
if (!v.HasCommand("DummyHasSiren") && v.HasCommand("VcmdSiren") && v.HasCommand("VcmdAutoSirenOff") && !Input::LShiftPressed() && !Input::RShiftPressed())
Game::ExecuteCommand("VcmdSiren", &v, &v);
else if (!v.HasCommand("DummyHasEngine") && !v.HasCommand("DummyHasSiren"))
Game::ExecuteCommand("DummyEngine", &v, &v);
else if(v.HasCommand("DUMMYNeedsHose"));
v.SetChildEnabled("hose", true);
v.RemoveCommand("DUMMYNeedsHose");
else if (Caller->GetType() == ACTOR_PERSON)
{
Person p(Caller);
if(p.GetEquipment() == EQUIP_RIFLE && p.IsAiming() || p.IsCurrentAnimation("shootrifle"))
{
p.PushActionAimEnd(ACTION_INSERT);
}
}
 
// Special code for fgrr (Bergefahrzeug). Deinstalls itself automatically
if (mr.UnInstall) 
{
Vehicle v(Caller);
if (v.GetVehicleType() == VT_THW_FGRR_BKF)
{
//System::Print("FGRR: Mode 1 - DeInstall");
Caller->PushActionDeinstall(ACTION_INSERT);
}
else if (v.GetVehicleType() == VT_FIREFIGHTERS_DLK)
{
if (mr.BasketDown && mr.UnInstall)
{
Caller->PushActionDeinstall(ACTION_INSERT);
Caller->PushActionBasketDown(ACTION_INSERT, Vector(0.f, 0.f, 0.f));
}
else if (mr.BasketDown)
    Caller->PushActionBasketDown(ACTION_INSERT, Vector(0.f, 0.f, 0.f));
else if (mr.UnInstall)
    Caller->PushActionDeinstall(ACTION_INSERT);
}
}
}

};

 

All inputs are appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...