This project is read-only.

Error in code

Oct 7, 2011 at 2:51 PM
Edited Oct 7, 2011 at 2:52 PM
EXECUTION ERROR in creation code of room rm_binary_example_01
In script scr_load_room:
In script scr_read_string:
Illegal argument count calling script "scr_read_bytes".
Script requires 3 arguments, 2 have been supplied. 
0
Oct 8, 2011 at 3:28 PM

This error shows because of the new GM "Throw an error when arguments aren't initialized correctly" option is checked. It seems that I forgot 1 argument, in 2 lines of code. You can fix this by either turning the argument check option off in GM, or fix the offending lines of code.

Fixes:

In the script "scr_read_string", the line that calls the script "scr_read_bytes", should look like this:

// Read the number of characters the string has.
_count = scr_read_bytes(_stream, _bytes, false);

Also, in the script "scr_read_tile_attributes", the line that calls the script "scr_read_bytes", should look like this:

// Set color blend.
_color = scr_read_bytes(_stream, 4, true);

Oct 14, 2011 at 2:45 PM
Edited Oct 14, 2011 at 2:45 PM

..........when arguments aren't initialized correctly" option is checked. It seems that I forgot 1 argument, in 2 lines of code.

---> You can fix this by either turning the argument check option off in GM, or fix the offending lines of code.

Hi,

 

how do  fix this turning the argument check option off in GM ?

Tnk 1000