SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: KommissarReb on May 11, 2019, 11:43:39 AM

Title: How can I change the look of a unit for my map?
Post by: KommissarReb on May 11, 2019, 11:43:39 AM
I'm trying to turn the Stormtrooper into a Sandtrooper, so what I did was I went into Datatest1/Sides/IMP/ODF (test1 is the map name) and went into imp_inf_storm_trooper and changed "stormtrooper" to "shocktrooper" for all geometry parameters. I also wanted to reskin the Stormtrooper blaster rifle to look like the Rebel Marksman's sniper rifle (but still function as a blaster rifle) so I brought the all_weap_inf_sniperrifle files into the ODF and MSH folders, but when I playtest the map it still shows the standard stormtrooper with an E-11 blaster rifle.

I read through all the tutorials listed in the modding tutorials subforum and couldn't figure this out.
Title: Re: How can I change the look of a unit for my map?
Post by: Ascertes on May 11, 2019, 12:51:59 PM
Could you post your LUA and ODF(s) by chance?
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 11, 2019, 01:25:50 PM
Here the imp_inf_storm_trooper.odf that I edited. I also edited imp_weap_inf_rifle.odf in the same folder to use the rebel sniper rifle geometry. I copied the rebel sniper rifle files to the IMP folder, so I don't know what I'm not doing right.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 12, 2019, 12:36:02 AM
We need the LUA script as well to be able to tell you what's going on.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 12, 2019, 01:48:35 AM
Here's the GCW .lua (my test map is GCW only). I already tried getting the Imperials use the imp_inf_storm_trooperdesert (which is mostly the same) but for some reason it results in the stormtrooper not appearing in the unit selection.

It will only allow me to have one attachment per post, which is why I originally only had one attachment. I changed the geometry values for the imp_weap_inf_rifle.odf file in Sides/IMP/ODF to use the Rebel sniper rifle's geometry, and I copied the rebel sniper rifle files into the imperial folders.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 12, 2019, 02:04:00 AM
Change this line

