SC2Mapster Forums

Development > Data

How to add a random impact point to Weapons?

  • 12 posts
    #1 Sep 13, 2010 at 18:17 UTC - 0 likes

    I want to give a weapon to a unit that creates an effect at a random point near the attack target:

    http://i0.simplest-image-hosting.net/thumbnail/unbenannt17.png
    Black circle is the shooter.
    Red circle the target.
    Red dots are the random points nearby at which the effects will be created.

    I want to use this to create a inaccurate weapon which doesn't necessarily hit the target.
    So if anybody knows how to do this or knows another way to do it I'd be grateful :)

    #2 Sep 13, 2010 at 18:29 UTC - 0 likes

    this is going to be a very very ruff answer, no editor to point out the exact fields, And im sure there is even a better way. But you can make a bunch of effects that set offsets, however, the effect that would be casted, would be the effect type that will pick 1 effect from the list randomly. thus giving it the random effect. Im not sure of the effect name that does this, but it was in one of P's tuts.

    #3 Sep 13, 2010 at 18:34 UTC - 0 likes

    Would the projectile be visible or not ?

    If not, then you create weapon that deals no damage. Detecting the hit. And then creating points around the target. Picking one randomly determined by accuracy chance, and then create hit effect on the ground or if chance will pick target ?

    If there will be projectile. Instead you can create invisible enemies around the enemy. Picking one randomly determined by accuracy chance, and then order unit to attach towards that picked target.

    Could that work ? Dunno if you can do all this. Its how I would do it in Wc3 editor, if possible.

    #4 Sep 13, 2010 at 18:41 UTC - 0 likes

    @Molsterr: Go

    I thought about just using offsets, but then I'd have to create dozens of effects with different offsets each (I think).

    @tigerija: Go

    That would work with triggers, but I'm trying to find a good Data-only solution. So no dummy units. And I don't know how to pick a random point in the data edtior.

    Well, I know there are SiteOps that choose a random offset but I think they're only for actors. And if not I wouldn't know how to use them to cast my effects.

    #5 Sep 13, 2010 at 18:43 UTC - 0 likes

    @s3rius: Go

    You could simply copy the weapon of Queen of Blades and edit the attributes. The weapon name is

    TTychus03 - Queen of Blades - Psi Blast

    Thats how I got the effect that you are looking for. It would probably take 1/5 of the time! :D

    -Misu <3

    Last edited Sep 13, 2010 by iMisu

    http://img577.imageshack.us/img577/9202/mirr.png
    1/12/2013 Misu

    #6 Sep 13, 2010 at 18:50 UTC - 0 likes

    How does these things work in their original weapons ? (think battlecruiser) I always though there's something simple in data editro control that

    Edit: create persistent effect has a check for random offset, might be it

    Last edited Sep 13, 2010 by progammer
    #7 Sep 13, 2010 at 18:58 UTC - 0 likes

    Just to clarify I don't want a missile that simply hits different places on a unit or a building (like most missile weapons do).

    I basically want a gun that can scatter. I fire at a unit or a building and it could very well be that I hit the unit next to it, or a random spot on the ground.

    #8 Sep 13, 2010 at 19:00 UTC - 0 likes

    @s3rius: Go

    Wait what??, S3rius asking for help??. I thought I`d never see this day :p

    Edit: Wouldn`t triggers help with this?.
    Unit casts scatter spell
    Apply damage buff/debuff/behaviour/effect to random target/point at target unit`s location.

    Something like that. Could use regions too, maybe?

    Last edited Sep 13, 2010 by EternalWraith
    #9 Sep 13, 2010 at 19:03 UTC - 0 likes
    Quote from s3rius: Go

    Just to clarify I don't want a missile that simply hits different places on a unit or a building (like most missile weapons do).

    I basically want a gun that can scatter. I fire at a unit or a building and it could very well be that I hit the unit next to it, or a random spot on the ground.

    Still the same, use the random offset from the persistent effect (offset from target point), then link to a search area effect of that random point, search radius and count can depends, then create missile toward that new target of the search, deal damage

    Last edited Sep 13, 2010 by progammer
    #10 Sep 13, 2010 at 19:31 UTC - 0 likes

    @progammer: Go

    Thanks, I didn't know about the Random Offset flag. That makes it easier :D

    @EternalWraith: Go

    Uhm actually I already knew the answer. I just posted the question to test you guys. Only progammer passed. All others will be TERMINATED.

    #11 Sep 13, 2010 at 19:35 UTC - 0 likes
    Quote from s3rius: Go

    @progammer: Go

    Thanks, I didn't know about the Random Offset flag. That makes it easier :D

    @EternalWraith: Go

    Uhm actually I already knew the answer. I just posted the question to test you guys. Only progammer passed. All others will be TERMINATED.

    Hey now, you still have to do the random offset a few times and link it with my method >.< I pass as well!\ =D

    #12 Sep 13, 2010 at 19:43 UTC - 0 likes

    * cheers

  • 12 posts

You must login to post a comment. Don't have an account? Register to get one!