Jump to content
EM4life

Changing units

Recommended Posts

A topic bump would have gotten my attention..no need for a pm.

GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Vehicle m = l3.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE02LED) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 7, false);
//m.PushActionWait(ACTION_APPEND, 0.5f);
//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);

} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}
}

change that to

GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Vehicle m = l3.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE02LED) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);

} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}
}

And follow this pattern for the other ambulances. If that doesnt work compare it to the stock scripts, which i dont have access to on this pc, and see what they look like there. thats around line 200 of lafirestation.script.

Link to comment
Share on other sites

A topic bump would have gotten my attention..no need for a pm.

GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Vehicle m = l3.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE02LED) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 7, false);
//m.PushActionWait(ACTION_APPEND, 0.5f);
//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);

} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}
}

change that to

GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Vehicle m = l3.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE02LED) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);

} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}
}

And follow this pattern for the other ambulances. If that doesnt work compare it to the stock scripts, which i dont have access to on this pc, and see what they look like there. thats around line 200 of lafirestation.script.

Thanks, I'll coment if there was a change!

EDIT: It only staffs my ambulance with one paramedic...

Link to comment
Share on other sites

I took a quick look. The problem I saw was

			GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Vehicle m = l3.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE02LED) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 7, false);
//m.PushActionWait(ACTION_APPEND, 0.5f);
//m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);

} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}
}

needed to be changed to

			GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Vehicle m = l3.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE02LED) == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);

} else
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 2, false);
}
}
}

Find attached the new LAFireStation.script you need, with all changes made :)

Link to comment
Share on other sites

It seems to be the exact same script as the one Xplorer made above you...though it may have the right changes, so I will try it out.

*2 minutes later*...Wow, you got it! It spawns a paramedic and a paramedic stretcher, thanks for the help.

Link to comment
Share on other sites

It seems to be the exact same script as the one Xplorer made above you...though it may have the right changes, so I will try it out.

*2 minutes later*...Wow, you got it! It spawns a paramedic and a paramedic stretcher, thanks for the help.

Anytime :) Glad I could 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...