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

Auto-casting AoE on Ground?

Status
Not open for further replies.
Level 6
Joined
Aug 12, 2007
Messages
201
Are there any spells that have an auto-cast option but also target ground in an AoE? Can Channel do this? Something like Cripple or Fairy Fire, only AoE.

If not, will setting one of the aforementioned skills to be able to target ground work for the trigger Begins casting an ability, even if there is no real target?
 
Level 6
Joined
Aug 12, 2007
Messages
201
I was trying to use it to fake another effect, I don't want anything to do with AoE or autocasting.

I'm trying to make an inaccurate siege engine. This is what I have so far:

  • Catapult Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Target Catapult
    • Actions
      • Set RandomAttackX = (Random integer number between -256 and 256)
      • Set RandomAttackY = (Random integer number between -256 and 256)
      • Set Attack_loc = (Target point of ability being cast)
      • Unit - Order (Triggering unit) to Attack Ground (Attack_loc offset by ((Real(RandomAttackX)), (Real(RandomAttackY))))
Target Catapult being based off of Cripple. This doesn't work at all though because it only calculates the random position in the very first shot, and then it just shoots that exact spot over and over, not to mention it doesn't work if the player tell the catapult to attack or attack ground himself.

Tons of holes, and I can't figure out how to plug any of them. Any help is appreciated, and yes I know I'm not deleting any variables yet, I just want to make it work before I clean it up.
 
  • Catapult Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Target Catapult
    • Actions
      • Custom script: call IssuePointOrder(GetTriggerUnit(), "attackground", GetSpellTargetX()+GetRandomReal(-256,256),GetSpellTargetY()+GetRandomReal(-256,256))
      • Wait 1.00 seconds
      • Unit - Order (Triggering Unit) to Stop
 
Last edited:
Level 6
Joined
Aug 12, 2007
Messages
201
I don't know a whole lot about custom scripts but that just looks exactly the same as what I already have, but shorter. And since mine doesn't work whenever you order them to attack or attack ground or anything else, I don't see how this helps fix that at all. :confused:

EDIT: Oh that was about fixing up leaks, which is nice even though I said I wasn't trying to fix leaks yet because/and this trigger doesn't work so it's kinda pointless. :confused:
 
Level 6
Joined
Aug 12, 2007
Messages
201
You aren't understanding, this trigger doesn't function the way I want it to at all. I just want to make it so that no matter what whatever type of attack this tower does, it gives it a new random location around where it is targeting. Right now this doesn't work since it only does it whenever the autocast happens, and even then it only does it once and then continues to shoot the exact same spot over and over.

It doesn't work for attack, for attack ground, or on more then one attack after the initial attack. :confused:
 
I updated my post. Just make sure that the cooldown of the curse-based spell is equal to or greater than the cooldown of his attack.
You aren't understanding, this trigger doesn't function the way I want it to at all. I just want to make it so that no matter what whatever type of attack this tower does, it gives it a new random location around where it is targeting. Right now this doesn't work since it only does it whenever the autocast happens, and even then it only does it once and then continues to shoot the exact same spot over and over.

It doesn't work for attack, for attack ground, or on more then one attack after the initial attack. :confused:
 
Level 6
Joined
Aug 12, 2007
Messages
201
Using a Wait = Non Multi Instanceable, and since I have catapults everywhere this won't work. Not to mention now it will only fire once and you have to sit there and manually tell it to attack over and over again every time you want it to fire, which is no good, because of the stop.

And maybe I don't understand what 'call IssuePointOrder' means but if I manually order the catapult to attack someone or attack ground, I don't think this trigger will fire. Nor if it auto acquires an enemy.
 
Level 6
Joined
Aug 12, 2007
Messages
201
  • Catapult Copy
  • Events
  • Unit - A unit Begins casting an ability
  • Conditions
  • (Ability being cast) Equal to Target Catapult
  • Actions
  • Custom script: call IssuePointOrder(GetTriggerUnit(), "attackground", GetSpellTargetX()+GetRandomReal(-256,256),GetSpellTargetY()+GetRandomReal(-256,256))
  • Wait 1.00 seconds
  • Unit - Order (Triggering Unit) to Stop
This wait is not MUI because if another catapult begins casting during that 1 second wait, the first one won't receive its stop command, or rather it orders them all stop commands, I forget in what way that it breaks, just that it does break.
 
