• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

common.j AI functions...

Status
Not open for further replies.
Level 17
Joined
Jul 1, 2010
Messages
721
Those natives and/or functions that work in both types of scripts...*.j and *.ai. There's got to be a list somewhere. Example:
JASS:
local group g = CreateGroup()
- Works in both type of scripts...
JASS:
GetAiPlayer()
- Works only in AI scripts...
JASS:
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
- Works only in *.j scripts...What's not to understand ? Doesn't anybody know ? I really need this...
 
There is no list of what you can use in AI scripts. I think it is fine to use both common.j and common.ai since I've seen them used before.

However, the only person I saw use AI scripts before was AIAndy. It really depends on when it is being executed. If you need to, you can always store data in a gamecache to communicate with your map's script. (for whatever reason)

More importantly, what exactly are you trying to do with .ai scripts?

... Unless you are just trying to use AI functions in normal scripts. Then you can use native declarations (link) to use whichever ones you want. However, it is not guaranteed to work ingame. There is only a small handful of useful ai functions anyway.
 
Status
Not open for further replies.
Top