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

Moving Units (not instantly, and without animation)

Status
Not open for further replies.
Level 3
Joined
May 5, 2013
Messages
56
I have a question for my map.

How can i move units (not instantly), that it looks like i push them aside or away?
 
Level 3
Joined
May 5, 2013
Messages
56
thanks, I will try this. If it does not work, I will ask again...


Edit:

I have tried something, and I would like to know what exactly does not work.

I want to make a spell, that moves the casting unit in the direction it is currently facing:

  • Test Knockback
    • Events
      • Unit - A unit Starts the Effect of an Ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Twilight Enforcer
    • Actions
      • Set Knockback_CastingUnit = (Position of (Triggering unit))
      • Set Knockback_CastingUnit_Unit = (Triggering unit)
      • Set Knockback_TargetedUnit = (Position of (Target unit of ability being cast))
      • Trigger - Turn on Test Knockback periodic <gen>
      • Wait 0.06 game-time seconds
      • Trigger - Turn off Test Knockback periodic <gen>



  • Test Knockback periodic
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • Unit - Move Knockback_CastingUnit_Unit instantly to (Point(((X of Knockback_CastingUnit) + (Facing of Knockback_CastingUnit_Unit)), ((Y of Knockback_CastingUnit) + (Facing of Knockback_CastingUnit_Unit))))
      • Set Knockback_CastingUnit = (Position of Knockback_CastingUnit_Unit)




The problem is: The unit is moved in the direction, but no matter what degree the unit is facing, it moves differetnly wide away.

For Example: The Unit is facing 0 dgrees: Unit does not move very far
The Unit is facing 180 degrees: Unit moves very far



... why? help pls!
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
the problem is easy - you need to remove (x + facing of...), (y + facing of)
x and y are coordinates of a point and they are real numbers.
Facing is an angle - a real number that ranges from 0 to 360.

What you do is:
- set caster's point P
- move caster to x coordinate of point P + facing; and y coordinate of point P + facing

So what the trigger does is it finds X and Y of point P... it's for example 1020 and 480
A is angle the caster is facing;
if A is 0, the caster will be moved to x[1020]; y[480]
If A is 180, the caster will be moved to x[1200]; y [660] ( == 1020 + 180 => 1200; 480 + 180 = 660)

If you want to move caster towards enemy or away from him, use "point with polar offset" instead and as the angle use "angle between point1 (position of caster) and point2 (position of target)" or vice versa, depending if where should the caster be moved
 
Level 3
Joined
May 5, 2013
Messages
56
u should also know that waits are inaccurate. so that .06 wait can wait from .225 till about .31 seconds. also this is not MUI so it will bug if 2 or more units cast at almost the same time.

Excuse me if I ask a stupid question, but I dont know what GUI or MUi is. I am just some dude who is making his own map without any pre knowledge.

Btw, what should i do instead of waiting? If I remove waiting, it just turns trigger on and off and nothing happens.

What you do is:
- set caster's point P
- move caster to x coordinate of point P + facing; and y coordinate of point P + facing

I thought this is what i have done with:
  • Einheit - Move Knockback_CastingUnit_Unit instantly to (Point(((X of Knockback_CastingUnit) + (Facing of Knockback_CastingUnit_Unit)), ((Y of Knockback_CastingUnit) + (Facing of Knockback_CastingUnit_Unit))))
Sry but I dont understand how i have to set it....
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
GUI is exactly what it stands for: the Graphical User Interface.
This is the triggering you're used to: the events, conditions and actions are all converted from a raw language to a user interface.
GUI is opposed to JASS: JASS is the only coding language Warcraft 3 uses (and all GUI is automatically converted to JASS when saving the map).

'MUI' is a category we use to differentiate between spells.
Spells uploaded on the hive have to be at least MUI (and systems at least MPI) in order to be approved.

The order is this: Normal -> MPI -> MUI -> SUMI.
Each category inherits the previous category's attributes and adds to that (so something that is MUI is also MPI, but an MPI-ability is not MUI).
Normal: 1 unit can cast it at any given time.
MPI: 2+ different players can cast the ability at the same time.
MUI: 2+ different units can cast the spell at the same time.
SUMI: a single unit can cast the spell multiple times at once.​

