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

[Trigger] Charge

Status
Not open for further replies.
Level 10
Joined
Jan 19, 2010
Messages
393
Hello i have big problem... i am working on smething like charge i have script but its not working how i want.... i think its because arithmetic or hashtables
i want from script:
-distance from caster to target * 0.04(for get distance to move caster to target)
-block of unit to do anything when is casting
-angle from caster to target
-make target unmovable when is spell casted
-throwing out target from caster 1/3 of start distance of charge(not madet because i tested it before when i finded those bugs....)

Thx to all:grin:
http://www.hiveworkshop.com/forums/pastebin_data/gvim85/_files/Charge.w3x
 
Level 4
Joined
Jan 27, 2010
Messages
133
(Target unit of ability being cast) is bad:

  • Hashtable - Save Angle as 0 of (Key (Target unit of ability being cast)) in HashTable
Because the same unit can potentially be target of two charges at the same time (causing the spell not to be MUI). You should store the HashTable data by (Triggering Unit) instead (that is, the unit which is doing the charge). Ofc, you have to modify your group loop not to contain targets, but casters instead.

On reals and integers:

Reals = { ... ,-0.001, 0, 0.001, 0.002, ... ,1.00, 1.001 }
Integers = { ... ,-2, -1, 0, 1, 2, ... }

When you do stuff like (4/100), it will become 0, because 0.04 is not an integer. You'll want to use real instead of integer.

EDIT: Try this and post an updated map if you still can't work it out.
 
Last edited:
Status
Not open for further replies.
Top