...In both CrackDown and BLiGHT, I had this reoccurring problem with weapon-switching, where when the player switched from one weapon to another, the new weapon would pop up, lower down, and then raise back up. This shit seriously plagued me, I couldn't figure out
what I was doing to cause it, and in the case of BLiGHT, I coded this big, elaborate workaround to fix it that probably wound up creating more problems than it solved. And then this morning I decided to change one little bit of my display code from this...
ifvare PWEAPON 1 { // my own variable
setvar RETURN -1
state displaypistol
}
to this
ifvare currentweapon 1 { // a constantly updated variable
setvar RETURN -1
state displaypistol
}
And WHAM, problem instantly fixed. I'm happy, though I am slightly curious as to why it would make a difference. I remember I originally abandoned use of most constantly updated variables like currentweapon because I either couldn't use them in events or the APLAYER actor without getting a warning (it was a long time ago, my memory's kinda sketchy). In any event, I'm probably going to add a little caveat to the DISPLAY/DRAWWEAPON events in the wiki because while both entries are informative enough on their own, if you do arbitrary things like I do, you'll wind up with this problem, and if you're as dumb as I am, it'll take you years to figure out a solution