Jump to content
Sign in to follow this  
awotter

Adding player spots without increasing AI teams

Recommended Posts

I'm trying to add player slots to a side without increasing the number of AI units available to a commander and I'm not sure how to go about it in Warfare (WACO).

I understand how to add the slots to the mission but I'm not sure where or how to exclude them when the mission checks if the slot is available as an AI team.

I think the place to change it is Server/AI/Advanced/Advanced_UpdateSquad.sqs, but I'm not sure:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;Last modified 4/6/8

;Use on a group to give it AI control.

;Script usage: [GroupName,GroupSlot] Exec "UpdateIndependentAI.sqs"

_team = _this Select 0

_respawnable = true

_role = true

_mission = -1

if (Count _this > 1) then {_respawnable = _this Select 1};

if (Count _this > 2) then {_mission = _this Select 2};

Goto "Init"

#Update

~5

;Do not proceed unless team is AI controlled.

; if (!(_team In eastAITeams) && !(_team In westAITeams)) then {Exit};

if (Call Compile Format["!(_team In %1AITeams) && !(_team In %1DefenseTeams)",_sideText]) then {Exit};

If this is correct how would I go about it?

Share this post


Link to post
Share on other sites

What you need to do is:

- add playable slots (soldiers) to the map using the editor.

- In InitMission.sqf (from line 173) extend the arrays eastTeams, westTeams, eastSlots and westSlots with the number of playable slots that you added for each side.

- In Server\Init_Server.sqs at lines 120 and 121 there is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">eastAITeams = eastTeams

westAITeams = westTeams

which makes the number of AI teams equal to the max. number of player teams. This is not what you want, since you want to have fewer AI teams. You could change it into something like the following to get only 8 AI teams:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

for [{_i=0},{_i<8},{_i=_i+1}] do {eastAITeams = eastAITeams + [eastTeams Select _i]}

for [{_i=0},{_i<8},{_i=_i+1}] do {westAITeams = westAITeams + [westTeams Select _i]}

Let me know if it works out!

Doomguy

Share this post


Link to post
Share on other sites
What you need to do is:

- add playable slots (soldiers) to the map using the editor.

- In InitMission.sqf (from line 173) extend the arrays eastTeams, westTeams, eastSlots and westSlots with the number of playable slots that you added for each side.

- In Server\Init_Server.sqs at lines 120 and 121 there is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">eastAITeams = eastTeams

westAITeams = westTeams

which makes the number of AI teams equal to the max. number of player teams. This is not what you want, since you want to have fewer AI teams. You could change it into something like the following to get only 8 AI teams:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

for [{_i=0},{_i<8},{_i=_i+1}] do {eastAITeams = eastAITeams + [eastTeams Select _i]}

for [{_i=0},{_i<8},{_i=_i+1}] do {westAITeams = westAITeams + [westTeams Select _i]}

Let me know if it works out!

Doomguy

Thanks Doomguy,

I updated the Teams and Slots arrays after adding 2 playable slots for each side to generic Warfare and tested it with your code, unfortunately the AI leaders aren't generating squads and responding to the AI commander.

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  

×