No. The wait IS MUI because the "Triggering Unit" you're referencing is a local to the exact firing of the trigger. You can have 100 of these things doing this and it will not fault.

Also, to respond to your other things, it will not "Stop forever" because the autocast is still turned on, so it will actually continue indefinitely.
if I manually order the catapult to attack someone or attack ground, I don't think this trigger will fire. Nor if it auto acquires an enemy.
True. Depending on the conditions, it will auto-acquire or cast the ability. Since the triggering event is "unit casts ability" and not "unit issued attack order" then yeah, of course this won't apply to a direct attack order.
 
Level 6
Joined
Aug 12, 2007
Messages
201
That goes against everything I know about making triggers, in that wait immediately means non-MUI. I don't know what you mean "referencing is a local to the exact firing of the trigger", all I know is that only one trigger exists and it will fire the same path for every guy.

And all this doesn't change that the trigger itself does not work for what I want at all. I'm trying to come up with a better system now anyways where the catapult is targetting an invisible dummy so that I can have the event 'Unit is attacked' because there is no event of 'Unit is attacking'
 
Thall I know is that only one trigger exists and it will fire the same path for every guy.
ok, i will try to explain.

Thing of a trigger like the one on a gun. You pull it once, it fires. You tell it to do actions, so when the trigger fires, it calls the actions. Actions are seperate from the trigger. If you tell the action to wait, that does not mean that the trigger waits. So you can have a trigger fire a thousand times per second with a wait inside of the actions, and the triggers will not wait for the other actions to finish before firing again.
 
Level 9
Joined
Sep 28, 2004
Messages
365
Try this demo map so that you can understand how triggering unit and wait works.

Order the 3 catapults to attack ground 1 after another. They will be ordered to move into a random direction. And they will stop after 2 seconds.
 

Attachments

  • Order Test.w3x
    17.5 KB · Views: 64
Level 6
Joined
Aug 12, 2007
Messages
201
My god, I am not a two year old, I've been working in Warcraft 3 for years and I completely understand what a trigger is. What you two aren't understanding is that Wait is not MUI, ever, at least not in spells and definitely not in this case. I don't understand why this is so hard to understand. Derp. :confused:

If I have 'Do action, wait 7.00 seconds, and then Do another action', and trigger this twice before those 7 seconds are up, it breaks it for the first time it was triggered. This is not that hard to comprehend.

EDIT: and at JefferyQ, I ran your map and very easily immediately broke it just by ordering one catapult to attack ground and then another one to do the same just a before the wait ended, and lo and behold, the wait causes it to forget the original catapult and he never receives the stop order while the second one gets it. NOT MUI
 
Level 9
Joined
Sep 28, 2004
Messages
365
it doesn't break. go to the trigger, and enable "Order Fake Attack" (don't bother about the name) trigger. And you will see it works perfectly since it will show if the unit stopped or not. If you are still not convince, i can record a video to show you. You will also need to know what is "local" stuff.

**You must understand how trigger works. Everytime a trigger is run. It creates a copy of itself. What screws up MUI is not the wait but global stuff. No matter how many copies of trigger the computer has made. If a global is change, it is changed. Local stuff like triggering unit won't be affected since they are locally created like triggers.

Here is my delay blast ability i did long ago. Feel free to check it if you are still not convince. (it uses wait too)
 

Attachments

  • Delay Blast.w3x
    18.9 KB · Views: 66
Level 6
Joined
Aug 12, 2007
Messages
201
It broke completely and I can show you it break in my own map. Wait breaks MUI triggers, it is as simple as that.

  • Catapult Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Target Catapult
    • Actions
      • Set RandomAttackX = (Random integer number between -256 and 256)
      • Set RandomAttackY = (Random integer number between -256 and 256)
      • Set Attack_loc = (Target point of ability being cast)
      • Set CatapultLoc = (Position of (Triggering unit))
      • Unit - Create 1 CatapultTarget for (Owner of (Triggering unit)) at CatapultLoc facing Default building facing degrees
      • Set CatapultTarget = (Last created unit)
      • Unit - Order CatapultTarget to Attack Ground (Attack_loc offset by ((Real(RandomAttackX)), (Real(RandomAttackY))))
      • Wait 2.00 seconds
      • Unit - Remove CatapultTarget from the game
