Continuing the last order after a unit is ordered

luorax

Invasion in Duskwood
Reaction score
67
Hello everyone! So, I have a question: Is there any way to continue the unit's last order (what's going to be "attack" in my map all the time) after it's ordered to move to a unit (right-click). I tried a lot of things, but it still doesn't works. Any ideas?
 

DioD

New Member
Reaction score
57
every x seconds of game order every unit of type\in group\in rect\of player to attack point x.
 

luorax

Invasion in Duskwood
Reaction score
67
It doesn't work. It won't continue the order, it'll start the last order once again. If we click enough fast on the units then they won't attack. And we'll click enough fast to do so.

@hgkjfhfdsj
Reading... +Rep if it works.
 

luorax

Invasion in Duskwood
Reaction score
67
It doesn't work. It won't continue the order, it'll start the last order once again. If we click enough fast on the units then they won't attack. And we'll click enough fast to do so.

I'm not stupid, a single variable and a periodic trigger won't be a problem.. BUT! Imagine the situation:
A unit's attacking another. Its arm is in the air, and the player right-clicks on another unit (which is a button). The unit'll stop attacking, and if I reorder it to attack then it'll start attackin once again, but from the start! If I spamm the right-click button, then my unit won't do anything.. that's my problem.

Edit:
@hgkjfhfdsj
Well, maybe I'm a retard (no, we don't need that "maybe"), but I don't understand what does that system... The creator is talking about how to implement and configure, but he forget to write what does it....

Edit2: Well, I understand it now. That's not what I need, sorry.
 

TomTTT

New Member
Reaction score
44
I'm not stupid, a single variable and a periodic trigger won't be a problem.. BUT! Imagine the situation:
A unit's attacking another. Its arm is in the air, and the player right-clicks on another unit (which is a button). The unit'll stop attacking, and if I reorder it to attack then it'll start attackin once again, but from the start! If I spamm the right-click button, then my unit won't do anything.. that's my problem.

Edit:
@hgkjfhfdsj
Well, maybe I'm a retard (no, we don't need that "maybe"), but I don't understand what does that system... The creator is talking about how to implement and configure, but he forget to write what does it....

Lol, looked at the link. I find the guy made it just considering that OrderQueue is a name explaining it all... :p
Though, I haven't got it - What exactly are you trying to do? Your only order is attack? What purpose is this for? Might help.
 

luorax

Invasion in Duskwood
Reaction score
67
A moment, I'll create some screenshots. I hope they'll explain my problem.

View attachment 39691

