View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,992

Violet CLM has disabled reputation

Jan 11, 2016, 01:38 PM
Violet CLM is offline
Reply With Quote
Yes. I have no idea how you would want that to look, but whatever you have in mind is almost certainly possible.

EDIT:
Quote:
Originally Posted by Slaz View Post
Sorry for being so terrible at programming, but is there some way of making a certain gun your default one?

Do I need to check if BLASTER is WEAPON::CURRENT on jjPLAYER and then change it on levelbegin?
I forgot about this question, sorry. The answer is yes and no... yes, there are ways to achieve this effect, but it's not a simple one-time setting like it intuitively feels it should be. Instead you're probably going to need to check the player every tick (onPlayer, presumably) and compare/set jjPLAYER::currWeapon based on whatever you think the right criteria are.

And WEAPON::CURRENT looks like it's what you want, but unfortunately it's not. It's just some random magic number like -36 or 173 or something which certain functions understand to mean "ignore this number and look at jjPLAYER::currWeapon instead." In fact, I'm not sure I'd endorse using it at all—it works in the cases that it works, but that requires you to keep track of which cases those are, and that's a quirk of the API instead of a quirk of JJ2.
__________________

Last edited by Violet CLM; Jan 11, 2016 at 11:04 PM.