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.
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
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
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.
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.
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).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.
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 thatJust 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).
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?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, you can use groups.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?
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.
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)
What if I used a real counter every 0.03 seconds that increased that counter by 'counter + 0.03? Won't that be accurate?
Wait; so in GUI the value of 0.03 is not constant?
So now we are waiting for his next post about the problem?
Thanks anyway to all of you, for being so patient with me, and asking my possibly stupid or noobish questions
Oh and @deathismyfriend, I am backing you up with this post.
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.
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)
The angle uses the function "Unit - Unit Facing Angle".
- 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)
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.
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.
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.