Try it yourself, that wait will cause you have to hundreds of undeleted target dummies everywhere because every time it spawns a new one, it forgets about the one before it and doesn't remove it.

EDIT: How can even being to you call yours MUI if there is only a single caster in the map, there is no way to test it at all.
 
Level 9
Joined
Sep 28, 2004
Messages
365
It broke, because CatapultTarget is a global variable... If there is another unit casting the ability, CatapultTarget will be replaced. And the previous unit is not referenced.

EDIT: Feel free to add more of that hero then. The cooldown is 0. Just spam the ability and you know what i mean.
 
Level 6
Joined
Aug 12, 2007
Messages
201
It broke because there is a Wait, it works just fine if there is no wait, besides the fact that it instantly removes him on me.
I'll admit your delayed blast works somehow after I added a bunch of Kael'thases, but it uses a ton of called custom scripts that aren't GUI and I have no idea how they work/use/function. This might as well be moonrunes to me since I zero background in JASS or C++ or any real coding language. These scripts were not in the catapult one which did definitely break.
 
Level 9
Joined
Sep 28, 2004
Messages
365
Change it to this:

  • Catapult Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Target Catapult
    • Actions
      • local unit u
      • Set RandomAttackX = (Random integer number between -256 and 256)
      • Set RandomAttackY = (Random integer number between -256 and 256)
      • Set Attack_loc = (Target point of ability being cast)
      • Set CatapultLoc = (Position of (Triggering unit))
      • Unit - Create 1 CatapultTarget for (Owner of (Triggering unit)) at CatapultLoc facing Default building facing degrees
      • set u = GetLastCreatedUnit()
      • Unit - Order CatapultTarget to Attack Ground (Attack_loc offset by ((Real(RandomAttackX)), (Real(RandomAttackY))))
      • Wait 2.00 seconds
      • call RemoveUnit( u )
I just use convert to custom script as GUI can't accept local variables. Try it and tell me what happens.

What i changed:
i added this on the top. "u" is the name of the variable of type "unit". The local just means it is a local variable and not global. If you have no idea what a local variable do or how is it different from global, you can look at the tutorial.
  • local unit u
I replaced
  • Set CatapultTarget = (Last created unit)
with
  • set u = GetLastCreatedUnit()
i replaced
  • Unit - Remove CatapultTarget from the game
with
  • call RemoveUnit( u )
By replacing, what i did was i convert it to custom text using the editor and changing the variable to the local variable name.

**Also there is an easier way to fix this. Instead of using wait, add expiration timer to the last created unit.
 
Level 6
Joined
Aug 12, 2007
Messages
201
Okay, I think I am starting to understand a little. I appreciate it when people explain the reason behind things but the trigger I showed you was mostly jury rigged together and doesn't work the way I wanted at all.

This is the ideal trigger:

  • CatapultMisses
    • Events
      • Unit - A unit attacks
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Catapult
    • Actions
      • Set RandomAttackX = (Random integer number between -256 and 256)
      • Set RandomAttackY = (Random integer number between -256 and 256)
      • Set Attack_loc = (Target point of ability being cast)
      • Unit - Order (Triggering unit) to Attack Ground (Attack_loc offset by ((Real(RandomAttackX)), (Real(RandomAttackY))))
The problem is that there is no such event as 'A unit attacks' only 'A unit IS attacked', and you can't get anything to return an event from attack ground save for 'A unit is ordered with a target point', which only fires on the first time, not each time it attacks ground after this.

How would you get this to work MUI that any and all attacks catapults do instead of hitting where you target, they hit within -256 to 256 of the targeted location?

I tried using dummies, that didn't work for a bunch of reasons I forget, I tried basing it off of an autocasting ability, didn't work either because you can just turn off the ability and fire it manually until it gives you a random location you like and then it will just keep hitting that one spot, and with using an autocast doesn't work with Attack or Attack Ground.

EDIT: I forgot Expiration timer existed and ended up making a physical one in the form of negative health regeneration and a trigger that removes the dummy on death, but this made me remember what was wrong with using dummies was that they all shoot at the same global variable of Target_Loc or whatever I called it, not their own personal random target. If I could get that part working I could just use it on the towers themselves instead of dummies.
 
Level 9
Joined
Sep 28, 2004
Messages
365
If i understand correctly. You will have to split to 3 triggers.
1 and 2 to check attacking or attack ground and then force it to cast a fake ability which runs the 3rd trigger.

