The Dink Network

Reply to Re: variable limit and debug info

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
April 30th, 08:28 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
That's weird that var_used is saying there's variable slots available when there isn't..

As for checking how many sprite numbers are being used, you could do this:
 int &sprites_used = 1;
 int &count;
sprites_used:
 sp_active(&sprites_used, -1);
 if (&return == 1)
 {
  &count += 1;
 }
 if (&sprites_used < 300)
 {
  //300 is the upper limit for DinkHD, check all active sprite slots
  &sprites_used += 1;
  goto sprites_used;
 }
 
 say("There are currently &count active sprites on this screen", 1);


No wait required in the loop, it'll process basically instantly. You can give it a custom proc name and call it whenever via external too.
You can use 2 global juggle vars there instead of using up 2 locals. If you have something like &save_x/&save_y in PQ just change it to them. It won't affect anything else since there's no wait in the procedure.

Im not sure on the variable thing, although if you wanna send me sample scripts to re-create the sequence, I'd play around with it and see if I can see any reason why.

EDIT: If it would help to see currently used scripts, vars and active sprites in real time while you play on the screen, I just quickly wrote a script to achieve this. Just put these in the story folder: key-83.c, stracker.c and press 's' in game. It will show the currently used vars, scripts and sprites at the bottom of the screen, updating every wait(1). It does use a few local vars to achieve it though.