| 12-08-2003, 10:13 AM | #1 |
1) I have a arena with 5 teams of 2 players. I want it to be last man standing how can i make it last man standing WITH TEAMS? 2) If a player leaves AI will take control of the hero, but the AI dont uses the heroes abilities, and i have tried to run melee AI? 3) you better help me!! |
| 12-08-2003, 12:34 PM | #2 |
1. Use Player Groups for the teams, make a player group array Team()and a boolean array IsAlive() and have a trigger that goes like this: Code:
E - a unit dies
C -
A - For A = 1 to 5 do:
- Set IsAlive(Integer A) = False
- Pick all players in Team(Integer A) and do:
- If (all units of (units owned by picked player) are dead) is equal to FALSE do:
- set IsAlive(Integer A) = True
- Else do nothing2. I dunno. Periodic triggers that order AI heroes to use a random ability on the closest enemy unit? How are you giving the heroes to the AI? Doesn't Melee AI have to be set up at Map initialization? |
| 12-08-2003, 01:43 PM | #3 |
2) If a player leaves AI will take control of the hero, but the AI dont uses the heroes abilities, and i have tried to run melee AI? I dont know how to actually do it, but you have to create your own AI script. I suggest taking a look at the wardraft map (at http://www.wardraft.org/ ) Actually, considering the map is unprotected you could probably just rip the AI script wholesale and use it in your map. |
| 12-08-2003, 06:17 PM | #4 |
Thx guys, but i still cant figure it out! Ligature please descripe it closer. |
| 12-08-2003, 09:33 PM | #5 |
Sry for asking but are u souireaver@northrend? No u cant be, he is not a map maker... |
| 12-08-2003, 10:47 PM | #6 |
The trigger I'm talking about is a really crude way to solve your problem - basically you'd have to make a periodic that checked each hero owned by the AI player, and if there's an enemy unit nearby it orders the hero to use its ability - now, you'd have to make a separate set of orders for each hero unit-type, unless for some reason all the heros have the same abilities... It would be Ugly and Bloated. I'm sure there's a better way! Could you explain how you are giving the units to the AI player? Maybe if you changed that around a little it would come together? |
| 12-09-2003, 11:36 AM | #7 |
im not giving the AI Like this Player 1 egual to computer Set variable integer from 1-21 If then else((if integer egual to 1) then do unit create 1 paladin for player 1 If then else((if integer egual to 2) then do unit create 1 archmage for player 1 AI-run melee AI script for computer player and i have tryed to run campaing script too. and so on.... I was actually asking about the last man standing question. Please write it again and make it alittle easier to understand |
| 12-09-2003, 06:55 PM | #8 |
I'm just saying use Player Groups to keep track of your teams - so at map initialization set TeamGroup(1) to the two players on team 1, TeamGroup(2) to the two players on team 2, etc. Then another array, this one a boolean, "IsAlive()" to keep track of whether a team is still alive. So we need to set it up so that at any given moment IsAlive(x) tells whether or not any units belonging to players in TeamGroup(x) are still alive. That's what the trigger I wrote up above does. You'll actually need an extra part after the bit I wrote to check whether only one team is still alive, and if so do whatever you need to for a victory. It should work something like this: Code:
-Set NumberLiving = 0 -For A = 1 to 5 do: If IsAlive(Integer A) = True then set NumberLiving = NumberLiving + 1 - If NumberLiving = 1 then (run your victory trigger) else (do nothing) Oh and as for the AI thing - Try setting aside a particular player to be the "AI." At Map Initialization, run the Melee AI for that player. I think you have to run those actions at map initialization. |