For this i use a channel as base, and set its id to carrion swarm. I name the channel as "Fake Attack"
  • Sample 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Catapult
    • Actions
      • Set Pos = (Position of (Attacked unit))
      • Unit - Order (Attacking unit) to Undead Dreadlord - Carrion Swarm Pos
      • Custom script: call RemoveLocation(udg_Pos)
  • Sample 2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(attackground))
      • (Unit-type of (Attacking unit)) Equal to Catapult
    • Actions
      • Set Pos = (Target point of issued order)
      • Unit - Order (Triggering unit) to Undead Dreadlord - Carrion Swarm Pos
      • Custom script: call RemoveLocation(udg_Pos)
  • Sample 3
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to "Fake Attack"
    • Actions
      • -------- Your stuff here --------
      • Set RandomAttackX = (Random integer number between -256 and 256)
      • Set RandomAttackY = (Random integer number between -256 and 256)
      • Set Attack_loc = (Target point of ability being cast)
      • Unit - Order (Triggering unit) to Attack Ground (Attack_loc offset by ((Real(RandomAttackX)), (Real(RandomAttackY))))
 
Level 6
Joined
Aug 12, 2007
Messages
201
I think this sorta might work, its pretty close to a few setups I tried already so it should only take a second to recreate it. I'll get back to you in a moment with the results.

EDIT: Okay I'm getting one of the many problems I had before, the issue is that it continues to fire on the same spot every time. It only sets the random X and Y when you start to attack, and continues to fire on that exact spot attack after attack. I need to be able to make it recalculate the Attack position after each attack rather then at the start of the first attack only. If only there were an event unit attacks I could use. The second problem is when told to attack ground is attacks the ground directly, for some reason it won't do the random XY even though my attack ground trigger is the same as yours.

Ill attach my map.
 

Attachments

  • CatapultTest3.w3x
    19.6 KB · Views: 40
  • Sample 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Catapult
    • Actions
      • Custom script: local unit u = GetAttacker()
      • Set Pos = (Position of (Attacked unit))
      • Unit - Order (Attacking unit) to Undead Dreadlord - Carrion Swarm Pos
      • Custom script: call RemoveLocation(udg_Pos)
      • Wait 1.00 seconds
      • Custom script: call IssueImmediateOrder(u,"stop")
  • Sample 2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(attackground))
      • (Unit-type of Triggering unit)) Equal to Catapult
    • Actions
      • Set Pos = (Target point of issued order)
      • Unit - Order (Triggering unit) to Undead Dreadlord - Carrion Swarm Pos
      • Custom script: call RemoveLocation(udg_Pos)
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Stop
  • Sample 3
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to "Fake Attack"
    • Actions
      • Custom script: call IssuePointOrder(GetTriggerUnit(), "attackground", GetSpellTargetX()+GetRandomReal(-256,256),GetSpellTargetY()+GetRandomReal(-256,256))
      • Wait - 1.00 seconds
      • Unit - Order (Triggering unit) to Stop
 
Level 6
Joined
Aug 12, 2007
Messages
201
I'm pretty sure we went over waits but within the benefit of the doubt on that subject, the changes you've made only serve to stop it from attacking more then once with all those stop commands. I don't know about you but I don't particularly enjoy the thought of ordering many catapults to fire single individual attacks, like trying to tell every single footman to attack once, ordering him over and over. Since like this it would attack ground for one shot, and then stop and do nothing until you ordered it to attack ground again for one more shot, and so on and so fourth.

This isn't the solution I had in mind of manually ordering it to attack over and over, I want it to continue attacking like a regular unit, only each time checking for a new XY.
 
How exactly does it acquire a target in the first place? It acquires it when it attacks, great, and this trigger will tell it to do that - every time.

1. Event happens (attack/attack-ground/spell)
2. Condition happens (check if catapult)
3. Order catapult to attack-ground a random point around that spot
4. Wait 1 second
5. Order catapult to stop
6. Event happens, go back to step 1.

Flawless. As Jeffrey told you, if you set a variable, that's what mucks up the waits. There's a difference between:

setting a variable, doing a wait, then doing something with a variable

and:

not setting a variable, doing a wait, then doing something not related to a variable.

The first one is MUI. The second one, which is the code Jeffrey and I have been telling you to use, is MUI.
 
