Jump to content
Sign in to follow this  
thetrooper

detect if player speed not walking

Recommended Posts

Hi all, is there any way I can run a condition to detect if the squad isn't in safe mode (limited speed)? if player behavior etc?

Basically hopefully going to make the _group all die if they're not walking (acts aggressive)

Maybe speed? I don't know, what do you think?

Edited by TheTrooper
last line edit

Share this post


Link to post
Share on other sites

Just to be sure, by "player" you mean not AI, correct? In this case, anything like behavior and combat mode won't do anything, as those are AI commands (and not checks/returns of any sort).

My only suggestion is to figure out the speed of sprint, then if have a condition be if the speed exceeds something a little less than sprint. Hopefully the squad doesn't magically die if they're sprinting.

In the init.sqf of a test mission, try this:

while {true} do {
   speedvar = speed player;
   player sideChat str speedvar;
   sleep 0.001;
};

That'll tell you your speed for testing purposes.

Share this post


Link to post
Share on other sites

ok thanks. hmm, it's complicated what I'm doing, but the idea is there. You said behavior is for AI...How about determin if a member of the group has his behaviour set to something other than safe or careless and speed of player is greater than? This is interesting :D

I'm thinking trigger with if else statement, not sure of the script.

Synopsis:

Seeking help from a SF unit in their harbor area (hide). Approach it nicely, and get the right password you're ok. Wrong password, or you are running in their area, they will kill you!

Share this post


Link to post
Share on other sites

As I said, I do not believe there is a way to return a behavior.

If you're trying to set it up to where if they are spotted, something happens, then use a Detected By trigger. Other than that, your idea of checking the speed is all I can say.

Share this post


Link to post
Share on other sites

Like any condition, really.

Use the above code I gave you to figure out how fast sprinting is and how fast walking is, and decide your "max speed". For giggles, lets say it is 5. So, here's an application:

script.sqf

speedtest = 0;
while {speedtest < 5} do {
   speedtest = speed unit;
};
player sideChat "Unit is moving faster than 5 kph!";

Share this post


Link to post
Share on other sites

how would one set a condition to tell a player in a vehicle to speed up or slow down? i want to put this into an air rearm script so that jets can rearm in the air in my mission

 

 

On 1/27/2014 at 7:30 AM, KC Grimes said:

Like any condition, really.

Use the above code I gave you to figure out how fast sprinting is and how fast walking is, and decide your "max speed". For giggles, lets say it is 5. So, here's an application:

script.sqf

 


speedtest = 0;
while {speedtest < 5} do {
   speedtest = speed unit;
};
player sideChat "Unit is moving faster than 5 kph!";
 

 

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  

×