So you do not want to use Bribe's system, correct?
Making a knockback-system that is MUI isn't that easy if you didn't even know what MUI meant before now.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
This is what you probably want to do:
  • Movement Ini
    • Events
    • Conditions
    • Actions
      • Set Caster = Blood Mage 0000 <gen>
      • Set Target = Mountain King 0001 <gen>
      • Trigger - Turn on Moveent Loop <gen>
This doesn't have any events etc., but you could add events and conditions of your choice. "Caster" and "Target" are unit variables.

  • Moveent Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set p1 = (Position of Caster)
      • Set p2 = (Position of Target)
      • Set p3 = (p2 offset by 5.00 towards (Angle from p1 to p2) degrees)
      • Unit - Move Target instantly to p3
      • -------- ------------------------ --------
      • -------- Clear leaks --------
      • Custom script: call RemoveLocation(udg_p1)
      • Custom script: call RemoveLocation(udg_p2)
      • Custom script: call RemoveLocation(udg_p3)
p1-3 are point variables. p3 is "point with polar offset".
The angle is "Math - Angle between points".
What this does is it moves "Target" every 0,03 seconds away from "Caster" by range 5.


GUI explanation
GUI = graphical user interface - it's the triggering editor. Basically when your spell is GUI, it means it's been set up using triggering editor.

Basically this is considered GUI
  • GUI
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Wait 2.00 seconds
      • Unit - Kill (Last created unit)
This is just a random trigger with random actions in it. Your trigger is also GUI.

When you save/play your map, all GUI triggers are converted into script
like this
Code:
function Trig_GUI_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(0) ) ) then
        return false
    endif
    return true
endfunction

function Trig_GUI_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
    call TriggerSleepAction( 2 )
    call KillUnit( GetLastCreatedUnit() )
endfunction

//===========================================================================
function InitTrig_GUI takes nothing returns nothing
    set gg_trg_GUI = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_GUI, GetPlayableMapRect() )
    call TriggerAddCondition( gg_trg_GUI, Condition( function Trig_GUI_Conditions ) )
    call TriggerAddAction( gg_trg_GUI, function Trig_GUI_Actions )
endfunction
This is how the trigger above looks when converted to script. Script languages are Jass/vJass. Anything that is jass/vjass is written like the one script above.


MUI explanation
Mui simply means Multi-unit instanceability - it means that your spell can be used by more than 1 unit at the same time. Currently my spell is not MUI. As an example, I will use the trigger I provided for you with the movement.
This is how it goes:
UnitA starts casting Push on UnitB
Unit A will be now considered "Caster" and UnitB will be considered "Target".
Now after some time, UnitC starts casting this ability on UnitD.
UnitC will be now considered "Caster" and UnitD "Target".

Because variables "Caster" and "Target" can only "remember" 1 unit each, it will "forget" UnitA and UnitB - that will mean that UnitB will no longer be moved away from UnitA.
 
Level 3
Joined
May 5, 2013
Messages
56
GUI is exactly what it stands for: the Graphical User Interface.
This is the triggering you're used to: the events, conditions and actions are all converted from a raw language to a user interface.
GUI is opposed to JASS: JASS is the only coding language Warcraft 3 uses (and all GUI is automatically converted to JASS when saving the map).

'MUI' is a category we use to differentiate between spells.
Spells uploaded on the hive have to be at least MUI (and systems at least MPI) in order to be approved.

The order is this: Normal -> MPI -> MUI -> SUMI.

