Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

weapon->Dir

3 replies · 1,499 views · Started 25 May 2008

....A script I'm writing spawns an LWeapon, an arrow. But the arrow is always spawned pointing upwards, and using Weapon->Dir doesn't do anything...I have the dead state set to -1, if that makes any difference. I want the game engine to handle all the movement and such.

😞 Help!

(On a side note, the comments for ->Dir state "Used by certain weapon types to determine movement, shield deflection and such." ....is there a list of these "certain weapon types" anywhere?)

'Pointing' upwards?

Do you mean that it moves upwards, or that its sprite is facing the wrong way?

I just realized I might be an idiot.....(I'm always the last to know!) :tongue:

The entire arrow sprite moves in the proper direction, but the tip of the arrow always points up (i.e., the sprite tile is facing the wrong way), so it looks a little lame when, say, the projectile is moving in a westernly direction but the tip of the projectile is pointing north.

....but now that you've asked the question you've asked, I bet I need to use weapon->Flip to "align" the arrow with its direction of travel.

*EDIT*
Got it, with the added "undocumented" weapon->Flip values of:

  • 4 = Rotate clockwise 90 degrees
  • 7 = Rotate counter-clockwise 90 degrees

These flip values seem to apply generally to Combos as well (e.g., pressing "R" in the Combo Editor rotates the combos clockwise), though I don't recall seeing these values in any of the scripting documentation. I'll update the Wiki....