Page 1 of 1

Question about Object Parents

Posted: Mon Sep 19, 2016 9:29 am
by Benoz
Hey Community,

I have some questions about the Object odf's and their parent files.
I have a huge rep side folder (almost over 1 GB) and I stored a few camera variables in some troopers odf files.
Now I created a new side that should store all camera variables for the rep side so I can easily change it.
I created a side called "view" and also created some objects with this code:

Code: Select all

[GameObjectClass]
// This object only controls the Camera View
ClassParent             	= "com_inf_default"

[Properties]
CAMERASECTION       	= "STAND"
EyePointOffset      	= "0.0 1.8 0.0"
TrackCenter         	= "0.0 1.8 0.0
TrackOffset         	= "0.3 -0.1 3.0"
TiltValue           	= "10.0"
...
As you see the parent of this object is "com_inf_default" (the same as it used to be in some rep objects)
Now I changed the parent of "rep_in_default" from com_inf_default to view_inf_default (refering to the object in the view folder)
But when I tested it, the game crashes.

Is it even possible to make something like that? To store variables of sides via different parents in other side folders?
I did this because my rep side foler is about 1 GB and the view folder would be just 1 MB large. I want to make patches for my mod this way and so the downlaod file is not that large.

Thanks to you guys in advance
-
The66Order66

Re: Question about Object Parents

Posted: Mon Sep 19, 2016 11:31 am
by thelegend
I think it should work. Depends on which side is being loaded first. Inside your .lua make sure that your view side is loaded before all the other side .lvl's. Especially before rep.lvl is loaded/read.

Re: Question about Object Parents

Posted: Tue Sep 20, 2016 3:09 am
by Benoz
Ouh, I dodn't even load the view side in any lua. You mean the lua of the map?
Because the common side is also not munged in the lua.

EDIT: I try now to move the view odfs into the common side folder.
EDIT: Doesn't work either. I want the new objects to work like an in between object of the "rep_inf_ep3_trooper" > "rep_inf_default" > "view_inf_default" > "com_inf_default".

Re: Question about Object Parents

Posted: Tue Sep 20, 2016 2:18 pm
by AnthonyBF2
I am pretty sure you can do the same result with SetClassProperty.

Example:

Code: Select all

SetClassProperty("rep_inf_ep3_rifleman", "CAMERASECTION", "STAND")
SetClassProperty("rep_inf_ep3_rifleman", "EyePointOffset", "0.0 1.8 0.0")
SetClassProperty("rep_inf_ep3_rifleman", "TrackCenter", "0.0 1.8 0.0")
SetClassProperty("rep_inf_ep3_rifleman", "TrackOffset", "0.3 -0.1 3.0")
SetClassProperty("rep_inf_ep3_rifleman", "TiltValue", "10.0")
That chunk of code would go in your map Lua file after ScriptPostLoad()
Repeat the chunk of code for different characters. You won't need side files/mods at all if that works out.