Normal: only 1 unit can cast it at any given time. More than 1 unit and it will bug.
MPI: 2+ different players can cast the ability at the same time. A single player can only have 1 instance active at a time or it will bug.
MUI: 2+ different units (players don't matter here) can cast the spell. If a single unit tries to cast it multiple times at the same moment, it might bug.
SUMI: every single unit can cast the spell multiple times at once without bugging.

So you do not want to use Bribe's system, correct?
Making a knockback-system that is MUI isn't that easy if you didn't even know what MUI meant before now.

But if I use different Variables for the casdting and the targeted units, I dont think this will bug. But that would still be MUI, wouldn't it?


Edit:


Mui simply means Multi-unit instanceability - it means that your spell can be used by more than 1 unit at the same time. Currently my spell is not MUI. As an example, I will use the trigger I provided for you with the movement.
This is how it goes:
UnitA starts casting Push on UnitB
Unit A will be now considered "Caster" and UnitB will be considered "Target".
Now after some time, UnitC starts casting this ability on UnitD.
UnitC will be now considered "Caster" and UnitD "Target".

Because variables "Caster" and "Target" can only "remember" 1 unit each, it will "forget" UnitA and UnitB - that will mean that UnitB will no longer be moved away from UnitA.


Ah, so if I use the Variable Unit Array instead of Unit, it would be MUI? Because then he would only "remember" 1 unit, correctly?
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
To make spell MUI, it is usually best to convert variable into array (when you open up a variable in variable editor, check the "array" box and set the number "size". Size means how many informations it can save. If you have Size 1, it will save up to 2 information (for example 2 units), if size 10, it will save up to 11 informations.

Then you will need to set up an order for saving, so for example when first unit casts the spell, it will be saved as
Caster[1]... second unit as Caster[2] and so on.
That way you may end up with Caster[1] using your spell on Target[1], etc.
For AoE spells, you may consider for example having groups, where the targets are, so you have Caster[1] and all units in Group[1] that are knocked away from the caster.
You may also use Hashtables, which can store many informations.

There are tutorials at http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/ - I advise you go through them, you will get a lot better idea how to set up your triggers.

To make spells MUI, you could for example read through this tutorial: http://www.hiveworkshop.com/forums/...279/multi-instancible-gui-spell-making-34393/
 
Level 3
Joined
May 5, 2013
Messages
56
Thank you very very much everyone. I now try to set the trigger like you told me, I will make report if it works.




Edit:

Ok, the Casting Unit now moves correctly, but it moves to the position of the targeted unit and not the direction it is facing.

The spell should move the targeted unit in the direction it is facing...


Edit the Edited:

Excuse me I made a mistake in copying the triggers, i wrongsly set "moving casting unit" instead of "moving targeted unit", but still the targeted unit is just thrown away from the direction of the caster, and not the angle it is facing
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
To make spell MUI, it is usually best to convert variable into array (when you open up a variable in variable editor, check the "array" box and set the number "size". Size means how many informations it can save. If you have Size 1, it will save up to 2 information (for example 2 units), if size 10, it will save up to 11 informations.
Just a quick note here: never change the size of an array. It will always be able to store 8192 values (from 0 to 8191).

What "size" does, is initialize those values up to that index. So if you set size to 100, then it will initialize 101 values at map init (which, most of the time, is just the default value anyway). This slows down the loading and might crash the thread (meaning that your trigger "Map Initialization" won't run).
The only exceptions where you can do this are "Dialog" and "Timer" (because you cannot create those 2 with GUI, so you'll have to initialize them).
 
Level 3
Joined
May 5, 2013
Messages
56
By testing a bit, I noticed, that if I set the offset value as negative, it pulls the target in, instead of shoving it away.

However, heres my Question:
I know this effect is GUI, but what if I use fpr every knockback spell, an own Variable, example:

Casting Unit: A ; Targeted Unit B
Variable AB

Casting Unit C ; Targeted Unit D
Variable CD

Then I dont have the Problem that multiple Targets are in the same Variable and it bugs.




Another Question: How can I shove multiple Units away?

Maybe by:
Pick up every Unit in unit Group and do Action:
  • Set p1 = (Position of Caster)
  • Set p2 = (Position of Target)
  • Set p3 = (p2 offset by 5.00 towards (Angle from p1 to p2) degrees)
  • Unit - Move Target instantly to p3
  • -------- ------------------------ --------
  • -------- Clear leaks --------
  • Custom script: call RemoveLocation(udg_p1)
  • Custom script: call RemoveLocation(udg_p2)
  • Custom script: call RemoveLocation(udg_p3)
Would that work correctly?
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Just a quick note here: never change the size of an array. It will always be able to store 8192 values (from 0 to 8191).

What "size" does, is initialize those values up to that index. So if you set size to 100, then it will initialize 101 values at map init (which, most of the time, is just the default value anyway). This slows down the loading and might crash the thread (meaning that your trigger "Map Initialization" won't run).
The only exceptions where you can do this are "Dialog" and "Timer" (because you cannot create those 2 with GUI, so you'll have to initialize them).
Really now... I guess I must've misunderstood that part about size in tutorials, or maybe it was written incorrectly to begin with. Anyway thanks - didn't know that :thumbs_up:


By testing a bit, I noticed, that if I set the offset value as negative, it pulls the target in, instead of shoving it away.

However, heres my Question:
I know this effect is GUI, but what if I use fpr every knockback spell, an own Variable, example:

Casting Unit: A ; Targeted Unit B
Variable AB

Casting Unit C ; Targeted Unit D
Variable CD

Then I dont have the Problem that multiple Targets are in the same Variable and it bugs.
Yes that is possible as well, but very limiting. Just imagine - how should the game find out under which unit variable should save caster and target?
You would have to make a lot of If/then/else and you would still be limited by the maximum number of variables you created.

You would for example need to do something like this:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • A_caster Equal to No unit
        • Then - Actions
          • Set A_caster = (Triggering unit)
          • Set A_target = (Target unit of ability being caster)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • B_caster Equal to No unit
            • Then - Actions
              • Set B_caster = (Triggering unit)
              • Set B_target = (Target unit of ability being caster)
            • Else - Actions
              • -------- and so on... --------
This checks if "A_caster" is equal to no unit. If yes, it is an empty variable and ready for use. You would have to repeat this If/Then/Else for each variable you have.

If you do it through array, you can do it this simply:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set i = (i + 1)
      • Set Caster[i] = (Triggering unit)
      • Set Target[i] = (Target unit of ability being cast)
where "i" is an integer variable with starting/default value 0.
This save i as (i+1), so the first time this is cast, i = 1, so Caster and Target will have indices 1; second time "i" will be equal to 2, so Caster and Target will have indices 2 and so on. You will have to make sure that the value "i" doesn't get rewritten by other triggers though.


Another Question: How can I shove multiple Units away?

Maybe by:
Pick up every Unit in unit Group and do Action:
*trigger*

Would that work correctly?
Yes, you can use groups.
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set p1 = (Position of Caster)
      • Unit Group - Pick every unit in PushGroup and do (Actions)
        • Loop - Actions
          • Set p2 = (Position of (Picked unit))
          • Set p3 = (p2 offset by 5.00 towards (Angle from p1 to p2) degrees)
          • Unit - Move Target instantly to p3
          • Custom script: call RemoveLocation(udg_p2)
          • Custom script: call RemoveLocation(udg_p3)
      • Custom script: call RemoveLocation(udg_p1)
This picks every unit in group called PushGroup and moves them away from caster. You will need to add units to PushGroup when the caster starts casting his ability.
 
Level 3
Joined
May 5, 2013
Messages
56
thank you all very much, I guess i have now understood this whole pushing around system.

If anything like pushing won't work, I will make a post here.
 
Level 3
Joined
May 5, 2013
Messages
56
u should also know that waits are inaccurate. so that .06 wait can wait from .225 till about .31 seconds. also this is not MUI so it will bug if 2 or more units cast at almost the same time.

Yes, I know see the problem here...

Here are again my 2 Triggers:

  • Test Knockback
    • Ereignisse
      • Unit - A unit Starts the Effect of an Ability
    • Bedingungen
      • (Unit-type of (Triggering unit)) Equal to Twilight Enforcer
    • Aktionen
      • Set Knockback_CastingUnit = (Triggering unit)
      • Set Knockback_TargetedUnit = (Target unit of ability being cast)
      • Trigger - Turn on Test Knockback periodic <gen>
      • Wait 0.25 game-time seconds <- HERE IS THE PROBLEM I THINK
      • Trigger - Turn off Test Knockback periodic <gen>
  • Test Knockback periodic
    • Ereignisse
      • Time - Every 0.01 seconds of game time
    • Bedingungen
    • Aktionen
      • Set Knockback_p1caster = (Position of Knockback_CastingUnit)
      • Set Knockback_p2target = (Position of Knockback_TargetedUnit)
      • Set Knockback_p3 = (Knockback_p2target offset by 12.00 towards (Angle from Knockback_p1caster to Knockback_p2target) degrees)
      • Unit - Move Knockback_TargetedUnit instantly to Knockback_p3
      • Custom script: call RemoveLocation(udg_Knockback_p1caster)
      • Custom script: call RemoveLocation(udg_Knockback_p2target)
      • Custom script: call RemoveLocation(udg_Knockback_p3)


Mostly when i cast this, it works as it should.

But sometimes, the Unit is pushed further away than it should be, and i think that is because the "Wait 0.25 game-time seconds" waits a bit more.

Btw, I used the offset in "Set Knockback_p3 = (Knockback_p2target offset by 12.00 towards (Angle from Knockback_p1caster to Knockback_p2target) degrees)" to regulate the speed the unit is thrown (because the higher the offset the faster it goes),
and the ""Wait 0.25 game-time seconds" to regulate the width the unit is thrown (And this would work if the "the Wait 0.25 game-time seconds" would wait exactly 0.25 seconds).


Help pls? :)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
u should use a knockback system here on the hive.
If u dont want to then use a counter and make the trigger MUI.
basically u index the instances into an array. then u move the unit instantly to point every .03 and for the counter do counter = counter + 1. when it hits 9 then u de-index the units ( thats about a .27 wait time)
 
Level 3
Joined
May 5, 2013
Messages
56
u should use a knockback system here on the hive.
If u dont want to then use a counter and make the trigger MUI.
basically u index the instances into an array. then u move the unit instantly to point every .03 and for the counter do counter = counter + 1. when it hits 9 then u de-index the units ( thats about a .27 wait time)


If I dont want to? The Hive Systems I have seen so far is the one from one of the posts, and the moment I saw this I realised that I have no plan how to import that.

Anyway, I try to make my trigger MUI. If I want to index the instances into an array, I make a new Variable (Integer array) which then is the time? I dont understand that sorry...
Do I make my current Variables Array or do I have to make a new one using array?
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
for time use either real variable or integer variable.
real variables are sometimes inaccurate... death can probably elaborate more on this

from that perspective, integers are more accurate, however if you run your loop trigger every 0,03 second and you want the pushback to last 3 seconds, then the trigger will run 3/0,03 => 100 times. So you wouldn't set integer number as actual time (which you cuold do with real variable), but as the number of times the trigger should run - in this case to 100.
Then in the loop you set the integer as (integer - 1) and check if that integer is equal to 0. If it is, then the spell should end.

To summarize it, if you use real variable as timer, you can use it as a real time, but it can bug sometimes; if you want precise timer, you should use integer variable, however you will have to calculate yourself firsthand how long the spell will last and so how many times your loop trigger will run.

Real variable - you can save it as actual time, but they are sometimes inaccurate (this can lead to the spell looping even after it should've ended)
Integer variable - you don't use it as actual time, but as number of times the loop trigger would run during that spell's effect.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
What if I used a real counter every 0.03 seconds that increased that counter by 'counter + 0.03? Won't that be accurate?

no because reals themselves are inaccurate. when using jass we actually use 0.031250000 to give us more accuracy for reals. in GUI u cant do that.
IMO reals should never be used for counting except for periodic triggers which cant be helped. Use integers for counting.

@TO
if u dont know how to index look at my tutorial and read the text in the triggers to see how each line works. Practice by making the spell i make to see how to do it. Then implement it into the spell u want.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Wait; so in GUI the value of 0.03 is not constant?

it is as close as u are going to get unless u add the event using custom script. It really isnt noticeable, but when using reals ase a counter in a spell if u do something like tempReal equal to .03 it may never be .03 it might be .0300000001 and it will return false for the ITE. So it can bug. I dont know exact values as i never tested nor will i ever test this. I was just told they were inaccurate when i was doing my systems and things and i used a real counter because i thought they were accurate. integers are accurate so y not use them. its not hard to do simple division to see what it would be for 1 second or watever u are comparing it to. So its not really a big deal. u know what i mean
 
Level 3
Joined
May 5, 2013
Messages
56
So now we are waiting for his next post about the problem?

excuse me, I am just a human and I need to sleep I cant be here 24h a day...




They helped me with a problem, I wanted to create some kind of Knockback spell, this is as far as I got:

  • Test Knockback
  • Ereignisse
  • Unit - A unit Starts the Effect of an Ability
  • Bedingungen
  • (Unit-type of (Triggering unit)) Equal to Twilight Enforcer
  • Aktionen
  • Set Knockback_CastingUnit = (Triggering unit)
  • Set Knockback_TargetedUnit = (Target unit of ability being cast)
  • Trigger - Turn on Test Knockback periodic <gen>
  • Wait 0.25 game-time seconds <- HERE IS THE PROBLEM I THINK
  • Trigger - Turn off Test Knockback periodic <gen>


  • Test Knockback periodic
  • Ereignisse
  • Time - Every 0.01 seconds of game time
  • Bedingungen
  • Aktionen
  • Set Knockback_p1caster = (Position of Knockback_CastingUnit)
  • Set Knockback_p2target = (Position of Knockback_TargetedUnit)
  • Set Knockback_p3 = (Knockback_p2target offset by 12.00 towards (Angle from Knockback_p1caster to Knockback_p2target) degrees)
  • Unit - Move Knockback_TargetedUnit instantly to Knockback_p3
  • Custom script: call RemoveLocation(udg_Knockback_p1caster)
  • Custom script: call RemoveLocation(udg_Knockback_p2target)
  • Custom script: call RemoveLocation(udg_Knockback_p3)


But I still had some questions, becuase that wait for 0.25 game time was inaccurate (sometimes it waited longer) and I asked for some way to avoid that.

Honestly, I didnt have the time to test that, and I am going so sleep now so I am making report tomorrow morning.

Thanks anyway to all of you, for being so patient with me, and asking my possibly stupid or noobish questions :)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Thanks anyway to all of you, for being so patient with me, and asking my possibly stupid or noobish questions :)

there not stupid or noobish every starts somewere.

As for ur problem this will not work for knockback because a knockback system needs to be MUI ( multi unit instanceable). if its not MUI when a second unit goes to get knocked back it will bug up and stop working.
to make it MUI u need to use indexing / de-indexing. I have a chapter in my tutorial Things a GUIer Should Know. in my sig. its called how to index. That will show u how to make things MUI.

There are some real good knockback systems here on the hive if u search for it. They already have the bugs worked out. So it would be easy to use.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
I think you need a custom knockback system here on Hive. Download it and import it into your map. Everything should work just fine after that.

The reason yours currently won't work because, rephrasing deathismyfriend, it's not MUI. Or simply put, it won't work because two units can't cast it at the same time or in any given time period where one unit has already cast the knockback and another unit suddenly casts it again.

So please do use a knockback system here on Hive.

Oh and @deathismyfriend, I am backing you up with this post.
 
Level 3
Joined
May 5, 2013
Messages
56
As for ur problem this will not work for knockback because a knockback system needs to be MUI ( multi unit instanceable). if its not MUI when a second unit goes to get knocked back it will bug up and stop working.
to make it MUI u need to use indexing / de-indexing. I have a chapter in my tutorial Things a GUIer Should Know. in my sig. its called how to index. That will show u how to make things MUI.

There are some real good knockback systems here on the hive if u search for it. They already have the bugs worked out. So it would be easy to use.


Ok I have some more Questions:

1. GUI, MUI, whatever.

If I make for every spell and trigger new Variables, then this wouldnt bug right? Because if I always set the caster and the target new (which is possible in GUI) then there shouldnt be any problem doing this, right?


2. A Question I asked before:

How can I move a unit in the direction it is currently facing?
Not away from the target...


3. If I find a good Knockback system here on the Hive, how can I easily import it?
Do I have to copy every Variable and every Action by copy and paste? Because I can only open one map at one and then this would be like "open map Knockbacksystem, copy Trigger 1, open my map, paste trigger" and that with every variable and action would take so long that it would be faster if I make my own.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1) I'm not quite sure I understand what you mean.
If you make new variables for each spell, the spells will obviously not conflict with each other, but that doesn't make the ability MUI (it's possible that the ability still conflicts with itself when cast multiple times).

2)
  • Actions
    • Set TempLoc1 = (Position of Unit)
    • Set TempLoc2 = (TempLoc1 offset by 100.00 towards (Facing of Unit) degrees)
    • Unit - Move Unit instantly to TempLoc2
    • Custom script: call RemoveLocation(udg_TempLoc1)
    • Custom script: call RemoveLocation(udg_TempLoc2)
The angle uses the function "Unit - Unit Facing Angle".

3) First of all: set your World Editor properties correctly.
To do this, go to File -> Preferences and enable "Automatically create unknown variables while pasting trigger data".

After that, open the map of the system you wish to import.
Usually this contains a little "how to import"-commentary, you should read that (it tells you exactly what to import).
In the trigger editor, you should just copy the category that contains all system-related triggers. Go to your map and paste it.
The system is now imported into your map.

Sometimes you also need to import objects. This is exactly the same method: copy and paste.
 
Last edited:
Level 3
Joined
May 5, 2013
Messages
56
1) I'm not quite sure I understand what you mean.
If you make new variables for each spell, the spells will obviously not conflict with each other, but that doesn't make the ability MUI (it's possible that the ability still conflicts with itself when cast multiple times).