Level 6
Joined
Aug 12, 2007
Messages
201
  • Sample 2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(attackground))
      • (Unit-type of Triggering unit)) Equal to Catapult
    • Actions
      • Set Pos = (Target point of issued order)
      • Unit - Order (Triggering unit) to Undead Dreadlord - Carrion Swarm Pos
      • Custom script: call RemoveLocation(udg_Pos)
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Stop
As per this trigger:
1. I order it to attack ground.
2. It gets the position, it fires the carrion swam, or Flare as I was using, waits a second, and then is ordered to stop.
3. I don't see where it is ordered to start attacking ground again anywhere? All the triggers end in stop, and every time it attacks ground it doesn't fire 'A unit Is issued an order targeting a point', it only does that on the first attack.

Edit: And I don't see how you are not setting any variables at all, if you are talking about the local VARIABLE, I feel like I should point out this is a variable. Do you mean not to use the Set Pos = XY or maybe the 'Set Pos = (Target point of issued order)'?
 
I don't see where it is ordered to start attacking ground again anywhere?
What caused the event to happen in the first place? The same thing that caused it the first time will cause it the second time, and the third, fourth, etc.

Unless you're turning off your trigger or destroying it, it will do this forever. Just because the trigger ends in telling the unit to stop doesn't mean that the unit will stay stopped forever. It means it will do this, stop, do this, stop, etc. indefinitely.

local VARIABLE
You've been working with global variables, which are not MUI. local variables ARE MUI.

So let me rephrase my point.

There's a difference between setting a global variable, waiting 1 second, doing something with the variable

and

Setting a local variable, waiting 1 second, doing something with the local variable

The first is NOT MUI. The second IS MUI.

That custom script I gave you is just a more efficent way of doing it (tells the game to do less)
 
Level 6
Joined
Aug 12, 2007
Messages
201
But I'M the one causing the event in the first time, as in clicking attack ground and then clicking the ground. I'm pretty sure the trigger will still fire I click it and then the ground the second and third time and all that, but I don't want to manually micromanage the firing of single shots from a cannon. :confused:

I don't see where it is looping do this and then stop. I see at the end of the trigger it is ordered to stop, and that there is nothing else is any of the triggers that make that event occur again save for me manually clicking to fire again.

I think I am starting to understand a little bit what you mean by local variables, but I still have no idea why it works, just that you say that it does, and it probably does. I know that local is not global in that global is effected by everything and local is unique to that unit somehow, not sure where or how it is storing this data but okay. I'll make the changes you've highlighted but I still don't see where in the trigger it is making it fire repeatedly. If you could highlight the specific line that makes it shoot more then once it would be very illuminating.

EDIT: Saving bombs on this line: "
Custom script: call IssuePointOrder(GetTriggerUnit(), "attackground", GetSpellTargetX()+GetRandomReal(-256,256),GetSpellTargetY()+GetRandomReal(-256,256))" I think its because the Pos isn't mentioned in it anywhere or something? Attack ground but where is it attacking ground?

Also why is it only the first trigger that has "Custom script: call IssueImmediateOrder(u,"stop")" while the other two use just "Unit - Order (Triggering unit) to Stop" ?
 
Use the triggers I edited from Jeffrey's post, test them in the map. They will work.

This trigger is the one that happens automatically:

  • Sample 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Catapult
    • Actions
      • Custom script: local unit u = GetAttacker()
      • Set Pos = (Position of (Attacked unit))
      • Unit - Order (Attacking unit) to Undead Dreadlord - Carrion Swarm Pos
      • Custom script: call RemoveLocation(udg_Pos)
      • Wait 1.00 seconds
      • Custom script: call IssueImmediateOrder(u,"stop")
This happens automatically because as soon as the catapult is order to "Stop" it will resume its default orders (acquiring targets automatically). This trigger will launch again and again because the catapult will trigger this again and again each time it acquires a new unit after it is told to stop.
 
Level 6
Joined
Aug 12, 2007
Messages
201
Ahh, we'll that's where you aren't getting me, I'm saying there is no unit target, ordering it to attack ground on dirt with no one around. It will only fire once because there is no unit to re-aquire. Maybe if its spawns a dummy on Attack Ground commands and then re-aquires that dummy to shoot at, thus triggering the 'Unit is attacked' ? That would only work if it were an enemy dummy though, because ordering it to attack an ally one would again only fire once.

