Moving a Unit as a Missile

kelogsloops

You can change this now in User CP.
Reaction score
45
Okay so i made a spell that makes a missile(dummy) and moves the misisle blablabllba. the missile works and all, but after a while i realised that the missile no longer moves, it just sits beneath my hero. Heres my triggering.

Trigger:
  • Windy Arrow
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Windy Arrow
    • Actions
      • Set Caster = (Casting unit)
      • Set Temp_Point = (Position of Caster)
      • Set Target_Loc = (Target point of ability being cast)
      • Set Angle = (Angle from (Position of Caster) to Target_Loc)
      • Unit - Create 1 Windy Arrow for (Owner of Caster) at Temp_Point facing Angle degrees
      • Set MovingGroup[1] = (Last created unit)
      • Unit - Add a (1400.00 / 1550.00) second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call RemoveLocation(udg_Target_Loc)


Trigger:
  • Windy Arrow Move
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit - Move MovingGroup[1] instantly to ((Position of MovingGroup[1]) offset by 36.00 towards (Facing of MovingGroup[1]) degrees), facing (Facing of MovingGroup[1]) degrees
      • Unit Group - Pick every unit in (Units within 150.00 of (Position of MovingGroup[1]) matching (((Matching unit) belongs to an enemy of (Owner of MovingGroup[1])) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 DUMMEE for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Unit - Add Windy Arrow Slow to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Destructible - Pick every destructible within 150.00 of (Position of MovingGroup[1]) and do (Actions)
        • Loop - Actions
          • Destructible - Kill (Picked destructible)
 

Ayanami

칼리
Reaction score
288
It's because it isn't MUI. Every time you use this ability while another missile is already flying in air, the old values will be replaced by the new one. Thus, your mid-air missiles will stop.

As for the periodic trigger, 0.03 seconds is quite enough to form a smooth sliding effect. 0.04 seconds will be fine too.

Your trigger leaks, a lot. You might want to find a tutorial for MUI and Leaks in this forum.
 

TomTTT

New Member
Reaction score
44
Your trigger leaks... ALOT.
And as Ryushi said, it's not MUI and not multiplayer-safe, and so everytime someone cast the ability, the variables change and only the last set one will acctually move. And as i said, It leaks just a lot. Everytime 0.02 seconds it leaks in 2 at least points.
To make this ability MUI, your gonna need Hashtables, as skyblader said. I'd suggest you to learn hastables, it's very helpful. Search in this forum, you'll find a few tutorials.
 

kelogsloops

You can change this now in User CP.
Reaction score
45
okay, so, once i learn hashtables, am i going to have to go ALL over my spell codes.... LOL or does it only apply to spells that require 'second' triggers that rely on the first trigger? like this one
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
When you learn hashtables, you'll probably recerate the spell. And clearing leak tutorials can also be found in this forum.

Off-topic:
Coming to think of it... Ryushi and Gelnphir both have male anime characters...
 

Ayanami

칼리
Reaction score
288
okay, so, once i learn hashtables, am i going to have to go ALL over my spell codes.... LOL or does it only apply to spells that require 'second' triggers that rely on the first trigger? like this one

If it's an instant spell, basically you don't need to use hashtable of any sort. However, periodic triggers such as sliding movement requires hashtable.

Off-topic:
Coming to think of it... Ryushi and Gelnphir both have male anime characters...

My avatar is a female o.o
 

Cheddar

This is the way it was meant to be.
Reaction score
126
To me it looks like you add an expiration timer to your dummy which is less than a second (1400 / 1550 is close to 1 second, unless it's supposed to move really quickly). Other than that it should function normally.

EDIT: Just realized this is probably mimicing "Powershot". Well, try using just "Move unit instantly" instead of "Move unit instantly and face angle", because it'll retain its facing angle when you move it instantly. Also, it "MovingGroup" a Unit-type variable or Unit Group-type variable?
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Okay, I'll tell you how. In the first trigger, save the angle in the hashtable to key last created unit, and save the time left of the arrow unit to key last created unit, add the last created unit into another unit group. (A unit group that is not set/cleared, just add and remove units.)

In the second trigger, first action should be pick all units in the unit group you added the arrow in. Then you set angle = load bla bla bla of key picked unit. Set the time left too. Then move the picked unit in the angle offset by 36. Set time left of unit = time left of unit - 0.02. Then save that value to key picked unit.

Make a condition apart from your other condition,

If time left = 0.00

Then remove picked unit from the unit group
clear child hashtable of picked unit

And also add these 2 actions into your condition, the one below

Trigger:
  • Unit Group - Pick every unit in (Units within 150.00 of (Position of MovingGroup[1]) matching (((Matching unit) belongs to an enemy of (Owner of MovingGroup[1])) Equal to True)) and do (Actions)
    • Loop - Actions
      • Unit - Create 1 DUMMEE for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Unit - Add Windy Arrow Slow to (Last created unit)
      • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
 

kelogsloops

You can change this now in User CP.
Reaction score
45
save the angle in the hashtable to key last created unit

um, how do you save a unit type(last created unit) as real variable (angle). although sounds a bit dumb :/
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Trigger:
  • Hashtable - Save 0.00 as 1 of (Key (Last created unit)) in (Last created hashtable)
 

kelogsloops

You can change this now in User CP.
Reaction score
45
okay i think i'm going to look even MORE stupid but, when i go to Hashtable - Save Real, for the third 'argument', what function is it meant to be under? because the Hashtable - Get Handle ID or Get String ID doesn't give Event Response (last created unit) options...
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Okay when you select "Hashtable - Save Real", you get this right?
Trigger:
  • Hashtable - Save value as value of value in (Last created hashtable)


So you got your first 2 values...

Trigger:
  • Hashtable - Save 0.00 as 0 of value in (Last created hashtable)


Now the third one is actually "Hashtable - Get Handle ID"
And the statement would be "Key Handle"

Click on the "Handle" and select the last created unit.
 

kelogsloops

You can change this now in User CP.
Reaction score
45
okay i did as you said.

THANK YOU VERY MUCH! i'm going to try make another spell based on hashtables :D!!
NVM I FIXED IT :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top