2)
  • Actions
    • Set TempLoc1 = (Position of Unit)
    • Set TempLoc2 = (TempLoc1 offset by 100.00 towards (Facing of Unit) degrees)
    • Unit - Move Unit instantly to TempLoc2
    • Custom script: call RemoveLocation(udg_TempLoc1)
    • Custom script: call RemoveLocation(udg_TempLoc2)
The angle uses the function "Unit - Unit Facing Angle".

3) First of all: set your World Editor properties correctly.
To do this, go to File -> Preferences and enable "Automatically create unknown variables while pasting trigger data".

After that, open the map of the system you wish to import.
Usually this contains a little "how to import"-commentary, you should read that (it tells you exactly what to import).
In the trigger editor, you should just copy the category that contains all system-related triggers. Go to your map and paste it.
The system is now imported into your map.

Sometimes you also need to import objects. This is exactly the same method: copy and paste.




1. I know this will not be MUI, but I tested it and the triggers work correctly. Example:
My Unit (I named it Twilight Enforcer) casts the Knockback spell on Unit A: Unit A is moved.
Twilight Enforcer now casts the spell on Unit B: Unit B is moved...

-> works correctly so far

What do you mean by "it's possible that the ability still conflicts with itself when cast multiple times"


2. Thank you! :) I will go test that soon