And I used your code exactly, it won't save the map because of the line:

  • Custom script: call IssuePointOrder(GetTriggerUnit(), "attackground", GetSpellTargetX()+GetRandomReal(-256,256),GetSpellTargetY()+GetRandomReal(-256,256))
EDIT: The error is "Expected a name" Is it because my variable is 'Attack_loc' and not 'POS' like yours?

I don't understand how Sample 2 and 3 are MUI though because you didn't declare any local variables in them at all, only a global one, and yet it uses a wait, meaning wont the 'Triggering Unit' after the wait timer break if any other catapults fire in that period? You told me global is not MUI, local is MUI after all.
 
Level 6
Joined
Aug 12, 2007
Messages
201
That could be it, I think I am still on something like 1.22 because I copied the install from my old PC instead of reinstalling it, meaning no system paths to update with.
 
This will work with 1.22:

  • Catapult Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Target Catapult
    • Actions
      • Custom script: call IssuePointOrder(GetTriggerUnit(), "attackground", GetUnitX(GetSpellTargetUnit())+GetRandomReal(-256,256),GetUnitY(GetSpellTargetUnit())+GetRandomReal(-256,256))
      • Wait 1.00 seconds
      • Unit - Order (Triggering Unit) to Stop
wont the 'Triggering Unit' after the wait timer break if any other catapults fire in that period? You told me global is not MUI, local is MUI after all.
No. GetTriggerUnit() is a local function call, not a global. For unexplained reasons, "Attacking Unit" is not local, so I had to set him to local unit u before the wait so that it will still be MUI when i call him again.
 
Level 6
Joined
Aug 12, 2007
Messages
201
I think I get what you mean. Maybe I am just used to an older version or crazy or something, but this is the way I understood it worked:

Unit - A unit Is issued an order targeting a point
So my unit starts to do the action
Wait of 1.00 second happens, but during this time if another unit triggers the event of 'A unit Is issued an order targeting a point' in this trigger then that unit becomes the Triggering Unit, and once the 1 second wait is done the Order - Stop is applied to the last unit that triggered this event because it is the triggering unit now, not the one who triggered it before, who does not receive a stop and goes on without receiving the rest of the trigger commands.

I am 100% positive it worked this way at some point at least.

EDIT: Running in 1.24 now, saved properly and going to test it.

Back from testing it. Same problems as ever. If I order it to attack, it fires once and then stops, if I order it to attack ground, it fires once and then stops. Also when I order it to attack ground for some reason it fires perfectly accurate straight on the spot, its like its not even getting any reals or anything like that.
 
I am 100% positive it worked this way at some point at least.
It is currently absolutely not like this. The more you start to use the raw code of the game, the more you realize how little you actually need globals. locals are so cool. In one trigger you can be using local unit underwear and in another using local item underwear - you can use the same variable name for different things as often as you like (just not in the same trigger).

Weird, huh? I like it.
 
Level 6
Joined
Aug 12, 2007
Messages
201
Here is my map file if you want to take a look. It works better then before but it still doesn't do what I intended for it to do. I have to do a little testing with this wait and everything though to see if I can see what breaks and doesn't break MUI.
 

Attachments

  • InaccurateCatapultBribesCode.w3x
    19.7 KB · Views: 38
Level 6
Joined
Aug 12, 2007
Messages
201
Here is my map file if you want to take a look. It works better then before but it still doesn't do what I intended for it to do. I have to do a little testing with this wait and everything though to see if I can see what breaks and doesn't break MUI.

Also was it just me or did the whole website just go down a second ago?

Anyways I still have the problem that it only fires once on Attack and Attack Ground, it only keeps firing on enemies because it keeps re-aquiring them. If I want to attack my own units or attack ground into some fog of war, it will only fire once, which is no good. I considered spawning a dummy to attack but that wouldn't make it keep shooting my own guys or into fog of war, only if I was attacking ground somewhere.

EDIT: Whoops double post somehow.

  • KillTest
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Target Catapult
    • Actions
      • Wait 5.00 seconds
      • Unit - Kill (Triggering unit)
I was 100% positive this would not work, that if someone else cast that spell in between it would kill them instead of the first guy, yet it works. I have no idea why but hey it does. I'm starting to wonder why I thought Wait was such a deadly command.

