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

Cluster Rockets

Status
Not open for further replies.
Level 9
Joined
May 22, 2009
Messages
276
Hi, I made an ability where when you cast it, dummy units use cluster rockets. The ability is based of channel, is point target and has a target image.

  • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets GlaiveShooter_Point
This part of the trigger doesn't work, Last created unit is the dummy, and I checked it, he has the ability, it costs no mana, but he doesn't cast it at the point:

  • Set GlaiveShooter_Point = (Target point of ability being cast)
I'm thinking there's somethign wrong with either the point or the order, The cluster rockets I added to the dummy is a unit ability

+rep for help
 
Level 7
Joined
Nov 6, 2009
Messages
279
Hi, I made an ability where when you cast it, dummy units use cluster rockets. The ability is based of channel, is point target and has a target image.

  • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets GlaiveShooter_Point
This part of the trigger doesn't work, Last created unit is the dummy, and I checked it, he has the ability, it costs no mana, but he doesn't cast it at the point:

  • Set GlaiveShooter_Point = (Target point of ability being cast)
I'm thinking there's somethign wrong with either the point or the order, The cluster rockets I added to the dummy is a unit ability

+rep for help

Post the whole trigger or a demo map.
Also Channel kinda fails with the animation (although this is irrelevant).
 
Ok, first off, just use "Visible" in the options for the channel-based ability. Targeting image won't do something exclusive.
Secondly, i think cluster rockets need a minimum range to be casted, so when you create your unit at the target point of ability being cast and you order it to cast the ability at that point, it means it's given an order to target a 0 range distance. Create the dummy at the location of your caster, not the target point.
 
Level 7
Joined
Nov 6, 2009
Messages
279
Ok, first off, just use "Visible" in the options for the channel-based ability. Targeting image won't do something exclusive.
Secondly, i think cluster rockets need a minimum range to be casted, so when you create your unit at the target point of ability being cast and you order it to cast the ability at that point, it means it's given an order to target a 0 range distance. Create the dummy at the location of your caster, not the target point.

LOL, cluster rockets do not have minimum range, hes obviously using visible.
Maybe hes creating the dummy out of range(maybe)
Since hes online right now he could just post the whole trigger.

EDIT: And now hes offline...
 
Last edited:
Level 9
Joined
May 22, 2009
Messages
276
  • Rocket Launcher
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rocket Launcher(item)
    • Actions
      • Set GeneralPoint = (Position of (Triggering unit))
      • Set GlaiveShooter_Point = (Target point of ability being cast)
      • Set ItemsCarried = 0
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Rocket Launcher
            • Then - Actions
              • Set ItemsCarried = (ItemsCarried + 1)
            • Else - Actions
      • For each (Integer A) from 1 to ItemsCarried, do (Actions)
        • Loop - Actions
          • Unit - Create 1 AAA Universal for Player 1 (Red) at GeneralPoint facing Default building facing degrees
          • Unit - Add Rocket Launcher to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets GlaiveShooter_Point
      • Custom script: call RemoveLocation(udg_GeneralPoint)
      • Custom script: call RemoveLocation(udg_GlaiveShooter_Point)
this is the whole trigger, the ability being cast is an item ability

Yes pharaoh the ability is visible, even tho this is not needed because it's an item ability

so basicly when I cast this ability (use this item), it shoots cluster rockets=the amount of rocket launchers I have

Note: the trigger does everything except the last line, I tested it
 
  • For each (Integer A) from 1 to ItemsCarried, do (Actions)
    • Loop - Actions
      • Unit - Create 1 AAA Universal for Player 1 (Red) at GeneralPoint facing Default building facing degrees
      • Unit - Add Rocket Launcher to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets GlaiveShooter_Point
Use IntegerB for this loop.

  • Set ItemsCarried = 0
You don't need this; the default value of an integer is 0 already.

If with IntegerB doesn't work, I will need the map, cause I can't guess something else.





Here is a test map: View attachment Cluster based on items count.w3x
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I would keep the variable definition there anyways, also it won't make a difference if he uses For-Loop-A or B. Put two loops in succession to each other and convert to custom script, you'll see the variables are determined properly before the loop (but after the previous one).

Do you want to maybe post your map so we can see what you did wrong? This seems to me to be more of an Object Editor / Trigger Editor logic error, or simple careless mistake.
 
