HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Solution: How to access functions in common.ai from triggers

11-04-2003, 11:10 AM#1
Tommi
This may be common knowledge to most advanced people here, but I'll post it here, if it helps some beginners. Advanced posters are welcome to add constructive comments.

As you may know, it is quite hard to access functions in common.ai in triggers, for example, to get a unit's gold and lumber costs. There is, however, a way to do it, and after all, it is not that complex. An example solution is found here:

How to get a unit's gold and lumber costs
http://www.hut.fi/~tgustafs/wc3_unitcost.html

It is easy to expand the scripts to get any integer value from common.ai functions by using both AI command and AI command data values.

Enjoy,

Tommi
11-11-2003, 08:24 PM#2
Starcraftfreak
I like that thing, because it opens a variety of new possibilities (well, new...). But I don't like it that Blizzard made some things so difficult for us...
11-11-2003, 09:37 PM#3
PitzerMike
I knew that one. But nice you pointed us to a tutorial.
But maybe there are better ways of handing over information, although resources are quite clever.
11-12-2003, 04:39 AM#4
AIAndy
That reminds me that it would be a good idea to check if the handle array is actually the same or different in between triggers and AI. Would be useful to transfer all kind of information by using the integer/handle conversion.