Page 1 of 1
Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Fri Apr 10, 2015 11:22 am
by Noobasaurus
I'm trying to change a prop's ClassLabel from prop to destructablebuilding, and then add in a few extra parameters after that. The hard part is switching it to destructablebuilding. I've tried using SetProperty and SetClassProperty but those only work on entities. I've tried loading in new classes (odfs) with an ingame.lvl, but it hasn't yielded any results either. Is this possible, or should I just edit the map and all of the objects in it instead? I'm trying to keep the filesize low, but if there's no other alternative then I'll just do it that way.
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Fri Apr 10, 2015 3:03 pm
by [RDH]Zerted
I don't think you can do that. Changing a ClassLabel is like saying it's now a completely different thing.
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Fri Apr 10, 2015 3:12 pm
by Nedarb7
Using SetClassProperty won't work, since ClassLabel doesn't fall into the same category with other properties (falls under GameObjectClass, not Properties.) As for loading the ODF through a LVL file, how exactly are you doing it?
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Fri Apr 10, 2015 3:16 pm
by Noobasaurus
I'm using an ingame.lvl. Here's what it looks like:
I'm trying to modify the crates on the death star to be destructible. The custom ingame.lvl is loaded before the default one, and both of them are loaded before the actual death star level.
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Fri Apr 10, 2015 5:42 pm
by Maveritchell
1) Does it not work?
2) Did you try loading it after you load in the Death Star world?
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Fri Apr 10, 2015 6:44 pm
by Noobasaurus
Maveritchell wrote:1) Does it not work?
Yes, it does not work.
Maveritchell wrote:2) Did you try loading it after you load in the Death Star world?
Just tried it. First it crashed because it couldn't find the human animations, so then I moved the three lines (dc:ingame, ingame, and death star level) to the top of ScriptInit. It didn't crash this time, but there weren't any CPs. The error log returned this for all of the entities (health droids, ammo droids, command posts, bridge stuff):
Code: Select all
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(1172)
Could not find odf "com_item_weaponrecharge"!
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(1222)
Attempting to build an object, com_item_weaponrecharge14, that does not have an .odf file associated with it
So then I decided to put the CPs, weapon recharges, and health recharges in the ingame.lvl.
And it didn't change a thing. Same errors. Any ideas?
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Fri Apr 10, 2015 11:18 pm
by Maveritchell
Sorry, I wasn't clear. Put it in both places (the original and after the world's loaded). You can split it up into logical splits so that you don't have to do that later, but since you're loading in several unrelated pieces, you put it in two places.
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Posted: Sat Apr 11, 2015 11:17 am
by Noobasaurus
Okay, I did that, and everything loads fine now, but the crates are still the same. I also tried splitting it up into two ingame.lvls (one with the crate and then the other normal one), and loading the normal one normally and then the one with the crate after the world is loaded. Same result, nothing.
EDIT: I tried loading it in with the world, and here's what it looks like.
And now it crashes when it begins loading. It returns this error.
Code: Select all
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Entity.cpp(218)
Entity base class "DestructableBuilding" not found
I tried a few other similar classes as well, but they all return the same error.