• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[AI] How to send different commands (Also: Difference between GetLastCommand and GetLastData)

Status
Not open for further replies.
Level 6
Joined
Dec 11, 2014
Messages
93
Hey all, I wanted to know what the difference between the two natives in the title are, and how they can be used properly.

I know that GetLastCommand interacts with your AI script to basically change what's going on (whether you want to use it to start the AI or shift the AI to a new tier) but what about GetLastData? Is it the same as the prior one, just it takes the data integer you send in the command, instead of the actual command integer?
If so could you use GetLastCommand for one thread for when you need to change something, and GetLastData for a different thread? Or am I totally off base here?

Ultimately what I'm trying to do is have two separate conditions if you will in my AI script to base on what my AI does. I have it set that their tier is equal to the last command sent, but I also want their target to change up based on who is alive and who isn't. Can I set that up to work off GetLastData?
 
Level 18
Joined
Mar 16, 2008
Messages
721
i'm curious if anyone has any helpful input on this question.

I think the second number is the send AI command trigger can be used for more specific commands like this but I haven't figured that out exactly. If that is the case then you could check who is alive within the GUI trigger, then send command based on what the GUI trigger can tell is alive.

I'm also trying to do something similar but was going to try putting it in the script and having RNG pick a target. I think this approach might be better tho.
 
Level 6
Joined
Dec 11, 2014
Messages
93
i'm curious if anyone has any helpful input on this question.

I think the second number is the send AI command trigger can be used for more specific commands like this but I haven't figured that out exactly. If that is the case then you could check who is alive within the GUI trigger, then send command based on what the GUI trigger can tell is alive.

I'm also trying to do something similar but was going to try putting it in the script and having RNG pick a target. I think this approach might be better tho.
I'm a total novice at doing this, but if you have more expertise than me, check out the RoC orc 3 map, because Grom has a trigger and AI script that looks like it can do this. I tried figuring it out based on that, but because I don't fully understand AI scripting in relation to triggers yet I wasn't 100% sure what WAS necessary for it to work, and what wasn't (But yes, that's where I got this idea, because when one of the human AI that he attacks have 0 units there is a trigger that sends a command, and the command is the same for each, but the data section is different.)
 
Status
Not open for further replies.
Top