Jump to content
ENG51INE

Scripting Help- Make it so Unmanned vehicles can not be driven

Recommended Posts

I am trying to find a way to script this simple concept.  I am creating a new mod based off of Manchester, NH, USA.  In real life, like with many other cities and towns, many stations are staffed with 4 people that crossman an engine and a ladder.

 

I am looking for a script that will make it so that vehicles can only be moved if they have at least 1 person in them (driver).  I have looked around and have not seen any other scripts like this.  If anyone has any ideas or can offer any assistance, I would greatly appreciate it.  Thank you.

Link to comment
Share on other sites

I am trying to find a way to script this simple concept.  I am creating a new mod based off of Manchester, NH, USA.  In real life, like with many other cities and towns, many stations are staffed with 4 people that crossman an engine and a ladder.

 

I am looking for a script that will make it so that vehicles can only be moved if they have at least 1 person in them (driver).  I have looked around and have not seen any other scripts like this.  If anyone has any ideas or can offer any assistance, I would greatly appreciate it.  Thank you.

I think a script like this appears in the Manhattan Mod v3?

FFMeredith

Link to comment
Share on other sites

Actually guite simple

Go to the move script, find the lines which checks the target
The line starts with
 

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{ 

and add this in there: 

		if(Caller->GetType() == ACTOR_VEHICLE)		{			Vehicle v(Caller);			if(v.GetFreePassengers() > 0 && v.GetNumPassengers() == 0)				return false;		}		return true;

This should give you something that looks a bit like this:

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		mr = Commands::CheckMoveConditions(Caller, Target, childID);		if (mr.Mode == MOVE_ABORT)			return false;		if(Caller->GetType() == ACTOR_VEHICLE)		{			Vehicle v(Caller);			if(v.GetFreePassengers() > 0 && v.GetNumPassengers() == 0)				return false;		}				return true;	}
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...