ReadDataFile("SIDE\\imp.lvl",

To this

ReadDataFile("dc:SIDE\\imp.lvl",
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 12, 2019, 02:27:37 AM
The Sandtrooper still won't appear. Just now I tried renaming "imp_inf_tat" everywhere to "imp_inf_sand_trooper" and added it to the imp.req in the "IMP" folder in "SIDES", but the Sandtrooper still won't appear.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 12, 2019, 08:53:41 AM
What does SPTest tell you when you load the level? You can find the log as BFront.txt.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 12, 2019, 02:00:39 PM
Several errors came up, one that said "not enough classes to remove for imp_inf_darthvader" and a few about the command posts. But I don't think the ones complaining about the command posts or music are as relevant as the class one.

Where can I find BFront.txt? I ran BFTest in the Battlefront folder.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 12, 2019, 02:03:29 PM
Where is your Battlefront installed? If it's installed in Program Files on Windows 10, BFront.txt won't be in the same folder. It'll be in your VirtualStore:

C:\users\[your user name]\AppData\Local\VirtualStore\Program Files (x86)\LucasArts\Star Wars Battlefront
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 12, 2019, 02:14:47 PM
QuoteMessage Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(531)
Team missing class "imp_inf_sand_trooper" (check the side's .req file)

I don't know what I'm not doing right. I got the pilot version of Luke Skywalker to work on my test map ( and even tried out playing as him) but I can't make a custom unit?
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 12, 2019, 02:15:58 PM
I'm asking you to post a lot here but it all helps figuring it out. Can I see the REQ file for your side?
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 12, 2019, 02:31:32 PM
Oh I don't mind. I just changed the .lua again so that imp_inf_basic.req has the ordinary stormtrooper again and imp_inf_sand_trooper.req is it's own category (like the dark trooper).

Message Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(531)
Team missing class "imp_inf_sand_trooper" (check the side's .req file)

Also does this message mean that I have to remove the Dark Trooper or something so I can use my custom unit, or do I need entirely new custom units in order to have one that's different?

Message Severity: 3
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(558)
Not enough slots to remove for special class "imp_inf_darthvader"
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 13, 2019, 01:45:29 AM
Not too sure about the last one, but looking at your .REQ file, there's no reference there to an 'imp_inf_tat' or 'imp_inf_sand_trooper' anywhere.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 13, 2019, 04:20:40 AM
I just downloaded my file and it says "imp_inf_sand_trooper" at the bottom of the list. Also I remember reading somewhere that the order they come in matters. Is that true?
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 13, 2019, 04:23:04 AM
Ah, yes, I was looking elsewhere in the REQ. It shouldn't matter.
I'm going to need to see your imp_inf_sand_trooper req as well.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 13, 2019, 04:26:09 AM
It won't let me add multiple attachments for some reason. Seeing as Dark Troopers are their own units, I didn't see why I couldn't add a custom one.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 13, 2019, 04:44:32 AM
Is the ODF you posted your custom unit, and is it still called "imp_inf_storm_trooper"?
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 13, 2019, 04:54:31 AM
No, by now I made a separate .odf called "imp_inf_sand_trooper". I retained the name back when I attempted to make my custom unit part of "imp_inf_basic". Could it be the blaster rifle is making it unspawnable? I changed the geometry of imp_weap_inf_rifle.odf to all_weap_inf_sniperrifle.odf. I don't know if that's the wrong way to do that.

Should I create an entirely new side, or edit IMP?
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 14, 2019, 08:41:03 AM
I think it might be easiest to see what's gone wrong if you can send me your custom IMP side folder in its entirety. Zip it up and PM me with a link to it so I can take a look and I'll let you know what's wrong and how to fix it.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 15, 2019, 04:02:06 AM
If you can't find anything wrong with it, maybe send me a file of a modified IMP folder with a custom Sandtrooper unit with a blaster rifle that has the geometry of the Rebel sniper rifle so I can compare it to mine and see what's different.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 16, 2019, 06:17:51 AM
I'm not entirely sure why it wouldn't work for you. Here is a datatest1 folder I created, with the IMP folder you sent me and the correct LVL files referenced in the LUA.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 16, 2019, 07:46:03 AM
It works, although the Sandtrooper is called "imp_inf_sandtrooper" (though that's a minor nitpick and something I could probably fix on my own later).

Was I supposed to edit any .lvl files? I tried using HxD to edit .lvl files, but it wouldn't allow me to even when I run it in administrator (I'm using my laptop where I am the owner). I tried adding the IMP folder to the Sides folder of the custom map I wanted it for, and also copied the faction info from the test .lua, but when I load up that map it only has an ordinary stormtrooper.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 16, 2019, 09:04:41 AM
I called the ODF as you sent it to me, so that's probably why (the game was looking for "imp_inf_sand_trooper", if you said the ODF was called "imp_inf_sandtrooper" it wouldn't find it)
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 16, 2019, 09:42:37 AM
No, that was a typo. It actually said "imp_inf_sand_trooper". I just double-checked my original Datatest1's sides and .req files to make sure I didn't put in "imp_inf_sandtrooper", and so far I still don't know why I can't make custom units.

Just made a fresh test map where I copied your IMP folder into Sides and edited the .lua so it has the custom Imp units, and when I load it up it crashes. In BFront.log this is what came up:

[spoiler]Message Severity: 3
D:\src\FRONTLINE_PC\FrontLine\Source\LuaCallbacks_Mission.cpp(195)
Lua ReadDataFile: Could not open dc:SIDE\imp.lvl

Message Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(531)
Team missing class "imp_inf_sand_trooper" (check the side's .req file)

Message Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(531)
Team missing class "imp_inf_shock_trooper" (check the side's .req file)

Message Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(531)
Team missing class "imp_inf_pilottie" (check the side's .req file)

Message Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(531)
Team missing class "imp_inf_scout_trooper" (check the side's .req file)

Message Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(531)
Team missing class "imp_inf_dark_trooper" (check the side's .req file)

Message Severity: 2
D:\src\FRONTLINE_PC\FrontLine\Source\PlanetaryBonus.cpp(128)
Hero class "imp_inf_darthvader" not found for team 2 (check the side's .req file)

Message Severity: 3
D:\src\FRONTLINE_PC\RedEngineFL\Graphics\PC\Shaders\pcTerrainShader.cpp(176)
pcTerrainShader: detail texture expects L8 format!

Message Severity: 3
D:\src\FRONTLINE_PC\FrontLine\Source\Team.cpp(171)
Team  has no unit classes
[/spoiler]
I'm not sure if it's got something to do with the fact that the BFBuilder I'm using was an experimental version Dark_Phantom gave me when I made a post about the one I downloaded not working. Are you sure I don't need to edit any .lvl files?
Title: Re: How can I change the look of a unit for my map?
Post by: Dark_Phantom on May 16, 2019, 10:34:24 AM
In your addon folder, does SIDE\imp.lvl exist?  Is it a reasonable size (compare to stock imp.lvl)?  Sometimes the only way to tell there was a munge error is if the file is not very big compared to stock.

It has to be in your addon folder when you specify dc:Side\xxx.lvl

Those errors tell me that the file is not where it's supposed to be.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 16, 2019, 11:00:11 AM
It didn't exist, so I copied Giftheck's imp.lvl from his Datatest1 and munged it, but it crashed when I tried loading the map. I don't know how to create .lvl files, and what I found using the search tool still leaves me bewildered.

UPDATE: I got it to work by adding the necessary .lvl files (including Giftheck's imp.lvl) into _LVL_PC/Side. Now all I need to do to figure out how to name "imp_inf_sand_trooper" "Sandtrooper". I click the localize button, and the only two scopes are "level" and "weapons". It won't allow me to create new scopes, and I don't know what the MultiLanguageTool is editing to replace it so I can name my units.
Title: Re: How can I change the look of a unit for my map?
Post by: Dark_Phantom on May 17, 2019, 07:23:11 AM
Nice, glad you got that figured out.
There are a couple different localization tools, some for just the addon core.lvl and some for the complete game - generally the readme says which.  It's been a while since I've done it, so others might have more insight on what's best for your situation.  You're going to have to edit the imp scope and add a new value, but that's all I know off the top of my head.
I believe I had some success with Bamdur's tool and Sleepkiller's tool, so you have a choice.  Just make sure, again, to read the readme files.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 17, 2019, 06:22:28 PM
I think the problem is I don't know what .lvl files I need to edit in order for custom units to work. It's just the side .lvl's, right? I downloaded HxD to edit .lvl files, but other than replacing text (which IIRC crashed my game) I have no clue how to use it.

Giftheck, when you edited imp.lvl (and the other .lvl files I assume), what did you do? I want to know so I can make custom units on my own. I searched up .lvl in the search engine and didn't find anything that made sense.
Title: Re: How can I change the look of a unit for my map?
Post by: Dark_Phantom on May 17, 2019, 07:32:47 PM
Disclaimer: I am not Giftheck.

Claimer:  http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=553 is the side.lvl builders where you can make your very own sides by adjusting the stock sides.

I recommend starting off simple - open up the Dark Trooper odf in notepad (ODF folder), change jet jump to something crazy, run munge.bat, copy and replace the file it creates (in _LVL_PC in the tool's folder) with your stock imp.lvl (located in Data\_LVL_PC\SIDE\) with it.  Go ingame and test the Dark Trooper. The files are set up so that you don't need to do anything crazy to make it work - the hard part is done for you.  The odf (object definition files) are pretty self explanatory, but searching "side.lvl" should bring up some more results.

The hard part is figuring all this stuff out the first time - after that, it gets easier.
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 18, 2019, 02:03:35 AM
Thanks for stepping in, Dark_Phantom. I was asleep when this message came through.

KommissarReb - LVL files are compiled files. You don't do anything to them. You use the mod tools to create LVL files, and to create custom sides you need to modify the ODFs for each side then munge them into LVL files. Dark_Phantom's suggestion is a good place to start if you're unsure. There's also a few tutorials both here and on Gametoast.
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 18, 2019, 01:38:47 PM
I have good news and bad news.

The good news is that I can now successfully make custom units with the help of the side builder.

The bad news is when I wanted to give the sandtrooper and imperial pilot the CIS blaster pistol, it doesn't make firing sounds. I tried adding "ReadDataFile("sound\\tat.lvl;tat1cw");" after --start soundlvl, tried renaming it "ReadDataFile("dc:sound\\tat.lvl;tat1cw");", and putting both before "ReadDataFile("dc:SIDE\\imp.lvl"," but the firing sounds still won't work. Am I typing something wrong?
Title: Re: How can I change the look of a unit for my map?
Post by: Giftheck on May 18, 2019, 03:03:56 PM
Quote from: KommissarReb on May 18, 2019, 01:38:47 PM
I have good news and bad news.

The good news is that I can now successfully make custom units with the help of the side builder.

The bad news is when I wanted to give the sandtrooper and imperial pilot the CIS blaster pistol, it doesn't make firing sounds. I tried adding "ReadDataFile("sound\\tat.lvl;tat1cw");" after --start soundlvl, tried renaming it "ReadDataFile("dc:sound\\tat.lvl;tat1cw");", and putting both before "ReadDataFile("dc:SIDE\\imp.lvl"," but the firing sounds still won't work. Am I typing something wrong?

Did you copy over the CIS Blaster Pistol odf unchanged? (cis_weap_inf_pistol)
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 18, 2019, 03:59:51 PM
Yes I did. Do I have to change something to make it work?

I also made a custom local side called DES (using the DES folder already there since it has a munge.bat) with Side.lvl builder which contains a Gamorrean Guard, a Jawa that I armed with a DN bolt caster that I reskinned to look like a mortar launcher, and a new unit called des_inf_soldier that has a blaster rifle, a missile launcher, and a fusion cutter. I moved in all these units' ODF and MSH files and added them to des.req and everything, so I don't know why their sounds aren't working either. Three things I noticed about the sounds not working is the firing sounds for the Naboo Guard's blaster rifle and TIE-Bomber weapons work, but the Guard's voice, Jawa's voice and weapon, Gamorrean voice, and even the Imperial IFT-T (imp_hover_fightertank) don't work.

What am I supposed to change?
Title: Re: How can I change the look of a unit for my map?
Post by: Dark_Phantom on May 18, 2019, 05:11:34 PM
I'm going to take a shot in the dark: the sounds you are missing are in other sound.lvl files like nab.lvl. Not completely sure where though, you'd have to look at the Theed historical mission for the guards and in missions where the sounds work
Title: Re: How can I change the look of a unit for my map?
Post by: KommissarReb on May 18, 2019, 06:44:50 PM
What files do I have to add or move to get their sound effects working? Does anyone know that one? I've seen some maps where the sound effects don't work for units.
EhPortal 1.34 © 2024, WebDev