EDIT: So, here's the screenshot.
Situation: the buttons're units. If you select them the left-click event fires (instead of the slow unit-select event we have a periodic trigger). If you right click on them then the right-click event fires. It's good, but if the hero's attacking someone and the player right clicks on a button, then the hero stops his current order and he'll try to go to the button (but he'll be stopped). That's the problem. I need a way to disable it. I'm using keyboard movement now, so if we won't be to order the units with mouse that's not problem.

Also, I'm using attack event only, cuz the spell's are triggered. The only spells I have are the status abilities and the buff-placer abilities. OOP for the win! :p

EDIT2: Everyone became offline...
 

TomTTT

New Member
Reaction score
44
I agree, (lol like 3rd time I'm saying it about something xPass said), VERY nice interface. May I ask how'd you do it? :p
About the problem... Seems pretty complicated... I'm not really sure what to tell you, I can't seem to figure it out :eek:
 

luorax

Invasion in Duskwood
Reaction score
67
Well, with the world editor :D They're units with custom models (I'm using the "Grab Tree" spell to change the textures) + tausend lines of vJASS script. (It's time to thank to Hatebreeder for helping me resizing them :D)

Also, I would like to post the project, but I need the basic spell ideas before. And terrain! I have the hero selection "background" terrains, and nothing more :D Me and my friend are working on the heroes (I'm the scripter while he's the idea giver and the "english-man" [I've already done the class and the talent names, and we have the main concept of the classes and roles]), so don't worry and be patient! (Well, If I won't be able to fix this bug then I think I'll have to drop the project)

EDIT: So, what I've already tried:
-Removing the attack ability - the unit isn't able to attack
-Modifying the players' alliance with himself - We can't attack with the button, it's true, but the trigger doesn't fire if the player right clicks
-The same method with a "Channel" ability and "smart" order ID - Looked it works, but no, it doesn't. The hero restarted the attack each time I right-clicked.

Anything else? Each idea is welcomed!
 

TomTTT

New Member
Reaction score
44
Is it really necessery to acctually continusely click the right-click? I mean you can handle just right clicking once... Unless it's a lot more than that? (By the way, sorry if it's too much asking about the interface, but just so I'd be clear: Those bars with the skills, hotkey and explanation are UNITS? I mean... How the hell did you manage to do that? And the borders?)
Maybe disable the "smart" orders? Let's say a unit is ordered something, and the order is equal to "smart", then order the unit to stop?
(So many question marks! :D)
 

luorax

Invasion in Duskwood
Reaction score
67
They're units, yes. The borders too, but they have locust, so the player can't select (click) them.

JASS:
if s__BUTTON_Click(GetOrderTargetUnit(),GetOwningPlayer(GetTriggerUnit()),false)then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrder(GetTriggerUnit(),"stop")
call PauseUnit(GetTriggerUnit(),false)
endif


(This's from the compiled script. "BUTTON" is a struct and "Click" is a method of it)

I'm using the single click thing currently :D But if you single click on something, it'll restart the attack, so that's -DPS... Nvm, I'll send a message to the players at the start about that "bug".
 

TomTTT

New Member
Reaction score
44
They're units, yes. The borders too, but they have locust, so the player can't select (click) them.

JASS:
if s__BUTTON_Click(GetOrderTargetUnit(),GetOwningPlayer(GetTriggerUnit()),false)then
call PauseUnit(GetTriggerUnit(),true)
call IssueImmediateOrder(GetTriggerUnit(),"stop")
call PauseUnit(GetTriggerUnit(),false)
endif


(This's from the compiled script. "BUTTON" is a struct and "Click" is a method of it)

I'm using the single click thing currently :D But if you single click on something, it'll restart the attack, so that's -DPS... Nvm, I'll send a message to the players at the start about that "bug".

darn kinda sucks it has to be like it. :p... It only shows that the World Editor isn't completely dynamic.
Although I have NO idea what a struct is, or if it has any meaning not in JASS, and I don't know what method is used with the "Click", so I generally didn't get anything :D. I really wanna learn JASS but I just cant seem to figure it out. Since when do you use JASS? Did you start your coding with it? (you can PM me if you want so we won't keep reviving this post :p)
 

luorax

Invasion in Duskwood
Reaction score
67
Well, I've sent you a mail (I wanted to write "meal" :D)

Well, I'm still waiting for ideas.
 

Happy

Well-Known Member
Reaction score
71
i dont know whether it interrupts the current attack but the spell silence has a second function disabling attack if you want it. maybe that would work somehow.

and by the way...1. your interface is really really good :D and 2. another way i could imagine. disable the direct attack order and make a spell and trigger the attack over this way. with a really low CD it would sail around your problem.
 

tommerbob

Minecraft. :D
Reaction score
110
I could be totally off here, but it sounds like you're using a custom system for attacking/movement? If so, that's probably your problem. Right-clicking should not interrupt the order if it is already attacking. That sounds like a bug in your script, not the game.
 

luorax

Invasion in Duskwood
Reaction score
67
I'm using a lot of systems, yes, but I don't have a custom attack system. Why should I create one? Then that wouldn't be a WC3 map, that would be a custom game. When the player clicks on the attack spell, it orders the hero to attack the current target of the player (call IssueTargetOrder(GetPlayerHero(p), "attack", GetPlayerTarget(p)).

And yes, it interrupts the current attack.
 

tommerbob

Minecraft. :D
Reaction score
110
I'm using a lot of systems, yes, but I don't have a custom attack system. Why should I create one? Then that wouldn't be a WC3 map, that would be a custom game. When the player clicks on the attack spell, it orders the hero to attack the current target of the player (call IssueTargetOrder(GetPlayerHero(p), "attack", GetPlayerTarget(p)).

And yes, it interrupts the current attack.

Why do you have an attack spell?

EDIT: I guess that doesn't matter. It just seems strange that you need an "attack" spell to replace a default game command that does the exact same thing--without bugging.

EDIT 2: For your movement commands, do you use "move to" or "Attack-move"?
 

RangerX

I am justice!
Reaction score
69
ok some time ago i needed some kind off attack but i wanted that the attack to cost mana so basically [if i understand this thread well] you click on unit he get attacked but if you rightclick again the process starts so you you don't give dmg ~ let me 5 minutes to make you an demo map of something

EDIT: tryed but can't reproduce what you need ...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top