The recipe is something like this:
- Remove the line in C4Def::CompileFunc in C4Def.cpp that connects the Defcore value to the internal engine variable
- Remove the internal engine variable from C4Def.h and replace all users with GetPropertyInt(P_Foo). For non-integer values it gets a bit more complicated. See C4PropList.h for the APIs to use.
- Add one line each to C4StringTable.h and C4StringTable.cpp for P_Foo, mirroring the other P_* values
- Add the property in question to tools/convert_cr_to_oc.py, mirroring Collectible or Grab/Touchable and run the script in planet/.
Another problem is that a lot of engine functions pass around C4Def* pointers, which makes deriving definitions somewhat useless. I don't have a better idea than changing those to be C4PropList* and writing a custom check that the proplist is a definition (pPropList && pPropList->GetDef()) instead of making the binding templates do that.
- Remove the line in C4Def::CompileFunc in C4Def.cpp that connects the Defcore value to the internal engine variable
- Remove the internal engine variable from C4Def.h and replace all users with GetPropertyInt(P_Foo). For non-integer values it gets a bit more complicated. See C4PropList.h for the APIs to use.
- Add one line each to C4StringTable.h and C4StringTable.cpp for P_Foo, mirroring the other P_* values
- Add the property in question to tools/convert_cr_to_oc.py, mirroring Collectible or Grab/Touchable and run the script in planet/.
Another problem is that a lot of engine functions pass around C4Def* pointers, which makes deriving definitions somewhat useless. I don't have a better idea than changing those to be C4PropList* and writing a custom check that the proplist is a definition (pPropList && pPropList->GetDef()) instead of making the binding templates do that.
Is there anything that needs to remain a DefCore value or anything that we want to remain or are we heading straight towards removing defcore?
/e
I'm asking because I want to know if I have to think about anything if I'd like to change it from defcore to property.
/e
I'm asking because I want to know if I have to think about anything if I'd like to change it from defcore to property.
I'd appreciate that, for the sake of consistency (all properties in the same file, at the same space). But then it would be irritating to write
local
in front of each line.
if it's just about the "local" and the semicolon, we could use some syntax sugar to make that easier to write
We could also just have everything in DefCore.txt and parse all the entries that are definition members as properties.
You can just write
That's just a comma more than the Defcore format. For less, we'd need significant whitespace. While I like significant whitespace, I'm not sure that it'd be a good fit for a C-Syntax family language like C4Script.
local
Name="§Name§",
ActMap={
[...]
},
Placement=1;
That's just a comma more than the Defcore format. For less, we'd need significant whitespace. While I like significant whitespace, I'm not sure that it'd be a good fit for a C-Syntax family language like C4Script.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill