Hi there. A while ago I created a unit that shoots 18 missiles in a "random" direction. By random I mean, there are 3 persistent files that have a lot of offsets in them. It works fine but it feels messy. Lots of predefined points isn't really random lol! I feel the way I made it is slightly over complicated and could be made much better. Could you think of a better method than what I already have now? I want the missiles to be more "random" in the direction they travel. I could add more offsets in the persistent effects but I would like something a little better than that.
Yes you can make it better and "more random" with triggers MUCH easier. With data you can use beams(snipe beam or warhound beam) and random point in a sphere SOp for visual, and gameplay-wise just deal damage to all units in a cone. You can also use "like-a-boss" approach and create Actor Movers for Bullet Actors and then attach snipe beams to this bullets without having an actual missile unit.
Thanks for the reply. I don't really want to do it with triggers, since I would have no clue what I'm doing. I never thought of beams, I'll give that a go tomorrow. I tried the sphere SOp at first, visually it looked much better but I wanted each missile to deal damage if it hit the unit. Is the actor movers way similar to the colossus.
I've never used actor movers before, so I'll give that a go as well. No doubt I'll spend more time looking for tutorials....
I've gone back to the "Random Point (Sphere) " actor method. Visually it looks great, you see the beams go off in a random direction and the impact effect appears at the point the beam disappears. But I'm having the problem I had before. The target unit receives the damage from all the beams, even if only 1 or 2 hit it. How would I go about changing this so when a beam hits a unit, it deals damage?
Yes you can make it better and "more random" with triggers MUCH easier. With data you can use beams(snipe beam or warhound beam) and random point in a sphere SOp for visual, and gameplay-wise just deal damage to all units in a cone. You can also use "like-a-boss" approach and create Actor Movers for Bullet Actors and then attach snipe beams to this bullets without having an actual missile unit.
can u show how to get this done?
fine cone-like shotgun looks like alot of pain =(
If this can hit air units it is likely going to be a real pain to do. The biggest problem is the 3D missile collision detection (so that bolts under units do not damage them).
After you have determined how to do appropriate collision detection of the bolts you need to fire them. This is also a big pain to do since you do not want them fired completely randomly in a cone as that can have very ugly results (worst case is all bolts in one direction which is at an extreme away from where aiming). The randomness alone will hamper the reliability and usability of it. To get around this you need to give each projectile a domain and then spread those out in a fixed way so that domains overlap but note entirely. This means that the bolts will still be fired in random directions but you always get a spread (no extreme cases where every bolt fires near the same direction).
The 3D firing part would require 3D trigonometric mathematics. By defining each bolt into a domain of angles you should then be able to project it onto a sphere and then use that as the base of where to fire the bolts.
Of course if you only want this to work in 2D things become much simpler. In both cases I would recommend triggers as the mathematics needed is likely beyond what data provides.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi there. A while ago I created a unit that shoots 18 missiles in a "random" direction. By random I mean, there are 3 persistent files that have a lot of offsets in them. It works fine but it feels messy. Lots of predefined points isn't really random lol! I feel the way I made it is slightly over complicated and could be made much better. Could you think of a better method than what I already have now? I want the missiles to be more "random" in the direction they travel. I could add more offsets in the persistent effects but I would like something a little better than that.
I will attach a demonstration map
Thanks
Yes you can make it better and "more random" with triggers MUCH easier. With data you can use beams(snipe beam or warhound beam) and random point in a sphere SOp for visual, and gameplay-wise just deal damage to all units in a cone. You can also use "like-a-boss" approach and create Actor Movers for Bullet Actors and then attach snipe beams to this bullets without having an actual missile unit.
Thanks for the reply. I don't really want to do it with triggers, since I would have no clue what I'm doing. I never thought of beams, I'll give that a go tomorrow. I tried the sphere SOp at first, visually it looked much better but I wanted each missile to deal damage if it hit the unit. Is the actor movers way similar to the colossus.
I've never used actor movers before, so I'll give that a go as well. No doubt I'll spend more time looking for tutorials....
Thanks!
I've gone back to the "Random Point (Sphere) " actor method. Visually it looks great, you see the beams go off in a random direction and the impact effect appears at the point the beam disappears. But I'm having the problem I had before. The target unit receives the damage from all the beams, even if only 1 or 2 hit it. How would I go about changing this so when a beam hits a unit, it deals damage?
Thanks
Then you are back to the archangel method which is a trigger/data hybrid.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
can u show how to get this done?
fine cone-like shotgun looks like alot of pain =(
If this can hit air units it is likely going to be a real pain to do. The biggest problem is the 3D missile collision detection (so that bolts under units do not damage them).
After you have determined how to do appropriate collision detection of the bolts you need to fire them. This is also a big pain to do since you do not want them fired completely randomly in a cone as that can have very ugly results (worst case is all bolts in one direction which is at an extreme away from where aiming). The randomness alone will hamper the reliability and usability of it. To get around this you need to give each projectile a domain and then spread those out in a fixed way so that domains overlap but note entirely. This means that the bolts will still be fired in random directions but you always get a spread (no extreme cases where every bolt fires near the same direction).
The 3D firing part would require 3D trigonometric mathematics. By defining each bolt into a domain of angles you should then be able to project it onto a sphere and then use that as the base of where to fire the bolts.
Of course if you only want this to work in 2D things become much simpler. In both cases I would recommend triggers as the mathematics needed is likely beyond what data provides.