Question about "one use only" NPCs

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Question about "one use only" NPCs

Post by guo »

Hi,

Every time you set a "one use only" npc it's given a "onetime x" tag. I've noticed that x increments by 1 (obviously) to give one use only npcs a unique identifier, but this seems to increment even if the previous number isn't being used anymore.
For example, if I just sit on the "usable only once" line and switch between that and "usable repeatedly" the x in "onetime x" will continue to increment.

Is there a way to get the engine to go back and use unused numbers for that value? Does it even matter? I'm worried that it could be adding unnecessary lines to the code or something, or perhaps there's a hidden limit on one use only npc tags that I'm going to hit.

Cheers
vvight.wordpress.com
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

There is hard limit, but it is very high. (16000 I think?)

When custom hits the hard limit, it loops back and searches for unused gaps in the sequence automatically

So, nothing you need to worry about
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Post by Foxley »

Even though I don't currently use onetime tags, that's reassuring. My OCD would go bonkers if I skipped over tags like that.
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Post by guo »

When custom hits the hard limit, it loops back and searches for unused gaps in the sequence automatically
Phew! Thanks.
Even though I don't currently use onetime tags, that's reassuring. My OCD would go bonkers if I skipped over tags like that.
Yea, the first time I noticed it I was like "WHAT ARE YOU DOING?"
vvight.wordpress.com
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

People worriedly ask about about that a lot!

Simple solution, I've changed it (not in nightlies) so that if you flip it on-off repeatedly it keeps using the same tag instead of counting up (just a matter of considering the old tag before a new one).
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Haha! I was about to implement a "Suppress OCD" general bitset that would simply hide the one-time numbers from display!

Tmc's solution is simpler and better :)
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Post by guo »

"Suppress OCD" more things need this feature.
vvight.wordpress.com
Post Reply