• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Bullet not spawning correctly

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
I have a really annoying problem here... i used x and y intercepts and some math to calculate a bullets movement, anyhow, the spawning place of the bullet can sometimes be in the casters x and y intercept location and sometimes it spawns to the left or even right (just a bit) of the caster and goes to the angle from there. Can anyone tell me why? the bullet does have locust (collision off) and spawns in the casters x and y intercept.
Here is the trigger:
  • ShootingStart
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sniper Shot
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local real x = GetUnitX(u)
      • Custom script: local real y = GetUnitY(u)
      • Custom script: local location t = GetSpellTargetLoc()
      • Custom script: local real distX = GetLocationX(t) - x
      • Custom script: local real distY = GetLocationY(t) - y
      • Custom script: local real dist = SquareRoot(distX*distX + distY*distY)
      • Custom script: local real dx = distX/dist*udg_BulletSpeed*udg_Time
      • Custom script: local real dy = distY/dist*udg_BulletSpeed*udg_Time
      • Custom script: local real angle = bj_RADTODEG*Atan2(distY, distX)
      • Custom script: call RemoveLocation(t)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i Less than 8192
        • Then - Actions
          • Set i = (i + 1)
        • Else - Actions
          • Set i = 0
          • Set i = (i + 1)
      • Custom script: set udg_Bullet[udg_i] = CreateUnit(GetOwningPlayer(u), 'e000', x, y, angle)
      • Custom script: call AddFlying(udg_Bullet[udg_i])
      • Custom script: set udg_BulletMoveX[udg_i] = dx
      • Custom script: set udg_BulletMoveY[udg_i] = dy
      • Unit - Set the custom value of Bullet[i] to i
      • Set Bullet_Dist[i] = Bullet_Max_Dist
      • Unit Group - Add Bullet[i] to BulletGroup
      • Trigger - Turn on MovingBullet <gen>
Object Values for dummy
cast backswing: 0
blend time: 0
maximum pitch angle: 0
maximum roll angle: 0
projectile impact z: 70
projectile launch z: 70
propulsion window degrees: 60
ms: 1
turnrate: 3 (max)
collision: 0 (also added locust)
movement type: foot
+rep
 
Level 10
Joined
Sep 21, 2007
Messages
517
Element of water, i shall try it, and if it works im in love with you roflmao, Thanks a bunch dude... really thanks a fucking bunch, il try it now lol +rep checking it out
EDIT--- THANKS A BUNCH ELEMENT, I WILL PUT YOU IN CREDITS IN MAP FOR HELPING OUT IN BUGS OMG NOW IT LOOKS GREAT IN ABSOLUTELY EVERY ASPECT YAH00!... lol thanks bro ;)
-----------------------------------
thank god for natives huh? >> setting their coords without taking collision into consideration... so good ^^
 
Status
Not open for further replies.
Top