PDA

View Full Version : Allegro Reporting for Screen->Load Indices



ZoriaRPG
06-03-2015, 09:15 AM
I remember discussing this with Saffith back when 2.50.0 final was out, and 2.50.1 was still in early RCs...

If the user passes a vale of '0' into the indices with Screen Items, or Screen NPCs, Allegro reports this like this:

'Script attempted to reference a nonexistent item!You were trying to reference an item with UID = 2147483647; Items on screen are UIDs'

That value of 2147483647 confuses people, unless they already know of the problem (as I do).

May I suggest, finding the locations that report this for Screen->NumLWeapons(), Screen->NumNPCs(). and Screen->NumItems(), Screen->NumEWeapons() and reporting as follows (or similarly), if a value of 0 is passed:




Script attempted to reference a nonexistent item!
You were trying to reference an item with UID = 0; Items on screen are UIDs:
Screen->NumItems() indices start at '1'.

Script attempted to reference a nonexistent lweapon!
You were trying to reference an lweapon with UID = 0; Lweaponson screen are UIDs:
Screen->NumLWeapons() indices start at '1'.


Script attempted to reference a nonexistent eweapon!
You were trying to reference an lweapon with UID = 0; Eweaponson screen are UIDs:
Screen->NumEWeapons() indices start at '1'.

Script attempted to reference a nonexistent NPC!
You were trying to reference an NPC with UID = 0; NPC screen are UIDs:
Screen->NumNPCs() indices start at '1'.



As I recall, the the way they are phrased is a remnant / hold-over from temp code that is pretty old, or something of that nature.

What would be even better, is if the compiler auto-corrected a value of 0 passed in a for loop involving these vectors, but that would be trickier. The main thing, is to adjust the reports, so that they make sense.