3. I didnt had that check on the box "Automatically create unknown variables while pasting trigger data" thats why it never worked. I will soon search out for a Knockback system, and import it. If I take a close look at the Knockback system I may learn how to do that myself. But thats only in best case of course xD
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
for #1
- MUI means that you have multiple instances of the spell active at the same time = multiple casters.
What you have atm is this:
Twilight Enforcer casts spell on Unit A = 1 active instance.
Then spell ends/is interrupted => 0 active instances of the spell
Now Twilight Enforcer casts spell on Unit B => 1 active instance again.

Spells don't have to be MUI, if
a) that spell is used by unique unit only
b) only 1 unit is able to cast that spell at a time
c) the effect of the spell is instant

a)
A unique unit may be for example a Boss of your map - he will only exist once in that map, there will never be that same unit-type in map. If such unit uses spell, that spell doesn't have to be MUI.

b)
that means that you will have to prevent other units from casting that spell. If 1 unit casts that ability and other units are prevented, you can say that the caster is temporarily a "unique" unit.
If you had multiple bosses who share the same ability, but you can fight only 1 boss at a time, then it's alright if the spell all bosses share is not MUI

c)
If the spell's effect lasts a certain duration and the caster is able to cast it again before the duration ends, than it will collide.

As an example - look at night elf Hero "Warden" and her ability "Shadow Strike" - it places a "Damage over time" (DoT) buff on the target.
The DoT buff lasts for 15 seconds, however Shadow Strike cooldown is 8 seconds - that means that the Warden is able to keep up up to 2 units afflicted with that DoT buff.
That means that Shadow Strike spell has to be MUI, so it affects different units at different times.
If Shadow Strike wasn't MUI, the DoT buff would get rewritten to the new target.

For spell to not be MUI but work correclty, either points a) or b) have to be true and point c) has to be always true.
 
Level 3
Joined
May 5, 2013
Messages
56
For spell to not be MUI but work correclty, either points a) or b) have to be true and point c) has to be always true.

Yes, I considered that:

a) The Hero is unique (only one player at any time can play the hero)

b) ---> a!

c) The moving goes over 0.25 sec, and the spell will have a cooldown of more then 5.00 seconds


All conditions are true, spell will work :)
 
Status
Not open for further replies.
Top