question on objGetData

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

What are the limitations on objGetData?
Can it store lists? Does it matter what is in those lists?
If it can't what do you use to store those things?

I am asking this because of objGetObjRefData is used for space objects and not objGetData.
Crying is not a proper retort!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

You can store anything that is not a pointer.

Do not store an object pointer (e.g., gPlayerShip or gSource or anything like that). Use (objSetObjRefData) to store it instead.

Do not store an item cursor (such as the result from (scrGetItemListCursor)). Store the actual item instead (an itemStruct).

Do not store an armor type (such as the result from (objGetArmorType)). I'm going to deprecate these functions--use (shpGetArmor) instead.

It is OK to store an itemStruct (e.g., the result from (scrGetItem)).

It is OK to store a vector (e.g., the result from (sysVectorRandom)).

It is OK to store a list of any allowed value (NOT OK to store a list of prohibited values).

[Also, you cannot currently store a list of objects with (objSetObjRefData). If you need to store an array of objects, use the "Var1, Var2, Var3" technique.]

Note: If you accidentally store something that you're not supposed to, everything will seem to work. But if you save the game and restore, the game will probably crash (because the pointer is now invalid).
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

thanks
Crying is not a proper retort!
Post Reply