Edit a prop's ClassLabel with lua or ingame.lvl?
Moderator: Moderators
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Edit a prop's ClassLabel with lua or ingame.lvl?
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.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
I don't think you can do that. Changing a ClassLabel is like saying it's now a completely different thing.
- Nedarb7
- Lieutenant General

- Posts: 676
- Joined: Sat Sep 22, 2012 3:41 pm
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
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?
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
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.
Hidden/Spoiler:
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
1) Does it not work?
2) Did you try loading it after you load in the Death Star world?
2) Did you try loading it after you load in the Death Star world?
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
Yes, it does not work.Maveritchell wrote:1) Does it not work?
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):Maveritchell wrote:2) Did you try loading it after you load in the Death Star world?
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
Hidden/Spoiler:
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
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.
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Re: Edit a prop's ClassLabel with lua or ingame.lvl?
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.
I tried a few other similar classes as well, but they all return the same error.
EDIT: I tried loading it in with the world, and here's what it looks like.
Hidden/Spoiler:
Code: Select all
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Entity.cpp(218)
Entity base class "DestructableBuilding" not found
