Edit a prop's ClassLabel with lua or ingame.lvl?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Edit a prop's ClassLabel with lua or ingame.lvl?

Post 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.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Edit a prop's ClassLabel with lua or ingame.lvl?

Post by [RDH]Zerted »

I don't think you can do that. Changing a ClassLabel is like saying it's now a completely different thing.
User avatar
Nedarb7
Lieutenant General
Lieutenant General
Posts: 676
Joined: Sat Sep 22, 2012 3:41 pm

Re: Edit a prop's ClassLabel with lua or ingame.lvl?

Post 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?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Edit a prop's ClassLabel with lua or ingame.lvl?

Post by Noobasaurus »

I'm using an ingame.lvl. Here's what it looks like:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"texture"
"box_icon"
}

REQN
{
"model"
"com_icon_alliance"
"com_icon_imperial"
}
REQN
{
"class"
"dea1_prop_crate"
}

}

[/code]
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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Edit a prop's ClassLabel with lua or ingame.lvl?

Post by Maveritchell »

1) Does it not work?
2) Did you try loading it after you load in the Death Star world?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Edit a prop's ClassLabel with lua or ingame.lvl?

Post 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.
Hidden/Spoiler:
[code]ucft
{
REQN
{
"texture"
"box_icon"
}

REQN
{
"model"
"com_icon_alliance"
"com_icon_imperial"
}
REQN
{
"class"
"dea1_prop_crate"
"com_item_weaponrecharge"
"com_item_healthrecharge"
"com_bldg_controlzone"
}

}
[/code]
And it didn't change a thing. Same errors. Any ideas?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Edit a prop's ClassLabel with lua or ingame.lvl?

Post 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.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Edit a prop's ClassLabel with lua or ingame.lvl?

Post 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.
Hidden/Spoiler:
[code]ucft
{
REQN
{
"script"
"dea1g_c3"
}
REQN
{
"class"
"dea1_prop_crate"
}
}

[/code]
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.
Post Reply