Jump to content
Sign in to follow this  
Moon_chilD

Some Playable Units played by AI and some not!

Recommended Posts

Hey guys,

okay, the title sucks. I know.

What I mean:

I have a mission with lets say twenty playable units. Now I want to have at least 10 units running around in multiplayer but I only have 5 player with me.

So the task is:

I want to have 10 units be taken over by AI at mission start (at least if the spots are not taken by players)

and 10 units should not be taken over by AI!

Is that somehow possible?

Of course I know, that I can deactivate the AI on certain slots in the slot selection screen, but I don't want to do that all the time!

Any Idea?

Many Greetings

Moony

Share this post


Link to post
Share on other sites

I don't know if it is possible to enable/disable AI using SQF, but you can use enableSimulation to totally disable certain units and prevent them from acting at all. That way, you won't actually make them get rid of the AI, but they will not do anything, not even blink.

Share this post


Link to post
Share on other sites

Can you not just delete them?

_minNumberOfUnitsWanted = 10;
_numberOfPlayers = { isPlayer _x }count playableUnits;
_ammountToRemove = ( { !isPlayer _x }count playableUnits ) - (( _minNumberOfUnitsWanted - _numberOfPlayers ) max 0 ) ;
{
if ( _ammountToRemove <= 0 ) exitWith {};
if !( isPlayer _x ) then {
	deleteVehicle _x;
	_ammountToRemove = _ammountToRemove - 1;
};
}forEach playableUnits;

Think there is a maths fail in there but you get the idea :)

Edited by Larrow

Share this post


Link to post
Share on other sites

have you tried to deselect slots you dont want to become AI on role selection screen before launching the mission?

Share this post


Link to post
Share on other sites
have you tried to deselect slots you dont want to become AI on role selection screen before launching the mission?

As far as I understand him, he's aware of that possibility, but he doesn't want to do it all over again at every mission start:

Of course I know, that I can deactivate the AI on certain slots in the slot selection screen, but I don't want to do that all the time!

Any Idea?

Share this post


Link to post
Share on other sites
As far as I understand him' date=' he's aware of that possibility, but he doesn't want to do it all over again at every mission start:[/quote']

Must have missed that. Well one other thing is that the probability of presence could be set to 0 on the units that are not supposed to become AI. AFAIK player can still join on those. Also putting some expression in condition of presence can make it dynamic as well.

[color="#FF8040"][color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]![/b][/color][color="#191970"][b]isPlayer[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]count[/b][/color] [color="#191970"][b]playableUnits[/b][/color] [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]10[/color][/color]

Made with KK's SQF to BBCode Converter

^^^ this put in condition of presence of each unit will stop spawning AI units after 10

Edited by Killzone_Kid

Share this post


Link to post
Share on other sites
Must have missed that. Well one other thing is that the probability of presence could be set to 0 on the units that are not supposed to become AI. AFAIK player can still join on those. Also putting some expression in condition of presence can make it dynamic as well.

[color="#FF8040"][color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]![/b][/color][color="#191970"][b]isPlayer[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]count[/b][/color] [color="#191970"][b]playableUnits[/b][/color] [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]10[/color][/color]

Made with KK's SQF to BBCode Converter

^^^ this put in condition of presence of each unit will stop spawning AI units after 10

This sounds like a neat Idea, I'm going to test that out! Thanks! ^^ I'll reply if it is working like I want it to!

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  

×