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

Spell not working

Status
Not open for further replies.
Level 8
Joined
Mar 12, 2008
Messages
437
  • For each (Integer A) from 1 to (175 + (25 x (Level of Acceleration for Contestant[1]))), do (Actions)
    • Loop - Actions
      • Set P[1] = (Position of Contestant[1])
      • Set P[2] = (P[1] offset by 2.00 towards (Facing of Contestant[1]) degrees)
      • Unit - Move Contestant[1] instantly to P[2]
      • Custom script: call RemoveLocation(udg_P[1])
      • Custom script: call RemoveLocation(udg_P[2])
      • Wait 0.01 game-time seconds
This trigger is supposed to make the unit slide forwards for a moment. The problem is that it's sliding a lot slower than it should. It seem like the wait is one second instead of a hundredth of a such. So, what I wanted it to do was to cause the unit to slide 400 units at level 1 over 4 seconds, 450 units over 4,5 seconds at level 2, etc. What is the problem?

I tried to make the Integer A value lower while making the P[2] value higher.

P[1] and P[2] are point variables, and Contestant[1] is the unit casting the ability. Acceleration is the name of the spell.
 
Level 8
Joined
Mar 12, 2008
Messages
437
It's almost good now. The triggers look like this:
  • Acceleration
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Acceleration) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set P[1] = (Position of (Picked unit))
          • Set P[2] = (P[1] offset by 4.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to P[2]
          • Custom script: call RemoveLocation(udg_P[1])
          • Custom script: call RemoveLocation(udg_P[2])
  • Acceleration
    • Events
      • Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Acceleration
    • Actions
      • Unit - Pause (Casting unit)
      • Set P[5] = (Position of (Casting unit))
      • Unit - Create 1 Dummy for (Owner of (Casting unit)) at P[5] facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Acceleration Buff Placer to (Last created unit)
      • Unit - Set level of Acceleration Buff Placer for (Last created unit) to (Level of Acceleration for Contestant[(Player number of (Owner of (Last created unit)))])
      • Unit - Order (Last created unit) to Orc Shaman - Lightning Shield Contestant[(Player number of (Owner of (Last created unit)))]
      • Unit - Pause Contestant[(Player number of (Owner of (Last created unit)))]
      • Wait until ((Contestant[(Player number of (Owner of (Last created unit)))] has buff Acceleration) Equal to False), checking every 0.10 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is paused) Equal to True) and (((Matching unit) has buff Acceleration) Equal to False))) and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
The problem is, the ability is only castable a couple of times, after which you just can't cast it anymore.

P[5] is a temporary location, Contestant[x] is a variable (every player has one unit called "Contestant" which is stored into this variable).
Acceleration Buff Placer places the "Acceleration" buff onto the Contestant. It's based off Lightning Shield. The Acceleration ability itself is based off Channel.
 
Level 7
Joined
Oct 14, 2008
Messages
340
The problem is, the ability is only castable a couple of times, after which you just can't cast it anymore.

P[5] is a temporary location, Contestant[x] is a variable (every player has one unit called "Contestant" which is stored into this variable).
Acceleration Buff Placer places the "Acceleration" buff onto the Contestant. It's based off Lightning Shield. The Acceleration ability itself is based off Channel.

Strange, what do you mean it's only castable a couple times, what happens after the first couple casts?

Oh, change:
  • Acceleration
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Acceleration) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set P[1] = (Position of (Picked unit))
          • Set P[2] = (P[1] offset by 4.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to P[2]
          • Custom script: call RemoveLocation(udg_P[1])
          • Custom script: call RemoveLocation(udg_P[2])
to:
  • Acceleration
    • Events1
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Acceleration) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set P[1] = (Position of (Picked unit))
          • Set P[2] = (P[1] offset by 12.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to P[2]
          • Custom script: call RemoveLocation(udg_P[1])
          • Custom script: call RemoveLocation(udg_P[2])
And if and when this starts working, this spell will be nowhere near MUI. :x
 
Status
Not open for further replies.
Top