| 08-31-2002, 10:01 AM | #1 |
I'm still working on my custom soccer game. One problem is that the computer controlled hero can't learn or use skill if the player slot was "open" and no one join the slot, but no problem if it was "computer". So what did I miss? I'm think of an alternative solution: to change to controller of the player with "open" slot to "computer" using trigger. I think I read a map did this, but can't recall exactly the script. Can someone tell me how to do this? |
| 08-31-2002, 11:26 AM | #2 |
Guest | Not sure if this will work. Event: Map Initialization Conditions: None Actions: Player Group - Pick every player in (All players) and do (If (((Picked player) slot status) Equal to Is unused) then do (Player Group - Add (Picked player) to (All players controlled by a Computer player)) else do (Do nothing) I could not find any action events associated with player controller, nor any variables which could be converted to\from that to make a workaround method of actually changing the controller. You could probably make additional trigger plugins for that to make it work if that trigger alone does not, and nobody else posts a better (hopefully working) method. |
| 09-01-2002, 01:26 AM | #3 |
Thanks! Unfortunately, the computer AI doesn't know how to play soccer, so the overall performance remains similar.....:( |
| 09-01-2002, 01:30 AM | #4 |
Guest | damnit blizzard why cant you make a samrter ai... lol |
| 09-04-2002, 02:54 AM | #5 |
or make a way to program the ai to learn how =D |
| 09-04-2002, 03:14 AM | #6 |
Guest | You could actually design an AI that could 'pretend' to play soccer, using triggers and variables to tell the units where to move and when, and how the ball interacts with them when they do based on more variables.. I was designing a Dynamic AI for StarCraft a while back that would play according to your strengths and weaknesses, using triggers and switches. It would be much easier in WarCraft III. But I dont think he meant 'skill' in the sense of playing ability. The trigger I posted above might solve the problem, but it might not. The "Add player to player group" only changes the classification of the player, and not the definition or properties.. If the game links the "Computer Controlled Players" classification to a definition inside the executable, then that trigger might bypass the problem, and allow the unowned heroes to learn skills, or, it might merely give them a label and do nothing further.. Just be there. You are in-essence asking for a trigger that will bring a defeated player back to life, and Im not sure if that can be done. |
| 09-04-2002, 08:42 AM | #7 |
Hunter: I used a method similar to your suggestion to give control of unused player to computer. It turns out to be worse than before even though all the heroes can use their skills. Previously, the heroes would stay at their positions and attack the ball or opponent players whoever come into their sight first, though they won't use their skill. If the heroes control is given to computer, then they would always attack the opponent players but leave the ball alone. Therefore, I'm not using computer AI anymore, but try to use some triggers to make heroes use their skills, such as: Trigger A Event: every 45s Action: Turn on Trigger B Trigger B Event: paladin was attacked Condition: triggering unit is controlled by computer Action: activate divine shield turn off this trigger |
