Dummy Missiles

keychup

Active Member
Reaction score
34
I am using dummy units as missiles so that in case another unit fires a missile it will be possible to deflect it.

Now I have an ability which fires 16 missiles at once.

On my current method I add all missiles to a unit group the moment they are created then i move them along their corresponding paths.

All was smooth until I had to implement deflection in the trigger. The deflection actions take place within the trigger that moves the missile.

For this action, I pick all units in the missile group to find each missile and make them move, but in order to find their distance from other missiles i have to find each missile again within the initial "Pick every unit in Missile group".

So you understand that this is making my game jerky whenever two enemy missiles collide.

Suggestions?

EDIT: Who knows how I can hide the missile dummy's HP bar without adding locust? If I find out how I can do this i can check for a deflection condition with only nearby missiles instead of the entire group of missiles.

EDIT: Solved. Set unit's Circle Height to 2048.00 and circle size to 0.00

EDIT: A new problem rose. The dummy units' HP bars appear on the sides of my camera bounds sometimes.

EDIT: I may have solved it. Selection Scale was set to -10. No HP bars so far, and still possible to use the pick every units within range with missiles.
 

keychup

Active Member
Reaction score
34
That actually made things worse. Perhaps it would be better if these missiles can be picked and damaged like a regular unit but i need to know how to completely hide the hp bar without adding locust.
 

keychup

Active Member
Reaction score
34
if i add locust then i cant use "pick units within range" to find other missiles.
 

BlackRose

Forum User
Reaction score
239
If you add Locust to a unit, you will have to resort to picking every unit owned by the player and then checking if they're in range. I would go with adding Locust and just enumerating this way.
 

Imp Midna

Active Member
Reaction score
52
Afaik you can add locust to a unit, hide it, remove locust and unhide it again, so that locust will be gone while no player info / HP bar is shown. Read it somewhere, never tested it though since my projectile systems always failed over bridges :/
 

keychup

Active Member
Reaction score
34
@BlackRose: we've already established that going through every unit wont work because that would increase the number of actions to be done exponentially. You can expect about 36 to 300 missiles to be on the screen at the same time. if i pick 300 missiles then go through each of those 300 missiles to check if they are enemy missiles, then i'd be causing the game to run 9000 times every 0.03 seconds.

@Imp Midna: I should try that.
 

keychup

Active Member
Reaction score
34
If you add Locust to a unit, you will have to resort to picking every unit owned by the player and then checking if they're in range. I would go with adding Locust and just enumerating this way.
Just tried it. Doesn't work.
 

keychup

Active Member
Reaction score
34
I may have solved it. Selection Scale was set to -10. No HP bars so far, and still possible to use the pick every units within range with missiles.
 

BlackRose

Forum User
Reaction score
239
It does work. This works:

Unit Group - Pick every unit in (Units of type Footman) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Position of Blood Mage 0013 <gen>) and (Position of (Picked unit))) Less than or equal to 600.00
Then - Actions
Game - Display to (All players) the text: footman
Else - Actions

But whatever works for you.
 

keychup

Active Member
Reaction score
34
that does not solve the problem of lags: i still have to go through 300 units 300 times. and you are using a preset variable. there shouldn't be any preset units in the finished map. To pick every unit of one type won't solve the problem either. The challenge is to check all sorts of missiles within range. Your suggestion only worsens the problem. But so far I've been getting good results from setting circle size to -10.00 so thanks anyway.
 

BlackRose

Forum User
Reaction score
239
That was merely an example to prove that enumerating in that fashion works. I assumed you had the same unit type for your missile, and that you simply attached the model as a special effect onto it. It simplifies things - having only one unit for all projectiles. This may be of some use to you. Although it might not since you're now content with your method. If so, you can probably disregard everything I've said so far.
 

Marvic June B. Corpuz

You can change this now in User CP.
Reaction score
1
I'm not an expert on the editor, you should use the JASS script for this and it is a little complicated. But the pro's can help you with this.
 

keychup

Active Member
Reaction score
34
>_>
Now that just made me feel insulted. There's nothing complicated about the object editor.
 

Imp Midna

Active Member
Reaction score
52
I could give the general tip to not use the square root when you compare distances, but speaking about 90.000 runs that wont really help you though i guess. Also, the trigger would be stopped quite quick, i'd bet after number 10.000 so it will not even work.
Btw, why dont you just pick every missile around your missile in the given distance and deflect em? I belive the native pick every unit is faster then manually comparing em.
 

keychup

Active Member
Reaction score
34
There
It's full of limitations. You of all people should know that.
The object editor IS the limitation. That's why there is nothing complicated about it. The object editor determines your Triggers. Without it there'd be nothing there.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
My multiboards and terrain have no relation to the Object Editor.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top