Collection of modding questions and answers
[tag]
F I G H T T H E P O W E R
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
can I get a list of various list functions? I didn't see them in the main post.
I see things like item and count but would like to see them all and have simple explanations.
There are also some functions missing from the list like apply and eval and most likely others.
I see things like item and count but would like to see them all and have simple explanations.
There are also some functions missing from the list like apply and eval and most likely others.
Crying is not a proper retort!
What is the difference between objGetData and objGetGlobalData?
Looking at PointJuno and Antarctica code, I just can't figure out why some variables are set by objSetData and some others by objSetGlobalData. They both seem to be saved in the object so their lifetime spans across game sessions (save & reload).
I thought maybe 'Global' means it's shared between all objects of the same type? But there is only one CSC Antarctica, so what use would that be?
Oh, and what about objGetStaticData? What attributes can that command retrieve (there is no corresponding objSetStaticData...)
Looking at PointJuno and Antarctica code, I just can't figure out why some variables are set by objSetData and some others by objSetGlobalData. They both seem to be saved in the object so their lifetime spans across game sessions (save & reload).
I thought maybe 'Global' means it's shared between all objects of the same type? But there is only one CSC Antarctica, so what use would that be?
Oh, and what about objGetStaticData? What attributes can that command retrieve (there is no corresponding objSetStaticData...)
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
You are correct on the globaldata vs data. As the xml evolved over time if you look enough you will see many things that do the same thing but in different way due to new functions being added.
StaticData is a great thing. It is basically custom data from the xml. (and thats why you can't change it) Hopefully it will be added for items soon because it will help alot with some mods.
StaticData is a great thing. It is basically custom data from the xml. (and thats why you can't change it) Hopefully it will be added for items soon because it will help alot with some mods.
Crying is not a proper retort!
Ahh, so if I add some random attribute to a ship class, I can retrieve it that way. Nice.Betelgeuse wrote:StaticData is a great thing. It is basically custom data from the xml. (and thats why you can't change it) Hopefully it will be added for items soon because it will help alot with some mods.
BTW, for items, can't you do this in the meantime?
Just put whatever you need in the data attribute and then retrieve it withgeorge moromisato wrote:I haven't actually tried this, but after looking at the code, you should be able to do this:
data="(1 2 3)"
and get back a list with the numbers 1, 2, and 3. In other words, you can enter normal script syntax in the data field and get it back with itmGetTypeData.
Remember that this data is associated with the type, not the instance (in other words, all items of that type will have the same data).
(item (itmGetTypeData obj) n) where n=0,1,2,3... etc.