Level 9
Joined
May 22, 2009
Messages
276
  • For each (Integer A) from 1 to ItemsCarried, do (Actions)
    • Loop - Actions
      • Unit - Create 1 AAA Universal for Player 1 (Red) at GeneralPoint facing Default building facing degrees
      • Unit - Add Rocket Launcher to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets GlaiveShooter_Point
Use IntegerB for this loop.

  • Set ItemsCarried = 0
You don't need this; the default value of an integer is 0 already.

If with IntegerB doesn't work, I will need the map, cause I can't guess something else.





Here is a test map: View attachment 76959

Yes that line is needed, else itemscarried increases every time I use the ability

I'll check your map and try to see what I did wrong
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I actually didn't see the test-map initially.

Just as I thought. All you need to do is remove the cast backswing on the dummy-caster (set to 0.00) and your ability will work properly. You can also remove the "Invulnerable (Neutral)" ability from the dummy since Locust automatically includes that.

There are also better methods of killing your dummy units. Since an expiration timer will only "kill" the unit, it will still take a little while for it to be completely removed from the game. Instead of having this "buffer" period you can eliminate the "middle-man" and just remove the dummy. In order to time it properly, you'll need to detect when the dummy unit finishes casting its spell. I have done this in the test-map attached to show you.
 

Attachments

  • Cluster based on items count.w3x
    18.3 KB · Views: 52
Level 9
Joined
May 22, 2009
Messages
276
I actually didn't see the test-map initially.

Just as I thought. All you need to do is remove the cast backswing on the dummy-caster (set to 0.00) and your ability will work properly. You can also remove the "Invulnerable (Neutral)" ability from the dummy since Locust automatically includes that.

There are also better methods of killing your dummy units. Since an expiration timer will only "kill" the unit, it will still take a little while for it to be completely removed from the game. Instead of having this "buffer" period you can eliminate the "middle-man" and just remove the dummy. In order to time it properly, you'll need to detect when the dummy unit finishes casting its spell. I have done this in the test-map attached to show you.

what do u mean with cast backswing?
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
  • For each (Integer A) from 1 to 6, do (Actions)
  • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Rocket Launcher
Item slot loops always glitched for me when I used them in my map. It would only register the first inventory slot and ignore all of the others. I eventually changed it to a JASS loop and it executed perfectly. Let me know if you have the same problem with inventory slots.
 
Level 9
Joined
May 22, 2009
Messages
276
it didn't work, I'm gonna test somethign by creating a unit at the target point of ability being cast, to check if maybe the problem lies there

Here's info on the 2 spells I use, I think the main difference is I'm using it as an item while in ur test version it's a hero ability

11t36nk.jpg


the left one is the item ability, the right one is the actual cluster rockets
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
skamigo said:
it didn't work

In my test-map it does.

skamigo said:
I think the main difference is I'm using it as an item while in ur test version it's a hero ability

I sent you back the exact same map you sent me with 2-3 changes. I never changed any of the ability data though.

I think that its not working for you because you can't use GetSpellTargetLoc when using an item-ability.

What you'll want to do is use an item-ability that spawns a summoned unit (Sentry Ward (item)) and then use the summoned unit's location as a "target location".
 
Level 9
Joined
May 22, 2009
Messages
276
The trigger does everything right except cast the ability, the points are right, I double checked everything, it just doesn't want to cast the freakin ability

Edit: my dummy unit is hidden, maybe that's a part of the problem, I'll check it tomorow
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
skamigo said:
it gets the location, I tested it by spawning a unit there when I cast the ability

I thought you were using the event "Unit uses item". If you aren't, then the original code that I included in the test-map should work. Just for piece of mind, I tested it out and it does work.

Here is an updated test-map. All I did was make a custom item and add the ability to the item (as an item ability, not a hero ability) and it works.

** Edit **

It seems I was a little confused. I thought the test-map came from the thread-starter. Pharoah_, your test-map didn't work initially for me until I set the dummy's cast back-swing to 0.00. Either way, the test-map I've included here has a working item version of this.
 

Attachments

  • Cluster based on items count.w3x
    18.6 KB · Views: 47
Level 9
Joined
May 22, 2009
Messages
276
skamigo, why don't you simply use the map I sent you? :X

I did, I changed everything like it was in your map, but the difference is it's an item ability, and also it has no image target, even tho that's not part of what's not working, I'll just copy the dummy from your map, maybe that's what's wrong with it

either way I'll give u 2 +rep anyways, you've done more effort than I asked for already xD
 
Status
Not open for further replies.
Top