| 04-23-2004, 08:22 AM | #1 |
I want to implement an ai in one of my maps, but i don't know where to start. If i wanted to make an *.ai file that orders a hero to learn an ability after leveling up, where would i have to start ? Right now i have i have a working main function with a 2 second loop. My attempts to pick all units by player with 1 or more unspent skill points have failed. How do i refer to the player for which the ai script was started for ? Thanks in advance |
| 04-23-2004, 01:51 PM | #2 |
GetAiPlayer() returns the number of the player for whom the AI script was started. |
| 04-23-2004, 03:10 PM | #3 |
How can i get heroes to learn skills ? Even something simple as this causes the script not to get run. call SelectHeroSkill( gg_unit_Hmkg_0006, 'AHtb' ) Is it possible to create an ai script that orders units to patrol from one location to the next ? |
| 04-23-2004, 03:38 PM | #4 |
AI does not share global variables with trigger space so gg_unit_... is not available in AI. Why do you want to do that in AI in the first place ? |
| 04-25-2004, 02:40 PM | #5 | |
Quote:
I want to make an ai for a capture the flag map and i have no idea what approach is best. Any help is appreciated. |
| 04-26-2004, 09:39 AM | #6 |
Most AI things can be done either in AI scripts or in triggers. It is generally easier to get things to work by using triggers, because there are quite a few things that can go wrong in AI scripts. A normally good approach on any programming task is to write down what is supposed to be done, break this down in sub-problems, and then try to implement the sub-problems one by one. |
| 04-26-2004, 02:46 PM | #7 | |
Quote:
Then i'll try it with triggers. Per chance, do you know of a tutorial on this, a map i could use as reference or something that would help me with this task ? |
| 04-26-2004, 02:55 PM | #8 |
If you ask the people at the Trigger Haven, they will probably know. |
