Jump to content
Sign in to follow this  
hungrytoheal

Forcing The Player's Behaviour

Recommended Posts

Hi,

My current aim at the moment is to force the player to stay in "SAFE" mode (i.e weapon lowered) until a certain waypoint is reached.

If it is also possible, I would like the teamleader to order the player back into formation if he moves 10m out of the yellow formation indicator/waypoint.

The purpose of this script is for a scenario in which the player and his squad are patrolling an area at a slow pace, and I would like to prevent the player from moving away or freely at his own will.

Thanks a lot!

Share this post


Link to post
Share on other sites

I don't know any way to keep the player weapon lowered.

The distance one is quite easy assuming your in a group.

put this in the leaders init

grp1 = group this

just place a trigger and set up as follows

axis a 0, axis b 0

repeating

cond

player distance leader grp1 >10

on act

player commandFollow leqader grp1

If you get more than 10meters away the leader will issue an order to get back.

You can force a player to walk

put this in his init

player forcewalk true;

It's not perfect as you can still sprint.

You could do a speed check and punish him for sprinting

if you had another trigger

axis a 0, axis b 0

repeating

cond

speed player > 8

on act

player setdamage 0.4

The whole thing would be much better in a script though as trigger only run once about every half second.

Share this post


Link to post
Share on other sites

Mate, that's great. Thanks a lot, I can really use a lot of that.

Just a few questions about it though..

How do I deactivate the trigger later on?

I would like to use the groupChat syntax and would like to know how I would delay the text a few seconds after the return to formation command.

Also, the speed player or forcewalk does not seem to be working (I believe they are for OA only, I know forcewalk definately is as shown here.).

Thanks!

Edit:

With

player commandFollow leqader grp1

I was messing around for almost five minutes wondering why the editor was saying "missing ;" until I noticed your typo. :p

Edited by hungrytoheal

Share this post


Link to post
Share on other sites

Pity the forcewalk is only for OA.

Speed will work though, it's been around forever.

That is probably your only option if they try and run punish them.

You could freeze them for a time though.

trigger one

axis a 0, axis b 0

repeating

cond

speed player > 8

on act

player enablesimulation false;check=true

Second trigger

axis a 0, axis b 0

repeating

min 1 mid 1 max 1

cond

check

on act

player enablesimulation true;check=false

You will have to play about with the speed setting.

For the delayed Group chat you could you could use two trigger just like the above example but instead of player enablesimulation true;check=false change that to the group chat code. also use another variable instead of check so things don't get confusing.

To remove a trigger you use first have to name it, then you can delete it later by using deletevehicle triggername

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×