Jump to content
Ghost Graphic Designs

Gear up script?

Recommended Posts

Hi again.

 

I was just wondering if it was possible to edit an alarm script (see below) where you make the spawned person prototypes go to a certain VO, play an animation, change the prototype, go to their respective vehicles and then drive off automatically to the location specified by the player?

 

My idea is to add a changeclothes script BEFORE the p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);

 

Is it possible?

//////////////////////////////////////////////////////////////////////////////////////////////////////////// Freeplay Alarm TLF - Script v1.0									                                    //// ************************************************							                            ////													                                                    ////	1.0| PCmdFPAlarmTLF										                                            ////													                                                    //// _____________________										                                        //// a-rescue und Magicman mŸssen in der Readme genannt werden & der Kommentar muss so bleiben.		    //// Sonst freie Nutzung fŸr alle.									                                    ////////////////////////////////////////////////////////////////////////////////////////////////////////////const char IMG_ICON[]           = "incendio31";  // Name des Iconsconst char IMG_CURSOR[]         = "sendto";  // Name des Cursorsconst char COMMANDABLE_TRUE[]   = "DUMMYSetCommandableTrue";const char COMMANDABLE_FALSE[]  = "DUMMYSetCommandableFalse";const char FREEFORALERT_TRUE[]  = "DUMMYFPSetFreeForAlertTrue";const char FREEFORALERT_FALSE[] = "DUMMYFPSetFreeForAlertFalse";const char FREEFORALERT[]       = "DUMMYFPIsFreeForAlert";const char INBASE_TRUE[]        = "DUMMYFPSetInBaseTrue";const char INBASE_FALSE[]       = "DUMMYFPSetInBaseFalse";const char INBASE[]             = "DUMMYFPIsInBase";// 1.0object AlarmFahrzeug3 : CommandScript  // Name des Commands{	AlarmFahrzeug3()               // Name des Commands	{		SetIcon(IMG_ICON);		SetCursor(IMG_CURSOR);		SetValidTargets(ACTOR_FLOOR | ACTOR_STREET);	}		bool CheckPossible(GameObject *Caller)	{		GameObjectList ol;		GameObject *o;		ol = Game::GetGameObjects("VUCI31"); //Name des zu alarmierenden Fahrzeuges		o = *ol.GetObject(0);		Vehicle v(o);		if (!v.HasCommand(FREEFORALERT))			return false;					return true;	}		bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (Caller->GetID() == Target->GetID())			return false;					return true;	}		void PushActions(GameObject *Caller, Actor *Target, int childID)	{		GameObjectList ol;		GameObject *o;		ActorList al;		Actor spawnpoint;		Vector spawnpos;		float rot[9];		float childRot[9];		Vector tpos;		PersonList pl;        Person p;            ActorList al;		Actor spawnpoint;		Vector spawnpos;		ol = Game::GetGameObjects("VUCI31");  //Name des zu alarmierenden Fahrzeuges		o = *ol.GetObject(0);		Vehicle v(o);		if (v.IsDestroyed())		{			Mission::PlayHint("A viatura está destruída e não está mais sob o teu controlo.");			return;		}		if (!v.HasCommand(FREEFORALERT))		{			Mission::PlayHint("Veículo está ocupado numa ocorrência.");			return;		}		else		{			Mission::PlayHint("Saída VUCI 31!");   //Alarmmeldung die angezeigt werden soll			Audio::PlaySample("mod:Audio/FX/OdourOfGas.wav");  //Pfad zum Alarmsound der abspielt werden soll			v.PushActionExecuteCommand(ACTION_NEWLIST, FREEFORALERT_FALSE, &v, 1, true);            al=Game::GetActors("VUCI32_persons");  //Name des viruelles Objektes wo die EinsatzkrŠfte erstellt werden soll			if(al.GetNumActors() > 0)			{				spawnpoint = *al.GetActor(0);				spawnpos   = spawnpoint.GetPosition();			}			else			{				Mission::PlayHint("Pessoal não foi encontrado!");				return;			}			bool ob_personal = false;			pl = v.GetPassengers();			for(int i=0; i < pl.GetNumPersons(); i++)			{				if (pl.GetPerson(i)->HasCommand("entercar"))				{					ob_personal = true;				}			}			bool vinbase = false;			if(v.HasCommand(INBASE))			{				vinbase = true;			}//Personal Block/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////			if (!ob_personal && vinbase)			{				p = Game::CreatePerson("mod:Prototypes/Persons/02 Fire Department/firefighter.e4p","VUCI31");  //Pfad zum Prototyp der Einsatzkraft & Name der Einsatzkraft (wie Fahrzeug)				p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);				Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);				Math::MultiplyMatrices(childRot, rot);				p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);				GameObject *px(p);				Game::FindFreePosition(px, spawnpos, 100);				p.SetPosition(spawnpos);				p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);			}//Personal Block////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////			if (!ob_personal && vinbase)			{				p = Game::CreatePerson("mod:Prototypes/Persons/02 Fire Department/firefighter.e4p","VUCI31"); //Pfad zum Prototyp der Einsatzkraft & Name der Einsatzkraft (wie Fahrzeug)				p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);				Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);				Math::MultiplyMatrices(childRot, rot);				p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);				GameObject *px(p);				Game::FindFreePosition(px, spawnpos, 100);				p.SetPosition(spawnpos);				p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);			}///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Personal Block////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////			if (!ob_personal && vinbase)			{				p = Game::CreatePerson("mod:Prototypes/Persons/02 Fire Department/firefighter.e4p","VUCI31"); //Pfad zum Prototyp der Einsatzkraft & Name der Einsatzkraft (wie Fahrzeug)				p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);				Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);				Math::MultiplyMatrices(childRot, rot);				p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);				GameObject *px(p);				Game::FindFreePosition(px, spawnpos, 100);				p.SetPosition(spawnpos);				p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);			}//Personal Block////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////			if (!ob_personal && vinbase)			{				p = Game::CreatePerson("mod:Prototypes/Persons/02 Fire Department/firefighter.e4p","VUCI31"); //Pfad zum Prototyp der Einsatzkraft & Name der Einsatzkraft (wie Fahrzeug)				p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);				Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);				Math::MultiplyMatrices(childRot, rot);				p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);				GameObject *px(p);				Game::FindFreePosition(px, spawnpos, 100);				p.SetPosition(spawnpos);				p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);			}//Personal Block////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////			if (!ob_personal && vinbase)			{				p = Game::CreatePerson("mod:Prototypes/Persons/02 Fire Department/firefighter.e4p","VUCI31"); //Pfad zum Prototyp der Einsatzkraft & Name der Einsatzkraft (wie Fahrzeug)				p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);				Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);				Math::MultiplyMatrices(childRot, rot);				p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);				GameObject *px(p);				Game::FindFreePosition(px, spawnpos, 100);				p.SetPosition(spawnpos);				p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);			}//Personal Block////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////			if (!ob_personal && vinbase)			{				p = Game::CreatePerson("mod:Prototypes/Persons/02 Fire Department/firefighter.e4p","VUCI31"); //Pfad zum Prototyp der Einsatzkraft & Name der Einsatzkraft (wie Fahrzeug)				p.GetRotation(rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]);				Math::EulerToMatrix(0.f, 0.f, 0.f, childRot);				Math::MultiplyMatrices(childRot, rot);				p.SetRotation(childRot[0], childRot[1], childRot[2], childRot[3], childRot[4], childRot[5], childRot[6], childRot[7], childRot[8]);				GameObject *px(p);				Game::FindFreePosition(px, spawnpos, 100);				p.SetPosition(spawnpos);				p.PushActionExecuteCommand(ACTION_NEWLIST, COMMANDABLE_FALSE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &p, 1, true);				p.PushActionExecuteCommand(ACTION_APPEND, "entercar", o, 0, false);			}//FŸr weitere EinsatzkrŠfte einfach neue Blšcke hier hinzufŸgen			bool ready = false;			if (ob_personal)			{				ready= true;			}			if (vinbase)			{				v.PushActionWait(ACTION_APPEND, 8.0); //Zeit bevor Tor aufgeht                v.PushActionExecuteCommand(ACTION_APPEND, "OpenGate", &v, 1, true);		        v.PushActionWait(ACTION_APPEND, 3.0); //Zeit bis Fahrzeug fŠhrt nachdem das Tor offen ist			}			if (!ready && !vinbase))			{				Mission::PlayHint("Sem pessoal é impossível sair!");			}			v.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_TRUE, &v, 1, true);			if(!v.HasCommand("DUMMYHasSiren"))			{				v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSiren", o, 0, false);			}			v.PushActionExecuteCommand(ACTION_APPEND, INBASE_FALSE, &v, 1, true);			if (ready && !vinbase))			{                            if(!v.HasCommand("DUMMYHasSiren"))			    {					v.PushActionExecuteCommand(ACTION_APPEND, "VCmdSiren", o, 0, false);			    }			} 			tpos = Game::GetCommandPos();			v.PushActionMove(ACTION_APPEND, tpos);		}	}};

