Jump to content

Photo

Item string control code


  • Please log in to reply
5 replies to this topic

#1 Omega

Omega

    Yes

  • Members

Posted 11 February 2017 - 03:52 AM

So I'm using the item string control code so that you get a key. But instead of one key I get 55545 keys. I used a key and then it goes to 255, 254, and so on, so I know it's real keys and not just a counter text glitch. I've recently edited my subscreens and I remember seeing this value (55545) under properties for the rectangle that's set under everything (the huge rectangle behind item blocks, triforce, etc.

Any idea what's wrong? I check and the strings aren't looping nor do the control codes look out of place. I'm puzzled.

Edited by Omega, 11 February 2017 - 03:54 AM.


#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 11 February 2017 - 10:11 AM

Link should not even be able to have that many keys--ever. I think that the counter should roll over at 32767. Please post a screenshot of this, and post your precise string, with the codes.



#3 Omega

Omega

    Yes

  • Members

Posted 11 February 2017 - 01:53 PM

Iz3BX4Lh.jpgDVXWahC.png

Looks like I was off by a hundred thousand. Anyway here you are.



#4 Omega

Omega

    Yes

  • Members

Posted 11 February 2017 - 08:48 PM

So I just went to a different string and put in \5\27 but forgot the string so I couldn't put \5\27\stringnumber. When I came back to input the string number, it said \5\27\65535. What? This is a different string with no item get code, not even linked to the other strings. That's the value I get in keys when I use a different string for item get. ???

#5 Omega

Omega

    Yes

  • Members

Posted 11 February 2017 - 09:10 PM

OK... so I figured it out. I've been using the take item code. And when it turns to take a key you don't have it gives you 65535 lol

#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 February 2017 - 12:42 AM

That's counter rollover. Counters are 16 bit integers, and when they are reduced below 0, they roll over to their maximum; or conversely, if they are increased above their maximum, they roll over to their minimum. Game->Counter[CR_KEYS} rolls from 0 to 65535, so, 0 - 2 = 65533; and 65530 + 20 = 15.
 
I'll try to push a fix for this (specifically for strings, at least), into the next ZC version.
 
 

...

...

...

...

...

 
Just bringing this to your attention, and this is precisely why I wanted to block rollover internally. Scripting language/programming models aside, a typical user does not anticipate a counter like this to behave in this manner.
 
All this does is produce illogical results. In any case, I feel that fixing how strings do it is likely prudent, so that they work in the same way as the item collection functions.

We can discuss that on AGN, or make a thread for it here, or both. I think it would be a good idea to ask the userbase how they want them to work. (Making a rule to allow rollover is easy enough, too.)

Edited by ZoriaRPG, 12 February 2017 - 12:46 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users