Try this one.
const char NAME_OBJECT[] = "camera"; //Name of evidence (make sure it can be picked up)
const char NAME_CAR[] = "stolencar"; //Name of stolen car
const char OBJ_OBJECT[] = "Equipment/tvcamera.V3O"; //Path to model of evidence
const char OBJECTIVE_TERROR[] = "Arrest two gangsters!";
const char OBJECTIVE_CAR[] = "Tow the stolen vehicle wreck to base!";
const char OBJECTIVE_OBJECT[] = "Collect evidence!";
const char OBJECTIVE_TRANSPORT[] = "Take away the injured!";
object Mission01 : MissionScript
{
GameObject mObject;
Mission01()
{
System::SetEnv("e3_doocclusion", 0);
}
~Mission01()
{
System::SetEnv("e3_doocclusion", 1);
}
void Start()
{
GameObjectList list = Game::GetGameObjects();
for(int i = 0; i < list.GetNumObjects(); ++i)
{
GameObject *obj = list.GetObject(i);
if(obj->HasName(NAME_OBJECT))
{
mObject = *obj;
//if (!mObject.IsFlagSet(OF_PORTABLE))
// mObject.SetFlag(OF_PORTABLE);
}
}
Mission::AddObjective(OBJECTIVE_TERROR);
Mission::AddObjective(OBJECTIVE_TOW);
Mission::AddObjective(OBJECTIVE_OBJECT);
Mission::AddObjective(OBJECTIVE_TRANSPORT);
}
bool OnCheckCommand(const char* Command, GameObject *Caller, Actor *Target)
{
switch(Command)
{
case "PickUp":
{
if(Caller->GetType() == ACTOR_PERSON)
{
if((!Caller->HasCommand("Arrest") || Caller->HasCommand("GetFlashgrenade")) && Target->GetID() == mObject.GetID())
return false;
}
break;
}
}
return true;
}
ActionCallbackResult OnAbortAction(const char *Action, ActionCallback* Data)
{
switch(Action)
{
case "EActionPickUp":
{
if(Data->Parameters[0].iValue == mObject.GetID() && Data->Parameters[1].iValue >= 2)
{
Person owner(Data->Owner);
owner.PlaceObjectInRightHand(OBJ_OBJECT);
owner.EnableCommand("Arrest", false);
owner.EnableCommand("Redirect", false);
owner.EnableCommand("Drop", false);
owner.EnableCommand("GetRoadBlock", false);
owner.EnableCommand("Halt", false);
owner.EnableCommand("HaltVehicle", false);
}
break;
}
}
return ACTION_CONTINUE;
}
void OnMissionLeft(GameObject *obj)
{
if(obj->GetID() == mObject.GetID())
Mission::SetObjectiveAccomplished(OBJECTIVE_OBJECT, true);
else if (obj->HasName(NAME_CAR))
Mission::SetObjectiveAccomplished(OBJECTIVE_CAR, true);
}
MissionState GetMissionState()
{
if(Mission::GetCounter("Gangsters") == 0)
{
if(!Mission::IsObjectiveAccomplished(OBJECTIVE_TERROR))
Mission::SetObjectiveAccomplished(OBJECTIVE_TERROR, true);
}
else
{
if(Mission::IsObjectiveAccomplished(OBJECTIVE_TERROR))
Mission::SetObjectiveAccomplished(OBJECTIVE_TERROR, false);
}
if(Mission::GetCounter("Injured Persons") + Mission::GetCounter("Dead Persons") == 0)
{
if(!Mission::IsObjectiveAccomplished(OBJECTIVE_TRANSPORT))
Mission::SetObjectiveAccomplished(OBJECTIVE_TRANSPORT, true);
}
else
{
if(Mission::IsObjectiveAccomplished(OBJECTIVE_TRANSPORT))
Mission::SetObjectiveAccomplished(OBJECTIVE_TRANSPORT, false);
}
if(Mission::IsDefaultLogicNegative())
return MISSION_FAILED;
if(Mission::IsDefaultLogicPositive() && Mission::AllObjectivesAccomplished())
return MISSION_SUCCEEDED;
return MISSION_RUNNING;
}
bool SerializeTo(ScriptSerializer *Stream)
{
int version = 0x100;
Stream->Write(version);
Stream->Write(mObject);
return true;
}
bool SerializeFrom(ScriptSerializer *Stream)
{
int version;
Stream->Read(version);
Stream->Read(mObject);
return true;
}
};
Copy/paste this text into an empty Notepad file and save as mission01.script.
You can change the text between the brackets in the first 7 lines.
About the evidence. Use a police officer to collect it. Make sure he has the command PickUp.
When he picks the evidence up, the videocamera will be put in his hand. Send him in a car to HQ to finish that objective.