Jump to content
Sign in to follow this  
RyanTurner

Behaviour Actions [Help]

Recommended Posts

Decent at Procedural Programming, but when it's get to OOP I get lost. But a simple pair of questions if anyone could help.

 

-Wanted to do while my squad it's safe or aware (or anything but combat, this being the "behaviour") they are automatic healed, and if they do suffer "lethal"/ or "terminal" (death) damage they wouldn't die;

-While In combat if they get "killed" to heal them, play an wounded animation, immune to damage and stay surrendered (As the status, _WhoEverAiGotShot setCaptive true;);

-When the combat ("behaviour") ends they would stop the animation, be non-immune and back on their feet;

 

// init.sqf

0 = [] spawn

{
	while {true}do
	{
		waitUntil{behaviour Player == "AWARE"};

		hintSilent(behaviour Player);
		sleep 0.5;

		{_x setDamage 0} foreach units group Player;

		waitUntil{behaviour Player == "COMBAT"};

		hintSilent(behaviour Player);
		sleep 0.5
	};
};

This so far what I got, i don't know how to check Player's Group instead of Player behaviour, or Player's Group always the same as their members?

I only got working the healing, while "AWARE" they are getting heal every second, I don't want someone to do it for me, Just to give some help to get it in my own way.

 

Quote

Give a man a fish, and he will be hungry again to-morrow; teach him to catch a fish, and he will be richer all his life.

 

Thanks for reading ^^

-Ryan

  • Like 1

Share this post


Link to post
Share on other sites

@RyanTurner,

I think this will work for you,

init.sqf,

fnc_playerBEHAVE =
{
    _behave = behaviour player;

    systemChat format ["%1", _behave];

};

And this when you need to call it,

[]call fnc_playerBEHAVE;

Have fun!

Edited by wogz187
or at least it's some kind of net.

Share this post


Link to post
Share on other sites

@wogz187

hintSilent(behaviour Player);

Does the same as the function you mentioned, the behaviour question was it possible to check the Squad/Group's Behaviour, or is the Squad/Groups's Behaviour = To the Group Leader (this case the Player);

  • Thanks 1

Share this post


Link to post
Share on other sites

@RyanTurner,
 

Quote

hintSilent(behaviour Player);

That's good to know.

I don't have the answer to your question (I assume yes but... ArmA 3, you know),

fnc_playerBEHAVE = {     
_behave = behaviour player;
_behaveG = behaviour group player;
systemChat format ["%1", _behave]; 
systemChat format ["%1", _behaveG]; 
};

will this help determine the answer?

Share this post


Link to post
Share on other sites

@wogz187

 

behaviour group player;

behaviour group player;

Will give you an error since the parameters are just "behaviour unitName" , but thanks still I tried it for a few hours yesterday.

Share this post


Link to post
Share on other sites

@RyanTurner
Madrussian says:

Quote

"Although setBehaviour can be called on an individual unit, the entire group will be affected."


Check out what @pierremgi said here.

The behaviour of a unit should be the same as that unit's group behaviour.

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  

×