• 🏆 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!

How to save Orders in hashtable

Status
Not open for further replies.
Level 8
Joined
Oct 2, 2013
Messages
288
I can't seem to find a hashtable function that saves unit orders.

Basicly, what I need is a function that remembers an order so I can re-engage it on a unit.

I also tried saving "Current Order" with a variable, but I can't seem to activate any variables with the presented "Unit - Order" functinos ._.

Thanks in advance :)
 
Level 8
Joined
Oct 2, 2013
Messages
288
Thanks a lot IcemanBo. That link seems to be what I'm looking for. However I have encountered a bigger problem.

I'm working on a AOS type map with spawns and pathings (much alike any other AOS). Problem is, whenever a unit is stunned or triggered to cast a spell, they lose their way.

I guess this is a simple issue since most maps seem to have fixed that problem, yes?

Perhaps there's even a simpler way to do this that I'm not aware of?


PS: I am aware that auto-cast spells and period timers are alternative solutions, but they are not sufficient for this project I'm afraid
 
For the stun part, have an arrayed group. 1 index for each lane. Every ~5s, pick AI units with order 'stop'.

Check if they are in either group's array, then check the owner. Have some way to check if they have gone past a checkpoint(map corners for bot and top lanes, and middle of the map for mid lane). (preferably multiple regions)

If not, make them proceed there. If they have gone past it, order them to attack move to enemy base.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Ah, you only want this. You don't need such a system for it. Just order units periodicly to attack/move to their aim. (every few seconds)

that only works in certain situations though. It would technically work for creeps/minions. But not for player controlled heroes. Then it isn't that simple
 
Level 8
Joined
Oct 2, 2013
Messages
288
Beforehand I’d like to say, I’m sorry if I seem sophisticated and picky about the solutions. I really appreciate both of your help.

IcemanBo. The problem with periodic time events is that the attack-move command interrupts a potential attack animation. I know that doesn't seem like a big deal, but I would like to avoid that if possible.

CakeMaster. Potentially a player can lead a wave of AI units off from a lane to somewhere else because the "stop" order will not appear as long as they have someone to chase.
It is still a good solution though; I just need to add some additional triggers to avoid abuse.

Hmm, I had hoped this was simpler. :/ I thought maybe there was a solid system that every AOS/MOBA map was using, maybe even a custom AI. But I suppose I’m only making it complicated for myself with all my demands :)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You can check the unit's current order. If it's null/stop, it is idling around. Notice that automatically gaining targets to attack does not yield an order. But you can catch that via EVENT_UNIT_TARGET_IN_RANGE. When a unit gets stunned, it receives a special order. As for the casts, there are events that describe when the unit is finished.
 
Level 8
Joined
Oct 2, 2013
Messages
288
Uuuuh I didn't realize this.

I believe my problem is solved then. I'll repost if I need help.

Thanks again to everyone.
 
Status
Not open for further replies.
Top