After browsing the forums for about an hour without finding a thread with this subject I decided to make a new thread about it - firing projectiles with No Target.
By that I mean that the projectile is shot independent from any target, just like a real-life rocket launcher for example. My problem is that I have no idea how to do this, I remember some did that in Warcraft 3 Edit with just custom script but at that time I was not much of a scripter so I didn't understand it.
So I am asking; is there any thread about it and if not do anyone of you know a way around this?
I am in dire need of this function and I am faithfully yours if you solve it.
What do you mean? Do you mean a rocket that when fired, will explode on the first target it crosses paths, or a rocket you can target the ground with instead of a unit?
Sorry if I didn't explain thoroughly. What I want is a projectile, for example a rocket, that can be fired without a target. Like just firing through the air so that it will continue flying through the air untill it hits something.
There are a couple ways. Te easiest I think is to give your projectile a periodic buff that has a search effect. When it finds something, kill te projectile.
TRIGGER 01, is triggered with a <Key Pressed> event. It sets a bolean variable, (_is Firing) equal to True and also it runs TRIGGER 02.
TRIGGER 02 simply runs over and over again as long as the bolean variable, (_is Firing) is equal to True.
TRIGGER 03, is triggered with a <Key Released> event. It sets a bolean variable, (_is Firing) equal to False.
I.E as long as the triggering player holds down a specific key his/her unit is continously ordered to use the Fire Ball ability, which in the trigger is presented by the array variable Weapon Used [X].
______________
TRIGGER 01 - _is Firing = True ______________
Events
UI - Player Any Player clicks Left mouse button Down.
Local Variables
Conditions
Actions
Variable - Set _is Firing[(Triggering player)] = true
Trigger - Run _is Firing True Loop (Check Conditions, Don't Wait until it finishes) _______________
TRIGGER 02 - Fire Loop _______________
Events
Local Variables
Conditions
Actions
Unit - Order Player Unit[(Triggering player)] to (Weapon Used[1] targeting ((Position of Player Unit[(Triggering player)]) offset by 3.0 towards (Facing of Player Unit[(Triggering player)]) degrees)) (Replace Existing Orders)
General - Wait 0.33 Game Time seconds
Trigger - Run _is Firing True Loop (Check Conditions, Wait until it finishes) _______________
TRIGGER 03 - _is Firing = False _______________
Events
UI - Player Any Player clicks Left mouse button Up.
Local Variables
Conditions
Actions
Variable - Set _is Firing[(Triggering player)] = false
_______________
//
My problem is that when you hold down the key for "to long" or spams that button rapidly you get these error messages in the Debugger:
<This is just a bit of the messages>
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringFalse_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrue_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
<And following>
When so happens other Key Pressed/Released Events gets totally forked up as well as some other triggers that doesn't have any Key Pressed/Released events.
MY QUESTION IS: Why does this happen and what is the best way to come around this?
Events
Local Variables
Conditions
Actions
Unit - Order Player Unit[(Triggering player)] to (Weapon Used[1] targeting ((Position of Player Unit[(Triggering player)]) offset by 3.0 towards (Facing of Player Unit[(Triggering player)]) degrees)) (Replace Existing Orders)
General - Wait 0.33 Game Time seconds
Trigger - Run _is Firing True Loop (Check Conditions, Wait until it finishes)
You didn't put the condition in, was that a mistake copying it here or is it missing in your trigger?
With out the condition, every time you press the button a whole new set of loops is created: meaning you'll get more and more loops until it starts complaining.
The other possibility is if you release the key and press it again during TRIGGER 02's wait 0.33, it'll continue the original while creating a new one.
Mind telling us how you did it? Ever since I played the Lost Viking minigame in the campaign I've wanted to try and make one myself, but I get the "too many threads" problem with my movement triggers.
That and I'm not sure how to make working projectiles.
Hi im a Wc3 scripter fellow who then switched to Sc2. and if you ever made maps in Wc3 editor you probably know that there's a thing called "leak" it's important to remember that sc2 engien is much stronger and it's harder for it to leak but it still can. There are a bunch of ways your map can leak like stacking variables or spam spawning creeps without removing them. soooo avoid that also using key events creates extrem net trafic and i have only found one way to make it work without having a crazy delay in your map. You have to create a chase switch and test all the keys you're supose to use in your map that will reduce the lag(Y)
how a chase switch works
basicly you test for a special thing... like button is down "button"
chase1 key(1)
set key(1)=true
chase2 key(2)
set key(2)=true
And last the Defult which trigger if none of these buttons are down Good luck. HF
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
After browsing the forums for about an hour without finding a thread with this subject I decided to make a new thread about it - firing projectiles with No Target.
By that I mean that the projectile is shot independent from any target, just like a real-life rocket launcher for example. My problem is that I have no idea how to do this, I remember some did that in Warcraft 3 Edit with just custom script but at that time I was not much of a scripter so I didn't understand it. So I am asking; is there any thread about it and if not do anyone of you know a way around this?
I am in dire need of this function and I am faithfully yours if you solve it.
Thanks in advance, Ice_bane @ B.net EU
@Ice_bane: Go
try to set target to target point, not target unit.
@Ice_bane: Go
What do you mean? Do you mean a rocket that when fired, will explode on the first target it crosses paths, or a rocket you can target the ground with instead of a unit?
@gemGreg:
@Vexal:
Sorry if I didn't explain thoroughly. What I want is a projectile, for example a rocket, that can be fired without a target. Like just firing through the air so that it will continue flying through the air untill it hits something.
I found this, here you go
http://forums.sc2mapster.com/development/map-development/4399-make-a-fireball-ability/
@Ice_bane: Go
There are a couple ways. Te easiest I think is to give your projectile a periodic buff that has a search effect. When it finds something, kill te projectile.
I think you can also use site movers.
@zeldarules28:
I LOVE YOU! <3
@Vexal:
Alright I'll keep that in mind, thanks! :)
Hey how do you import spells like that, or am I to reacreate every single bit of it myself?
Hmm, I need some further help with this;
What I want is that as long as a player presses a key, (using key events), the unit should be ordered to use the ability which in this case is "Fire Ball" - if I'm using the ability that is in the thread zeldarules28 linked me; ( http:forums.sc2mapster.com/development/map-development/4399-make-a-fireball-ability/).
Currently I'm using this method;
TRIGGER 01, is triggered with a <Key Pressed> event. It sets a bolean variable, (_is Firing) equal to True and also it runs TRIGGER 02.
TRIGGER 02 simply runs over and over again as long as the bolean variable, (_is Firing) is equal to True.
TRIGGER 03, is triggered with a <Key Released> event. It sets a bolean variable, (_is Firing) equal to False.
I.E as long as the triggering player holds down a specific key his/her unit is continously ordered to use the Fire Ball ability, which in the trigger is presented by the array variable Weapon Used [X].
______________
TRIGGER 01 - _is Firing = True
______________
Events
UI - Player Any Player clicks Left mouse button Down.
Local Variables
Conditions
Actions
Variable - Set _is Firing[(Triggering player)] = true
Trigger - Run _is Firing True Loop (Check Conditions, Don't Wait until it finishes)
_______________
TRIGGER 02 - Fire Loop
_______________
Events
Local Variables
Conditions
Actions
Unit - Order Player Unit[(Triggering player)] to (Weapon Used[1] targeting ((Position of Player Unit[(Triggering player)]) offset by 3.0 towards (Facing of Player Unit[(Triggering player)]) degrees)) (Replace Existing Orders)
General - Wait 0.33 Game Time seconds
Trigger - Run _is Firing True Loop (Check Conditions, Wait until it finishes)
_______________
TRIGGER 03 - _is Firing = False
_______________
Events
UI - Player Any Player clicks Left mouse button Up.
Local Variables
Conditions
Actions
Variable - Set _is Firing[(Triggering player)] = false
_______________
//
My problem is that when you hold down the key for "to long" or spams that button rapidly you get these error messages in the Debugger:
<This is just a bit of the messages>
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringFalse_Func': Too many threads
00:00:21.44 Trigger Error in 'gtisFiringTrue_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
00:00:21.50 Trigger Error in 'gtisFiringTrueLoop_Func': Too many threads
<And following>
When so happens other Key Pressed/Released Events gets totally forked up as well as some other triggers that doesn't have any Key Pressed/Released events.
MY QUESTION IS: Why does this happen and what is the best way to come around this?
Thanks in advance, Icebane @ Battle.net EU
bump
You didn't put the condition in, was that a mistake copying it here or is it missing in your trigger?
With out the condition, every time you press the button a whole new set of loops is created: meaning you'll get more and more loops until it starts complaining.
The other possibility is if you release the key and press it again during TRIGGER 02's wait 0.33, it'll continue the original while creating a new one.
@Grogian: Go
Thanks for looking through my wall of text.
I will look through that, I'll be back! :)
@Grogian: Go
YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSS I SOLVED IT! 8D
Not entirely thanks to you but you made me think in other ways. Thanks a lot man! :D <3
Mind telling us how you did it? Ever since I played the Lost Viking minigame in the campaign I've wanted to try and make one myself, but I get the "too many threads" problem with my movement triggers.
That and I'm not sure how to make working projectiles.
Hi im a Wc3 scripter fellow who then switched to Sc2. and if you ever made maps in Wc3 editor you probably know that there's a thing called "leak" it's important to remember that sc2 engien is much stronger and it's harder for it to leak but it still can. There are a bunch of ways your map can leak like stacking variables or spam spawning creeps without removing them. soooo avoid that also using key events creates extrem net trafic and i have only found one way to make it work without having a crazy delay in your map. You have to create a chase switch and test all the keys you're supose to use in your map that will reduce the lag(Y)
how a chase switch works
basicly you test for a special thing... like button is down "button"
chase1 key(1) set key(1)=true
chase2 key(2) set key(2)=true
And last the Defult which trigger if none of these buttons are down Good luck. HF