• 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.

Problems with toss (yes I did use search)

Status
Not open for further replies.
Level 2
Joined
Apr 20, 2006
Messages
22
Basicly I'm making a toss spell, which takes a target (allied unit) and tosses it forward. I was thinking of using the formula: Height = 400-x², so my target would reach a height of 400 (variable x goes from -20 to 20) So what I did so far was this:

Code:
Beetle KingToss
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Toss 
    Actions
        Set BeetleKingTossDirection = (Angle from (Position of (Casting unit)) to (Position of (Target unit of ability being cast)))
        Set BeetleKingTossedUnit = (Target unit of ability being cast)
        Set BeetleKingTossDistance = (Random real number between 500.00 and 700.00)
        Set BeetleKingTossVariableX = -20.00
        Unit - Add Crow Form to BeetleKingTossedUnit
        Trigger - Turn on Beetle KingTossing <gen>
        Wait 2.00 seconds
        Trigger - Turn off Beetle KingTossing <gen>
        Unit - Remove Crow Form from BeetleKingTossedUnit
        Set BeetleKingTossDirection = 0.00
        Set BeetleKingTossedUnit = No unit
        Set BeetleKingTossDistance = 0.00
        Set BeetleKingTossVariableX = 0.00

BeetleKingTossVariableX is the x variable in my formula op there. The trigger turned on for 2 seconds is this:

Code:
Beetle KingTossing
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set BeetleKingTossVariableX = (BeetleKingTossVariableX + 0.20)
        Unit - Move BeetleKingTossedUnit instantly to ((Position of BeetleKingTossedUnit) offset by (BeetleKingTossDistance / 200.00) towards BeetleKingTossDirection degrees)
        Animation - Change BeetleKingTossedUnit flying height to (400.00 - (Power(BeetleKingTossVariableX, 2.00))) at 2.00

Ok well I hope it's a bit clear.. I've ran into a problem first that it didn't want to get airborn, so I searched and found that I should use the crow form ability, which I did. But now all it does is the normal move towards it's location. For the rest I found a lot of topics requestion help with toss.. but the response was that they should use search, which doesn't help me at all :S . I hope someone can help me, thanks in advance.

Edit: I also have no clue what that last number does in the animation - set flying height. The rate, I guess the problem would be there.. but I just randomly set it to 2, and it did the same as when it was set to 1; which is nothing.
 
Status
Not open for further replies.
Top