ID:1197391
 
Problem description:

I'm trying to add projectiles to my project, and at the moment I'm looking at Shadowdarke's PixelProjectiles. It's great, fantastic even, but it's ancient and doesn't work with the new BYOND pixel movement.

If the shooter is dead-square on a tile (bound_x and _y are 0) then it works as expected, but if either are non-zero then the fired projectiles hit the shooter. I suspect this is because the shooter is technically in the adjacent tiles as well, but despite hours of looking through Shadowdarke's code I can't get to the bottom of it.

I have messaged him, but the library is ANCIENT and he hasn't posted on BYOND in over 2 years either.

Any help would be really appreciated!

It might be better for someone to do a re-write of this, given you've got object bounds, step size etc now.
I agree entirely, though I'm afraid I'm not of the caliber required =(
Perhaps you could describe for us what you want the projectiles to do, how you'd like them to move etc. Just gives me a better idea of how you'd like to use a library like this.
I'd like them to be of any size between 32x32 and 1x1, travel from a Shooter in a direction; either the direction they're facing, a given numerical angle, or towards a clicked target/turf, maybe even home towards a moveable atom.

They should be able to travel at different speeds, and up to different ranges.

Perhaps a Spread function (like a shotgun) would be good too, as it was in the original library.

Most importantly (in my opinion) they need to work on a pixel-by-pixel/bounds level. Entering the same turf as a mob should not necessarily always equal a hit, especially if the turf is 32x32 and the mob is smaller. I assume some use of Cross() is required.


This sounded super needy, but I don't mean it to. I'm going to attempt to make a system myself, but you asked me to describe what I'm aiming for, so I did, and I suspect you'll achieve a much much better result in significantly less time. I've put anything that was in Shadowdarke's library in bold.

Thank you for your interest in this matter, one that I deem quite important.

P.s., It seems that you reply to 90% of the posts I make on here Stephen001! Haha.
That's alright. I'll perhaps have a crack at it this evening (I'm on UTC time), after a few home repair matters.
In response to Stephen001
Stephen001 wrote:
That's alright. I'll perhaps have a crack at it this evening (I'm on UTC time), after a few home repair matters.

I'll keep an eye out for this. It's something I've been meaning to work on but it hasn't taken priority yet sadly.
I've had a go at it. For the most part it works, but there are some bugs.

http://www.byond.com/developer/Ease/PixelProjectilesv2.E

Bugs:
1. If "slow" projectile is chosen in the demo, and the player stands exactly halfway between two tiles and fires to the left it bugs out and goes to the right in a stepped manner.
2. "Instant" projectile does not work at all.

Niggles:
1. I -hate- how I've done the "shooter.dir -> number" conversion, and know it could be done better with bit flags, but can't work it out.
2. Not done anything regarding the Spread() function yet.

~Ease~
I've updated the library a bit (been babysitting the last 12 hours at the same time, so programming has been slow), and I've updated the Hub Entry.

Bug #1 is completely fixed now.
Bug #2 is fixed. Instant now works, though seems a little glitchy.

Niggle #2 has been solved too, and it works perfectly.