| 06-02-2003, 11:58 PM | #1 |
I just had my first glance to the common.ai & co It is still jass BUT why the hell does it have natives like GetUnitGoldCost() That can't be called from a map script ??????? BTW can you define natives, constants and globals in a CT trigger? I have only managed to set up globals by editing my war3map.j Thats annoying. Then, is it possible to use the natives from common.ai in a map script ? Something like making a fake ai script or whatever... Any clever idea ? Many thanks in advance, Regards |
| 06-03-2003, 05:50 AM | #2 |
no maps can only use Blizzard.j and common.ai like AI scripts can only use common.ai and common.j but why fake a ai script ? just make one and add it to your map ? |
| 06-03-2003, 08:21 AM | #3 |
You can't access them directly and I doubt that declaring the native in common.j will work. And in an AI script triggers unfortunately don't work. Now if you need to access a common.ai native from a trigger event reaction what you can do is write a small AI script that consists of a loop that waits for a command given to the AI, calls the native with the arguments passed and sets the gold and/or wood value of that AI player to pass the result back to the trigger. Of course you get a delay doing that. You can put that delay at the beginning of the map by reading out all that information you need there and storing it in an array for later access. Globals can be put only at the beginning of each script. That means map script, Blizzard.j, common.j, common.ai and every AI script. Now the best place to put JASS triggers that need many globals that you do not want to declare via GUI is Blizzard.j . You can include it in any map and use all the trigger functionality. If you want to see how that is done, look in the Commander triggers in the Blizzard.j included with AMAI. |
| 06-03-2003, 04:54 PM | #4 |
It means the game has a different engine for the AI Your idea is a good one, i'll give it a try. Regards |
