Jump to content
CMCC626

Persons not spawning when calling vehicle via script

Recommended Posts

Hi all,

I am essentially working with a modified version of the LA Battalion Chief script, and the problem that I am having is that the game spawns the vehicle and sends it to the command position, however the game is failing to spawn the crews and thus the vehicles are basically useless. 

The log file states:

|Loading Model mod:Models\Vehicles\02MutualAidFire\Union City E113\E1.v3o
|[VNUM=1.43]
|Model contains 41258 vertices, 14510 polygons, 0 bones, 0 muscleanimframes
|Loading Model mod:Models\Vehicles\02MutualAidFire\Union City E113\ENGINE1_door01.v3o
|[VNUM=1.43]
|Model contains 84 vertices, 28 polygons, 0 bones, 0 muscleanimframes
?Prototype not found: 
?Prototype not found: 
?Prototype not found: 
?Prototype not found: 

 

Where it says ?Prototype not found: should be the 4 firefighters that I want the game to spawn.

 

On another note, when I dispatch a patrol car via the same method it spawns with a crew, and so do tech vehicles; though EMS is also failing to spawn with a crew.

Any thoughts? I've included a code snippit below.

 

		Vehicle s;
		Person p21;
		Person p22;
		Person p23;
		Person p24;
		
		s = Game::CreateVehicle(OBJ_E113, UNNAMED);  //Engine 113
		
		p21 = Game::CreatePerson(PROTO_FF, UNNAMED);
		p22 = Game::CreatePerson(PROTO_FF_SCBA, UNNAMED);
		p23 = Game::CreatePerson(PROTO_FF_SCBA, UNNAMED);
		p24 = Game::CreatePerson(PROTO_FF_SCBA, UNNAMED);
		s.SetPlayerMP(Caller->GetPlayerMP());
		p21.SetPlayerMP(Caller->GetPlayerMP());
		p22.SetPlayerMP(Caller->GetPlayerMP());
		p23.SetPlayerMP(Caller->GetPlayerMP());
		p24.SetPlayerMP(Caller->GetPlayerMP());
		p21.SetUpgradeLevel(3);
		p22.SetUpgradeLevel(3);
		p23.SetUpgradeLevel(3);
		p24.SetUpgradeLevel(3);
		s.SetSpeed(10.0f);
		s.SetMaxPassengers(6);
		s.SetMaxTransports(0);
		s.AddPassenger(&p21);
		s.AddPassenger(&p22);
		s.AddPassenger(&p23);
		s.AddPassenger(&p24);
               	s.SetPosition(Spawn);
               	s.UpdatePlacement();
		s.Hide();
		s.PushActionTurnTo(ACTION_NEWLIST, Rotate);
		s.PushActionWait(ACTION_APPEND, 27.5f);
			Mission::PlayHint(HINT_UNIONCITYE113);
		s.PushActionShowHide(ACTION_APPEND, false);
		s.PushActionMove(ACTION_APPEND, CmdPos);
		if (Game::IsMission())
			s.RemoveCommand("VcmdToFireStation");

		if (!s.HasCommand(DUMMY_HASSIREN) && s.HasCommand(CMD_AUTOSIREN_OFF) && !Input::LShiftPressed() && !Input::RShiftPressed())
			Game::ExecuteCommand(CMD_SIREN, &s, &s);
	}
};

 

  • Upvote 1
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...