PixelProjectiles v2.E

by Ease
An update of Shadowdarke's PixelProjectiles
ID:1197542
 
An attempted alteration of Shadowdarke's PixelProjectiles, getting it to work with the new pixel movement.

Shadowdarke's library is amazing, and recommend to almost all beginners considering projectiles. However, it is outdated (now nearly 8 years old!), and can't cope with Pixel Movement.

This library has been built using the original source from Shadowdarke's library, and includes his original demo.

FirePixelProjectile(owner, destination, proj_type, weapon)
ARGS:
  • owner (atom) - The atom that launched the projectile, also
    the start point of its trajectory.
  • destination - destination may be an angle in degrees, or
    an atom that the projectile is launched
    towards.
  • proj_type - The type of projectile. This should be a
    type of /obj/sd_px_projectile.
    DEFAULT: proj_type = /obj/sd_px_projectile
  • weapon(obj) - The weapon that fired the projectile. Not
    necessary but could be useful to track.



Known Bugs:
  • The Instant Projectile occasionally misses. - Fixed
  • The conversion of owner.dir to an angular direction is really ugly. I'd love to find an alternate/better method of doing this.
Hey Ease, the zip just has the RSC file in it. How did you package it? The easiest way is to go into Dream Maker, Build > Package Files > World source files.
Haha, awkward. My bad; skipped through that a little too fast! Re-uploaded the right way. Sorry for the inconvenience.
It's never been a particle engine. It's bullets being fired and hitting things.

There's nothing complicated about vectors, either. The simplest "particle" you can have is one that moves along a straight line (which is what these pixel projectiles are doing), minus the collision detection.
//  This is a vector pointing southeast.
var vel_x = 1
var vel_y = -1

spawn for()
step_x += vel_x
step_y += vel_y
sleep world.tick_lag

What you're talking about is a lot more complicated than addition and is very unnecessary.
Again, this isn't a particle engine. It's a library for bullets that are fired and hit things.
It uses DM, so it's actually not better to have a million objects sitting around to catch every possible particle, instead of one object per particle.
Multiverse7 - go make your library, and if it works come back with it and we'll have a look at profiling the two. Until then, please stop polluting this hub entry.
I pseudo-moved this conversation to a New Topic in Design Philosophy. I didn't think I would get this many replies. I wouldn't want you to not get any feedback on your modified library. The rest of these posts can be removed now.
Wow, Thx a lot, for saving me the trouble of updating my projectile system. I was wondering what was wrong with my projectiles for awhile now. I will definitely be giving you credit along with Shadowdarke.
Glad to be of service Fat Albert :) If you have -any- issues with it at all, please don't hesitate to tell me.
So I'm having a few issues with the library.. One is at certain angles, the projectile seems to miss or skip over my target. Second, a friend pointed out to me that the projectiles seems "Jumpy", like not smooth or seamless which took me a good minute to agree with him cause I've always like this projectile system, but I definitely see what he's talking about now. I going to be updating my projectile system very soon so it can look cleaner, I was wondering if you experienced similar issues or had any advice to fix these problems?
Okay so I raised the bound height & width of the projectiles which seemed to fix the skipping problem. Now that I think about it I think shadow darkes pixel projectile system always jumped frames. Does anyone have any ideas on how to make the movement more smooth?