SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: Antstafer on March 15, 2016, 07:11:37 PM

Title: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 15, 2016, 07:11:37 PM
I recently have been using BattlebelkToolBox for editing the reinforcement count and spawn count on the main maps, and I tried to see if there way a way to edit custom addon maps to make armies on them bigger also, but to no avail. Is there a way to do this?


Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 15, 2016, 07:45:44 PM
It is possible, but it takes some work.

Since most modders never released their lua assets, you will either have to:

-reconstruct the lua based on your guess as to what the unit names (and other details) were

or

-hex edit in the new values into the existing mission.lvl file


Hex editing has a steeper learning curve, but ultimately will give you more flexibility to edit more mission.lvl files.

Title: Re: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 15, 2016, 08:09:16 PM
Ahh, I see. Thanks for the help!
Title: Re: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 22, 2016, 02:04:39 PM
Quote from: Led on March 15, 2016, 07:45:44 PM
It is possible, but it takes some work.

Since most modders never released their lua assets, you will either have to:

-reconstruct the lua based on your guess as to what the unit names (and other details) were

or

-hex edit in the new values into the existing mission.lvl file


Hex editing has a steeper learning curve, but ultimately will give you more flexibility to edit more mission.lvl files.

Decided to revisit this. I've been looking around the website trying to find tutorials on hex editing, but any tutorial I find is either drastically different than what I'm trying to achieve, or the pictures that go with it are no longer available :/.

If anyone knows what I'd have to hex edit in a level's mission.lvl to make reinforcement and unit counts higher, I'd greatly appreciate it.
Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 22, 2016, 05:46:07 PM
This is what you need to do:

create a mission.lvl file for a map with a known reinforcement count
create a new mission.file for the same map with twice as many reinforcements and no other changes at all

use the "deep diff" program to search for the difference between the two files
(I will look for a link)  http://www.softpedia.com/get/System/File-Management/Deep-Diff.shtml

use xvi32 to open the file and change the reinforcement count now that you know where to look. 
http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

Keep in mind that it will probably be a hexidecimal value. http://www.binaryhexconverter.com/hex-to-decimal-converter



Here is a link to a tutorial on CP changes to maps--gives you some idea what you will get in to
Title: Re: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 22, 2016, 06:33:54 PM
Quote from: Led on March 22, 2016, 05:46:07 PM
This is what you need to do:

create a mission.lvl file for a map with a known reinforcement count
create a new mission.file for the same map with twice as many reinforcements and no other changes at all

use the "deep diff" program to search for the difference between the two files
(I will look for a link)  http://www.softpedia.com/get/System/File-Management/Deep-Diff.shtml

use xvi32 to open the file and change the reinforcement count now that you know where to look. 
http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

Keep in mind that it will probably be a hexidecimal value. http://www.binaryhexconverter.com/hex-to-decimal-converter



Here is a link to a tutorial on CP changes to maps--gives you some idea what you will get in to

Thanks for the help Led =). Directions are a little confusing for me to follow, but it's my fault for not explaining further.

I got this custom map I downloaded that's basically like the invasion of Omaha Beach but with Battlefront, lol. My only gripe with the level is that it could use a lot more units. 

So in order to increase the unit count/reinforcements, I'll have to do the following?-
1. Take the mission.lvl from some other map that has an already modified unit count (like my modded Geonosis).
2. Use the deep diff program to find differences between the geonosis mission.lvl and the custom map's mission.lvl.
3. Continue with xvi32 etc.

I have a feeling I got the wrong idea though. The hex values for the levels would be so different that it'd be impossible to find the right ones. I'm not even sure how to go about creating a mission.lvl for a map.
Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 22, 2016, 06:43:47 PM
You need to find the location of the reinforcement count in mission.lvl.  The easiest way to do that is to work with a mission.lvl file that you can change using battlebelks misison builder.

Once you know what to look for then you can look for that location in the mission.lvl file you really want to edit.

Please attach the mission.lvl file you want to edit to this post and I will see what I can do.

Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 22, 2016, 07:07:14 PM
Here is a quick video to show the process

https://youtu.be/g25qAW37EeM
Title: Re: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 22, 2016, 07:20:03 PM
Quote from: Led on March 22, 2016, 06:43:47 PM
You need to find the location of the reinforcement count in mission.lvl.  The easiest way to do that is to work with a mission.lvl file that you can change using battlebelks misison builder.

Once you know what to look for then you can look for that location in the mission.lvl file you really want to edit.

Please attach the mission.lvl file you want to edit to this post and I will see what I can do.

I'll give it a go myself, but here's the custom map's file anyway.
Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 22, 2016, 07:27:35 PM
One more question--what was the original ticket count for this map?
Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 22, 2016, 07:41:59 PM
supplemental video

https://youtu.be/zQ7dVDUBIgM
Title: Re: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 22, 2016, 07:44:28 PM
Quote from: Led on March 22, 2016, 07:27:35 PM
One more question--what was the original ticket count for this map?

Not sure what you mean by ticket count, but I have a good guess.

Attacker- 325
Defender- 250
Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 22, 2016, 07:52:46 PM
Yes, that is what I meant.  OK, try this file.  Be sure to back up your original, and then rename this one to mission.lvl.  If it works, I will show you a video of what I did :)

(this one should give the attacker 1002 tickets (reinforcements = tickets)
Title: Re: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 22, 2016, 08:04:36 PM
Worked like a charm! Thanks Led =). Simple, easy to follow tutorials as always.

The unit count should be pretty easy to change too following this method. I'll see what I can do on my own.
Title: Re: Editing Addon lua files for bigger armies?
Post by: Led on March 22, 2016, 08:09:03 PM
awesome.

The values were not in the spot that I thought they would be in your mission file, so this final video installment shows how I located them (and had a lucky guess)

https://youtu.be/_3glnEOW1Vs

Title: Re: Editing Addon lua files for bigger armies?
Post by: Antstafer on March 22, 2016, 08:37:45 PM
Quote from: Led on March 22, 2016, 08:09:03 PM
awesome.

The values were not in the spot that I thought they would be in your mission file, so this final video installment shows how I located them (and had a lucky guess)

https://youtu.be/_3glnEOW1Vs

Thanks once again =). If I manage to get it working tomorrow I'll be sure to upload a video (giving credit to the person to made the map as well).
EhPortal 1.34 © 2024, WebDev