| 08-25-2004, 02:01 AM | #1 |
In my map, I want the computers to learn one of the 5 skills in the hero abilities tab, how do I go about this, I have random heros the Computer can choose from. 12 Heros to choose from to be exact. |
| 08-26-2004, 03:16 AM | #2 |
This is pretty easy to solve: Ok, create a trigger with an event that waits for a hero to level up, or be created (whatever situation you want the computer to choose an ability in). Your first action should be to randomly generate a number 1-5 (for your 5 abilities), and have a boolean variable then set to FALSE to keep track if the hero can't learn the ability selected by the random number and the trigger needs to be ran again. Then run if-else multiple action events that check if the triggering hero is equal to any of the heroes in your map. Under each statement for each different hero, run another set of if-else events that check if the random number is equal to 1,2,3,4 or 5. Then all you have to do is set it up so that say if a Paladin is the hero and the number is one (corrisponding to holy light), his holy light ability is leveled up. NOTE: you have to run if-else statements to check for each hero because their abilities are different, and the hero learn skill event only works if the hero can learn such-and-such ability. |
| 08-26-2004, 03:19 AM | #3 |
oh yeah almost forgot - you need to make sure that the hero can learn ability with another if-else for each abilty. For example, if a Paladin is going to attempt to level up holy light and its already maxxed out, set your boolean to run the trigger again to TRUE. You will need to check at the end of the trigger if it needs to be run again. EX: if runTriggerAgain = true : run this trigger again. please respond if you don't understand what I have said ^_^ ^_^ |
| 08-26-2004, 03:30 AM | #4 |
There has to be an easier way, that way I would need to make about 70 if then else statements, what an ineffecient trigger. |
| 08-26-2004, 03:53 AM | #5 |
Its an ineffecient editor, I don't know anything about AI, so maybe there is something I don't know. Trigger-wise, this is the only way of getting it to work. I know, I've had to do it before. ![]() |
