Hallo,
ich hoffe mir kann einer Helfen und zwar geht es um das Bieberfelde Script.
Ich würde da gerne bei den Löschzügen meine eigene Alarm sound einfügen also das jeder Alarmstichwort sein eigenen Sound hat. Wie müsste es dann aussehen.
Spoiler anzeigen
object VcmdB1 : CommandScript
{
VcmdB1()
{
SetIcon("alarm");
SetCursor("alarm");
SetPriority(201);
}
bool CheckPossible(GameObject *Caller)
{
return true;
}
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
return Target->GetType()==ACTOR_STREET||Target->GetType()==ACTOR_FLOOR;
}
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
if(childID==0){
GameObject obj=Game::CreateObject("mod:Prototypes/Objects/Dummy/houselight2.e4p","Unnamed");
obj.SetPosition(Game::GetCommandPos());
obj.Show();
obj.PushActionWait(ACTION_APPEND,120);
obj.PushActionDeleteOwner(ACTION_APPEND);
Game::ExecuteCommand("wachampel",Caller);
Caller->PushActionWait(ACTION_APPEND,3.0);
Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdB1",&obj,-1,false);
GameObjectList l2 = Game::GetGameObjects("Dummy_FW1");
if(l2.GetNumObjects() == 0)
{
GameObject mDummy = Game::CreateObject("mod:Prototypes/Objects/Misc/empty.e4p", "Dummy_FW1");
mDummy.Hide();
mDummy.SetUserData(100);
}
l2 = Game::GetGameObjects("Dummy_FW1");
GameObject dummdumm(l2.GetObject(0));
if(dummdumm.GetUserData() == 100)
{
dummdumm.SetUserData(-1);
dummdumm.PushActionExecuteCommand(ACTION_NEWLIST, "PlayAlarmSound", &dummdumm, 12, false);
dummdumm.PushActionWait(ACTION_APPEND, 8.f);
dummdumm.PushActionExecuteCommand(ACTION_APPEND, "SirDummy", &dummdumm, 0, false);
}
}else if(childID==-1){
Game::ExecuteCommand("VcmdAlarm",VehicleList("01_46_01").GetVehicle(0),VehicleList("01_46_01").GetVehicle(0));
Caller->PushActionWait(ACTION_APPEND,14.0);
Caller->PushActionExecuteCommand(ACTION_APPEND,"VcmdB1",Target,1,false);
}else if(childID==1){
GameObject obj(Target);
obj.PushActionWait(ACTION_APPEND,60);
obj.PushActionDeleteOwner(ACTION_APPEND);
float wait=2.0;
System::Log("Halbzug %i,0",childID);
Vehicle v1(VehicleList("01_46_01").GetVehicle(0));
if(v1.IsCollidingWithVirtualObject("LZW1")){v1.PushActionWait(ACTION_APPEND,wait);Xmlutil::MoveTo(v1,obj);wait+=2.0;}
}
}
};
MfG