Still no luck with getting my catapult to keep firing on anything but enemies though. Dummies are out, checking out your new post though.
 
Ok

1) it attacks your enemies. That was all these triggers were intended to do.

2) to make it constantly attack ground when you order it to attack ground:
  • Sample 2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(attackground))
      • (Unit-type of Triggering unit)) Equal to Catapult
    • Actions
      • Custom script: local real x = GetOrderPointX()
      • Custom script: local real y = GetOrderPointY()
      • Custom script: loop
      • Custom script: call IssuePointOrder(GetTriggerUnit(), "attackground", x+GetRandomReal(-256,256),y+GetRandomReal(-256,256))
      • Wait - (set this duration to the cooldown of his attack)
      • Custom script: exitwhen GetUnitCurrentOrder(GetTriggerUnit()) != OrderId("attackground"))
      • Custom script: endloop
3. To make it keep attacking your own units:

  • Sample 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Catapult
      • Owning Player of (Attacking Unit) Equal to Owning Player of Triggering Unit
    • Actions
      • Custom script: local unit u = GetAttacker()
      • Custom script: loop
      • Custom script: call IssuePointOrder(u,"flare",GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))
      • Wait (duration of the cooldown on Carrion Swarm) seconds
      • Custom script: exitwhen GetUnitCurrentOrder(u) == OrderId("move") or GetUnitCurrentOrder(u) == OrderId("holdposition")
      • Custom script: endloop
The way to make him stop is the moment the cooldown of carrion swarm finishes you have to have the catapult moving or tell him to hold position.
 
Last edited:
Level 6
Joined
Aug 12, 2007
Messages
201
Sample 2 is giving me some errors, apparently it expects 'endloop' where 'call IssuePointOrder' is and 'Invalid type for specified operator' on 'exitwhen GetUnitCurrentOrder'

This is why I like working solely in GUI because I understand why things do what they do, all thus calling custom scripts is like actual coding to me which I have no idea how to do it and can't fix problems like this.

EDIT: Recopypasting the first one seemed to fix the endloop but the second one still give the invalid operator message. I'm pretty sure I am running the latest version too, but I could be wrong.
 
Level 6
Joined
Aug 12, 2007
Messages
201
Copying it again now. And sorry for being such a huge dick before, I was so sure Wait was a broken command. Did how it functions change in a recent update maybe, or did I just hate it inexplicably for no reason.

And "Custom script: exitwhen GetUnitCurrentOrder(GetTriggerUnit() != OrderId("attackground")" Is still giving me Invalid Type for Specified Operator when I try to save it for some reason.
 
Here's my entry, lol.
Seeing what has been posted here, it might look like I overcomplicated things.
I tried to put as less custom script as neccessary but it couldn't be avoided.

Basicly what it does it: You have 2 skills, one to mark your target which you want to have ground attacked and the other skill to unmark it.
When marked it attacks that point every 2 sec unless you unmark.

This might not be what you want but atleast it fires randomly at given point.
Using vJass you could actually do a clean and working system for it.
 

Attachments

  • randomattackcata.w3x
    20.3 KB · Views: 69
Level 6
Joined
Aug 12, 2007
Messages
201
That was just me trying to put quotes around it here. Its not in the editor, sorry about that.

wontsave.png


Screencap of what it looks like. I probably could have just done a copy as text in retrospect.
 
Level 6
Joined
Aug 12, 2007
Messages
201
Nope, still comes up saying Invalid Type for that Specified Operator on that one line. Also should the firing trigger on your own guys also be the same as the original one, like right now I have two triggers that both start with Event unit attacked and condition attacker is catapult, only one also has Owning Player of (Attacking Unit) Equal to Owning Player of Triggering Unit in it, so each time I attack one of my own guys is it firing both triggers? Should the enemy one have the condition Owning Player of (Attacking Unit) Not Equal to Owning Player of Triggering Unit?
 
Level 6
Joined
Aug 12, 2007
Messages
201
has to be this
  • Custom script: exitwhen GetUnitCurrentOrder(GetTriggerUnit()) != OrderId("attackground")
Also on Sample 2, you don't store the initial target point which will result in offsetting the already offsetted target point. Which is why I used the skills to mark the points.

Does that mean every time it attacks it gets more and more inaccurate?
 
Status
Not open for further replies.
Top