Y_INI Saving/loading help
#4

The 2D-array ObjInfo will only save whatever value [0ID] is holding for index MAX_OBJECTS.

Let's say MAX_OBJECTS has been defined as 5:
PHP код:
#define MAX_OBJECTS 5 
We then assign a value to ObjInfo[MAX_OBJECTS][0ID]:
PHP код:
ObjInfo[MAX_OBJECTS][0ID] = 10
What the preprocessor will do is replace MAX_OBJECTS with its defined value:
PHP код:
ObjInfo[5][0ID] = 10
This means that for the index MAX_OBJECTS (5) of the 2D-array ObjInfo, 0ID equals 10.

What you want to do is save the values of 0ID for all indexes of ObjInfo. In that case, you need a loop:

PHP код:
for(new 0MAX_OBJECTSi++) {
     
INI_WriteInt(object"Object ID"ObjInfo[i][OID])

Fault-checking should be done by you. With fault-checking, I immediately think of non-existing objects or empty indexes.
Reply


Messages In This Thread
Y_INI Saving/loading help - by GeorgeMcReary - 22.07.2016, 16:31
Re: Y_INI Saving/loading help - by Deadpoop - 22.07.2016, 16:36
Re: Y_INI Saving/loading help - by GeorgeMcReary - 22.07.2016, 16:51
Re: Y_INI Saving/loading help - by AndySedeyn - 22.07.2016, 17:04
Re: Y_INI Saving/loading help - by GeorgeMcReary - 23.07.2016, 06:48
Re: Y_INI Saving/loading help - by AndySedeyn - 23.07.2016, 12:14

Forum Jump:


Users browsing this thread: 1 Guest(s)