List to objects can't be stored as data.

Freeform discussion about anything related to modding Transcendence.
Post Reply
EditorRUS
Militia Lieutenant
Militia Lieutenant
Posts: 148
Joined: Tue Oct 30, 2012 6:30 pm

Image

List can't be stored as data. Therefore, pointers can't do the same too.
EditorRUS
Militia Lieutenant
Militia Lieutenant
Posts: 148
Joined: Tue Oct 30, 2012 6:30 pm

Well, i can get data as well, but by not direct way.

Image
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Oh lists. I hate them so.
Lists are hard to store as data because you have to use the item function in conjunction with ObjGetData.

Try this:
(item (ObjGetData gPlayership "SomeItem") 0)
(item (ObjGetData gPlayership "SomeItem") 1)
(item (ObjGetData gPlayership "SomeItem") 2)
(item (ObjGetData gPlayership "SomeItem") 3)

Lists are indexed starting with 0 so you *really* have to be careful how you set lists. Check out Star Genesis for setting lists as data and examples.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
EditorRUS
Militia Lieutenant
Militia Lieutenant
Posts: 148
Joined: Tue Oct 30, 2012 6:30 pm

Well, my EMC (energy-matter converter) wasn't working and was causing a crash of the game because of that.

A ship has a variable "EMC_parent" that contains a pointer to an EMC. Virtual launcher, virtual energy load, and dockscreen were using this var to run some events of the EMC.

Just a little example

(block (parent currW needW)
(setq parent (objGetData gSource "EMC_parent"))
...blah-blah-blah...
(objSetData parent "EMC_W" (add currW addW))
(if (geq currW need)
(objFireEvent parent "Ready")
)

and so on. I ABSOLUTELY didn't expect that such error can destroy everything and i lost some nerves.
Post Reply