Thanks.

Link to comment
Share on other sites

Well, it cán be done. The only problem is: it needs more scripting then just adding the ChangeClothes script before the EnterVehicle bit. It's not complicated, but you need a few extra VO's, and you'd need to direct the personnel to those VO's first, then make them change clothes, and then make them enter the vehicle.

 

I hope I get my school stuff done in a few hours, then I'll give you a more detailed explanation. 

 

--------------

 

Well crap.. I had a huuuge post set up, with all kinds of scripting, but it was getting too complicated to just post it on here. 

I was trying to send all personnel to a specific VO and make them change clothes there, which was OK, but making sure they don't go to the same VO was a bit too much for me without being able to test it and having all needed scripts. But if I may ask: You call this vehicle out, so I assume you're at a different location, not at the fire station. Why would you bother for this animation then? You probably wouldn't see it much.

Link to comment
Share on other sites

Well, it cán be done. The only problem is: it needs more scripting then just adding the ChangeClothes script before the EnterVehicle bit. It's not complicated, but you need a few extra VO's, and you'd need to direct the personnel to those VO's first, then make them change clothes, and then make them enter the vehicle.

 

I hope I get my school stuff done in a few hours, then I'll give you a more detailed explanation. 

 

--------------

 

Well crap.. I had a huuuge post set up, with all kinds of scripting, but it was getting too complicated to just post it on here. 

I was trying to send all personnel to a specific VO and make them change clothes there, which was OK, but making sure they don't go to the same VO was a bit too much for me without being able to test it and having all needed scripts. But if I may ask: You call this vehicle out, so I assume you're at a different location, not at the fire station. Why would you bother for this animation then? You probably wouldn't see it much.

Yeah... It's better to keep it simple. 

 

Thanks for the help. :)

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...