• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Request / Question

Status
Not open for further replies.
Level 3
Joined
Jul 17, 2004
Messages
57
can someone tell me how to restrict items in shot to be bought by units that are not heros (tomes) but have a hero inventorey (vex copycat e.g.) dont tell me use a hero as req. plz, this doesnt work !

The request is about a spell that uses megentic force: a ball fired at a target loc that will attract enemies, dependent on how close they are and when it reaches the target loc, it push everything away, and deals damage, dependent on how colese they are. i know jass and know how to make sw like spells, but i coulnt figure out a fuction to be called with a distance and a dir for pushing/pulling unit.
 
Level 10
Joined
Apr 9, 2004
Messages
502
Here's what you can do for a basic pull-in function that pulls the unit in depending on it's angle and your ball of magnetic energy

Event:

Periodic event: every 0.03 seconds in game time

Conditions: nil

Actions:

Pick every units within X of (unit you use as a dummy to pull unit's in; in this case the magnet ball) matching conditions (make sure they go with ur spell so ur not pulling everything in)

Move picked unit to position of (your pulling unit)

-for a little more of a dragging effect you can use this one instead: move unit to (point with polar ofset) position of unit ofset by S (regulate how fast) or so towards (to pull in) angle between (picked unit) and (pulling in unit) (push back ) angle between (pulling in unit) and (picked unit)

This is the basic pullback-pushback spell (i don't know how it converts but that's how it works)

In your spell, you've already got the ball moving so just make these 2 triggers and set this trigger so when ur unit starts casting it turns on the pull in and when the dummy reaches the point (i always use others units top set up points as once again, i'm not good at Jass) then turn off the pull in and turn on the push out, as well as deal the damage before pushing out. You can keep track of how long the sphere puches out by either storing it as an integer, or you can also make a certain unit group for all the unit's grabbed in and only get it to push those out.

Hope this helps. If anything it will allow you to make sure the angle the unit is relative to it's angle with the magnet ball thing.

BTW in not sure but i think to function you need would be angle between points.
 
Status
Not open for further replies.
Top