Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
So when I have seen a Member's thread in idea factory asking for variations of his Banshee hero, I wanted to make Mortal Kombat X in Warcraft but instead I got this idea of a hero arena where characters that are not heroes have 3 variations and fight in teams of 2. Game is similiar to MK X, it requires good reflexes, timing and skills to win.
I had the idea to make this rifleman unit and I already have an idea of an ability. But the problem is - of course - I can't do it. Basically rifleman casts ensare-based ability called Quickshot on an enemy and after casting it he stops for 0.30 seconds and a text saying ''Quickshot'' above him appears. After that, if the target is still in range of the ability then rifleman swiftly shoots the target six times, each time dealing small damage and stunning for 0.50 seconds. I did the ability and it worked but when I tried to add the ''After that, if the target is still in range of the ability'' part it didn't work. Any help here?
Post your trigger. We can't help you unless we know where you are int the process. I could write this for you but you might not understand, so if you post the trigger people will know where your ability is at and be able to guide you from there.
[TRIGGER=Dis Fing]Quickshot
Events
Unit - A unit Starts the effect of an ability
Conditions
(((Unit-type of (Triggering unit)) Equal to Rifleman - Swift) or (((Unit-type of (Triggering unit)) Equal to Rifleman - Hunter) or ((Unit-type of (Triggering unit)) Equal to Rifleman - Adventurer))) and ((Ability being cast) Equal to Quickshot )
Actions
Set rifleman = (Triggering unit)
Unit - Order rifleman to Stop
Set quickshotTarget = (Target unit of ability being cast)
Special Effect - Create a special effect attached to the overhead of rifleman using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
Floating Text - Create floating text that reads Quickshot above rifleman with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Set riflemanEffect = (Last created special effect)
Wait 0.30 seconds
Floating Text - Destroy (Last created floating text)
Special Effect - Destroy riflemanEffect
Unit Group - Pick every unit in (Units within 200.00 of (Target point of issued order)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(quickshotTarget is in (Units within 200.00 of (Target point of ability being cast))) Equal to True
Then - Actions
Trigger - Turn on Quickshot Rest <gen>
Else - Actions
[/TRIGGER]
[TRIGGER=And another Dis Fing]Quickshot Rest
Events
Conditions
Actions
Unit - Add Quickshot AS to rifleman
Unit - Add Quickshot Stun to rifleman
Unit - Order rifleman to Attack quickshotTarget
Wait 0.20 seconds
Unit - Order rifleman to Attack quickshotTarget
Wait 0.20 seconds
Unit - Order rifleman to Attack quickshotTarget
Wait 0.20 seconds
Unit - Order rifleman to Attack quickshotTarget
Wait 0.20 seconds
Unit - Order rifleman to Attack quickshotTarget
Wait 0.20 seconds
Unit - Order rifleman to Attack quickshotTarget
Wait 0.20 seconds
Unit - Remove Quickshot AS from rifleman
Unit - Remove Quickshot Stun from rifleman
Unit - Order rifleman to Stop
Trigger - Turn off (This trigger)
[/TRIGGER]
I will walk through this trigger piece by piece:
Conditions:
(((Unit-type of (Triggering unit)) Equal to Rifleman - Swift) or (((Unit-type of (Triggering unit)) Equal to Rifleman - Hunter) or ((Unit-type of (Triggering unit)) Equal to Rifleman - Adventurer))) and ((Ability being cast) Equal to Quickshot )
Could you please explain why you dont use the "Or - Multiple conditions"?
1. It reads 100% better.
2. It is 100% easier modifyable.
3. It is 100% copy'n'paste compatible.
Floating Text - Create floating text that reads Quickshot above rifleman with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Destroy (Last created floating text)
Floating texts can be given a duration and they will be removed when that duration ends.
This is called the lifespan.
You have to disable permanence of that floating text though.
Special Effect - Create a special effect attached to the overhead of rifleman using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
Special Effect - Destroy riflemanEffect
I am not quite sure what kind of special effect model that is but when you destroy a special effect immediately after it is created, it will still show the death animation before it is removed.
Wait 0.30 seconds
Ok... let me be clear: Never use this method again until you know what it does!
Just use a custom script of PolledWait.
Place this code in the header file and use this custom script to wait an amount of seconds.
JASS:
function Wait takes real duration returns nothing
local timer t
local real timeRemaining
if duration > 0 then
set t = CreateTimer()
call TimerStart(t, duration, false, null)
loop
set timeRemaining = TimerGetRemaining(t)
exitwhen timeRemaining <= 0
if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
call TriggerSleepAction(0.1 * timeRemaining)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
call DestroyTimer(t)
set t = null
endif
endfunction
Custom script: call Wait( 1 )
Unit Group - Pick every unit in (Units within 200.00 of (Target point of issued order)) and do (Actions)
Here you create 2 leaks: A location and a group.
Handles (locations, units, groups, players, special effects, etc) are a set of data inside the game.
When you create a new handle, you reserve data of your computer.
When you do not want to use that handle any more, you have to remove the handle to clean up the data in your computer.
Otherwise, your computer would be filled with an enourmous amount of data in a very short time.
When using stuff like "Target point of issued order", "Target point of ability being cast", "Position of <unit>", "Center of <region>", etc. You create a NEW location (handle) and therefor create NEW data.
That data has to be removed in some way.
You have to store the location inside a variable. In this case, we can simply use a global variable which we will use over and over again.
So you set "TempLocation" (global variable) to the "Target point of ability being cast" and NOT "Target point of issued order" because we use an ability event rather than an order event.
When we do not have to use the location any more, we remove it by calling a custom script:
Now the group can be helped in two ways.
You can simply do the same as for the location with one difference that you do "DestroyGroup()" instead of "RemoveLocation()".
The other way is to create a custom script just before you use a group.
Custom script: set bj_wantDestroyGroup = true
This will destroy a group that will be used in the next "Pick every units in group" iteration.
Actions
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
This will not leak.
However... you do not want to use a group at all.
What you want is to know if the distance between the target point of ability being cast and the position of the target is lower or equal than 200.
So you use a real comparison and use the "Distance between points" action to find out the accurate distance.
You still have to store 2 locations in different variables and remove both handles.
Trigger - Turn on Quickshot Rest <gen>
As mentioned by Light... use the call instead of turn on.
About the other trigger... please just let someone else who has experience with those things create it for you.
Someone who knows how to
- add/remove control of the rifleman
- create accurate intervals
- control simulated attacks
TriggerSleepAction is too inaccurate for this. In single player it has at best a 0.1 second accuracy. In multiplayer it is usually closer to 0.4 seconds. Yes the actual minimum amount of time waited by TriggerSleepAction varies from session to session and is always longer in multiplayer than singleplayer.
You waitin' a good trigger from me lad? Then your life was a lie.
I will walk through this trigger piece by piece:
(((Unit-type of (Triggering unit)) Equal to Rifleman - Swift) or (((Unit-type of (Triggering unit)) Equal to Rifleman - Hunter) or ((Unit-type of (Triggering unit)) Equal to Rifleman - Adventurer))) and ((Ability being cast) Equal to Quickshot )
Could you please explain why you dont use the "Or - Multiple conditions"?
1. It reads 100% better.
2. It is 100% easier modifyable.
3. It is 100% copy'n'paste compatible.
4. It is something that this guy would never use until somebody tells him since he doesn't know what it is.
Floating Text - Create floating text that reads Quickshot above rifleman with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Destroy (Last created floating text)
Floating texts can be given a duration and they will be removed when that duration ends.
This is called the lifespan.
You have to disable permanence of that floating text though.
I tried using it but I didn't knew I must disable its permenance so it didn't work.
Special Effect - Create a special effect attached to the overhead of rifleman using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
Special Effect - Destroy riflemanEffect
I am not quite sure what kind of special effect model that is but when you destroy a special effect immediately after it is created, it will still show the death animation before it is removed.
It is an yellow exclamation mark and I want it to have a death animation.
Wait 0.30 seconds
Ok... let me be clear: Never use this method again until you know what it does!
Just use a custom script of PolledWait.
Place this code in the header file and use this custom script to wait an amount of seconds.
Unit Group - Pick every unit in (Units within 200.00 of (Target point of issued order)) and do (Actions)
Here you create 2 leaks: A location and a group.
Handles (locations, units, groups, players, special effects, etc) are a set of data inside the game.
When you create a new handle, you reserve data of your computer.
When you do not want to use that handle any more, you have to remove the handle to clean up the data in your computer.
Otherwise, your computer would be filled with an enourmous amount of data in a very short time.
When using stuff like "Target point of issued order", "Target point of ability being cast", "Position of <unit>", "Center of <region>", etc. You create a NEW location (handle) and therefor create NEW data.
That data has to be removed in some way.
You have to store the location inside a variable. In this case, we can simply use a global variable which we will use over and over again.
So you set "TempLocation" (global variable) to the "Target point of ability being cast" and NOT "Target point of issued order" because we use an ability event rather than an order event.
When we do not have to use the location any more, we remove it by calling a custom script: blah blah blah... (lol)
TriggerSleepAction is too inaccurate for this. In single player it has at best a 0.1 second accuracy. In multiplayer it is usually closer to 0.4 seconds. Yes the actual minimum amount of time waited by TriggerSleepAction varies from session to session and is always longer in multiplayer than singleplayer.
You create an If/Then/Else inside a group iteration.
Then you can use an OR or AND so you can have multiple conditions which you can read and modify way better than put everything in one.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.