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

(Position of (Triggering unit)) NOT really Position of Triggering Unit

Status
Not open for further replies.
Level 16
Joined
Oct 12, 2008
Messages
1,570
Hi guys,

I am working on a spell, in which you summon units at the location of the caster
This is what is going wrong:
I set a variable to:
  • Set CA_Point = (Position of (Triggering Unit))
But when i cast the spell,, it summons them at a whole other location,,
i tried to do something with (X,Y) offset,, but it didnt work!

Can anyone help?
Yixx,,
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
ok,, and ill try to add a picture
wait plz :)

  • CA Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Call for Arms
    • Actions
      • -------- --------
      • Set CA_TotalDistance = 600.00
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CA_Integer[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on CA Move <gen>
        • Else - Actions
      • Set CA_Integer[1] = (CA_Integer[1] + 1)
      • Set CA_Integer[2] = (CA_Integer[2] + 1)
      • Set CA_Cast[CA_Integer[2]] = (Triggering unit)
      • Set CA_Damage[CA_Integer[2]] = ((Real((Level of Call for Arms for (Triggering unit)))) / 2.00)
      • Set CA_TheBoys[CA_Integer[2]] = (10 + (5 x ((Level of Call for Arms for (Triggering unit)) - 1)))
      • Set CA_Point[CA_Integer[2]] = (Position of (Casting unit))
      • For each (Integer CA_Integer[4]) from 1 to CA_TheBoys[CA_Integer[2]], do (Actions)
        • Loop - Actions
          • Unit - Create 1 Call for Arms for (Owner of (Triggering unit)) at CA_Point[CA_Integer[2]] facing CA_Facing degrees
          • Unit Group - Add (Last created unit) to CA_Group[CA_Integer[2]]
          • Set CA_Loc = (CA_Point[CA_Integer[2]] offset by 200.00 towards CA_Facing degrees)
          • Unit - Order (Last created unit) to Move To CA_Loc
          • Set CA_Facing = (CA_Facing + (360.00 / (Real(CA_TheBoys[CA_Integer[2]]))))
          • Custom script: call RemoveLocation(udg_CA_Loc)
      • Set CA_Facing = 0.00
      • Set CA_Tel[CA_Integer[2]] = 1


This is only one part of it,, but this IS the part where it goes wrong
 

Attachments

  • CfA Shot.tga
    1.8 MB · Views: 71
  • CfA Shot2.tga
    1.8 MB · Views: 53
Level 7
Joined
Jul 20, 2008
Messages
377
Okay. I was just checking - your screenshots made it look like the footmen were spawning next to the paladin, as if there was a collision problem.

Oh, try changing your event to "Unit finishes casting an ability" and tell me what happens.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
Okay. I was just checking - your screenshots made it look like the footmen were spawning next to the paladin, as if there was a collision problem.

Oh, try changing your event to "Unit finishes casting an ability" and tell me what happens.

You never use that for a custom spell, besides the trigger is activated so bad suggestion.
EDIT: In your loop I saw: (Integer CA_Integer[4]) wtf? You never use it in your loop.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
They spawn a little closer,,
but the strange thing is,, they go in a perfect circel EXACTLY around the caster, not around the spawn point =S
But the point where around they should go, and the spawn point are the same!!
 
Level 7
Joined
Jul 20, 2008
Messages
377
Well, we're making some progress now. Would you make a little debug trigger that just spawns one footman at the position of the paladin and see what happens?
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
The exact same problem,,
i tried begins casting,, also the same
Then i tried casting at different points,,
And i found out that is makes a difference (only a little bit! But it is difference)
 
Level 7
Joined
Jul 20, 2008
Messages
377
Okay, I fixed it. Just give your footies the NONE movement type. Also, it's slightly offset, but that's more of a WC3 problem. Just spawn the footies at slight offsets to fix it.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Give it a shot. I forgot what each movement type does (except none, foot, and fly). :p

EDIT: Your issue was that even though the footies were locusted, that only applies to them moving through other units, not being spawned on them. Movement type is what it looks at when it spawns units, I think.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Give it a shot. I forgot what each movement type does (except none, foot, and fly). :p

EDIT: Your issue was that even though the footies were locusted, that only applies to them moving through other units, not being spawned on them. Movement type is what it looks at when it spawns units, I think.

Ok,, learned something today ^^
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
It's because warcraft is retarded.
When you set a unit's collision to zero, other units can go through him but he cannot go through other units, which is why if you create him on another unit, collisions still occur and he is moved according to them.
That's why you need your units to fly (or hover or whatever) too, BEFORE you create them (which means you must set that in the world editor).
 
Status
Not open for further replies.
Top