[Solved] How do I delete specific missions?
Moderator: Moderators
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
[Solved] How do I delete specific missions?
Seems like this would have been asked before but I couldn't find an answer anywhere. With all the mods I want I have 519 missions. I'd be surprised if I used more than 20% of them. From what I've gathered, I need to go to the missions file located in the lvl_pc folder. But if you know what that looks like you're probably not surprised that I can't make heads or tails of it. I see stuff like YAV1, so I know that's Yavin 4, which I never use. I see stuff like CTF which I also never use.
Basically, I would like to know:
1) how to identify what mission I'm looking at
2) how to find a specific mission in the file
3) how to tell where an individual mission's code starts and ends
4) if I'm barking up the wrong tree
I'd just like to be able to create a backup of the file, and copy-paste missions in and out as I see fit (if that's even possible.) Thanks in advance for any help or solutions.
Basically, I would like to know:
1) how to identify what mission I'm looking at
2) how to find a specific mission in the file
3) how to tell where an individual mission's code starts and ends
4) if I'm barking up the wrong tree
I'd just like to be able to create a backup of the file, and copy-paste missions in and out as I see fit (if that's even possible.) Thanks in advance for any help or solutions.
Last edited by JustSomeGuy on Sun Jul 26, 2020 4:53 pm, edited 1 time in total.
-
- Private Recruit
- Posts: 25
- Joined: Mon May 18, 2020 11:11 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
I know this doesn't directly answer your question, but it would be a lot easier just to move a few mods that you don't plan on playing out of your addon folder to get you under the 500 mission limit. Considering some of my own blunders with modding, I'm don't think the game would have a good reaction if you tried to directly tamper with the core files.
There is one other solution that might be of use. On ModDB, there's a mod loader for Star Wars Battlefront II, which (in theory) should allow you to just pick the ones you want the game to load. I've never tried it, so I can't tell you if it works.
There is one other solution that might be of use. On ModDB, there's a mod loader for Star Wars Battlefront II, which (in theory) should allow you to just pick the ones you want the game to load. I've never tried it, so I can't tell you if it works.
- AnthonyBF2
- Sith
- Posts: 1255
- Joined: Wed Aug 21, 2013 3:55 pm
- Projects :: PS2+PSP Overhaul
Re: How do I delete specific missions?
The addme file for each mod is what tells the game that missions exist. Editing any other part of the mod won't achieve anything but to edit addme files, you'd need their source code, edit to remove mission entries, and compile a new one.
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
Is this something I can do with the standard mod package, or do I have to contact the mod maker for specific files?AnthonyBF2 wrote: ↑Thu Jul 23, 2020 2:15 amThe addme file for each mod is what tells the game that missions exist. Editing any other part of the mod won't achieve anything but to edit addme files, you'd need their source code, edit to remove mission entries, and compile a new one.
- Teancum
- Jedi Admin
- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: How do I delete specific missions?
You fix it just by removing some extra mod maps until you get below the number. Go to /Star Wars Battlefront II/GameData/Addon/, move some of those to a temporary folder, like maybe /Star Wars Battlefront II/GameData/TEMP/. This keeps the maps on your hard drive in case you ever want to try them by swapping them with other maps.
If you don't have the ability to do that then it's some pirate-modded version of the game, and we can't help you with that.
If you don't have the ability to do that then it's some pirate-modded version of the game, and we can't help you with that.
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
The issue is that I don't have any map specific mods. I just have 1.3 patch, 2.2 conversion patch, bfx, A New Frontier, and BusinessBill's Mandalorian mod. The mando mod, for example, adds a lot of gamemodes I don't use and I was wondering if it's possible to zero those out. (And I bought battlefront 2 on steam, my version's legit)Teancum wrote: ↑Thu Jul 23, 2020 11:23 amYou fix it just by removing some extra mod maps until you get below the number. Go to /Star Wars Battlefront II/GameData/Addon/, move some of those to a temporary folder, like maybe /Star Wars Battlefront II/GameData/TEMP/. This keeps the maps on your hard drive in case you ever want to try them by swapping them with other maps.
If you don't have the ability to do that then it's some pirate-modded version of the game, and we can't help you with that.
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: How do I delete specific missions?
How dedicated are you to accomplishing this?JustSomeGuy wrote: ↑Thu Jul 23, 2020 8:02 pm
The issue is that I don't have any map specific mods. I just have 1.3 patch, 2.2 conversion patch, bfx, A New Frontier, and BusinessBill's Mandalorian mod. The mando mod, for example, adds a lot of gamemodes I don't use and I was wondering if it's possible to zero those out. (And I bought battlefront 2 on steam, my version's legit)
It is possible (if you want to keep 'some' of the Mandalorian missions that were added), but it'll require some understanding of Lua, how the game adds maps, writing some Lua code, using the modtools and testing.
What would you say your current 'coding ability' is?
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
I have no experience with Lua, but if there are tutorials you'd recommend I'd be willing to learn.cbadal wrote: ↑Fri Jul 24, 2020 12:46 pmHow dedicated are you to accomplishing this?JustSomeGuy wrote: ↑Thu Jul 23, 2020 8:02 pm
The issue is that I don't have any map specific mods. I just have 1.3 patch, 2.2 conversion patch, bfx, A New Frontier, and BusinessBill's Mandalorian mod. The mando mod, for example, adds a lot of gamemodes I don't use and I was wondering if it's possible to zero those out. (And I bought battlefront 2 on steam, my version's legit)
It is possible (if you want to keep 'some' of the Mandalorian missions that were added), but it'll require some understanding of Lua, how the game adds maps, writing some Lua code, using the modtools and testing.
What would you say your current 'coding ability' is?
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: How do I delete specific missions?
Well OK if you want to take this as a starting point to modding, cool.JustSomeGuy wrote: ↑Fri Jul 24, 2020 5:09 pmI have no experience with Lua, but if there are tutorials you'd recommend I'd be willing to learn.
If you wanna learn the Lua version that is embedded in SWBF2, here is the the website:
https://www.lua.org/manual/5.0/
You'll also want to read through the FAQ to get started modding:
viewtopic.php?f=27&t=13806
For this specific issue you may want to consider re-writing the addme.script in the mod folder you are concerned with.
Or maybe modifying the 'sp_missionselect_listbox_contents' and 'mp_missionselect_listbox_contents' in a mod that gets processed after the Mandalorian mod you have.
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
Is it possible to reverse munge the addme file the mod comes with or will I have to try to re-create it minus the missions I don't want?cbadal wrote: ↑Fri Jul 24, 2020 7:15 pmWell OK if you want to take this as a starting point to modding, cool.JustSomeGuy wrote: ↑Fri Jul 24, 2020 5:09 pmI have no experience with Lua, but if there are tutorials you'd recommend I'd be willing to learn.
If you wanna learn the Lua version that is embedded in SWBF2, here is the the website:
https://www.lua.org/manual/5.0/
You'll also want to read through the FAQ to get started modding:
viewtopic.php?f=27&t=13806
For this specific issue you may want to consider re-writing the addme.script in the mod folder you are concerned with.
Or maybe modifying the 'sp_missionselect_listbox_contents' and 'mp_missionselect_listbox_contents' in a mod that gets processed after the Mandalorian mod you have.
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: How do I delete specific missions?
I started writing a Lua decompiler a while back and posted it in this thread:JustSomeGuy wrote: ↑Fri Jul 24, 2020 10:49 pmIs it possible to reverse munge the addme file the mod comes with or will I have to try to re-create it minus the missions I don't want?
viewtopic.php?f=64&t=33479
The tool can be useful, but in it's current state it's not great.
The addme scripts usually have functions with for loops in them (which the tool does not currently handle). So it probably won't decompile it easily.
You can give the tool a better chance at decompiling the code from a listing by just replacing the body of the (for loop containing) function listing with:
Code: Select all
1 [-] RETURN 0 1 0
Extract the luac listing by dragging the addme.script into the 'file' textbox of 'SWBF2_Tool' (and select the 'listing' option) and paste the code listing into the SWBF2CodeHelper program and see what happens.
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
I copied the listed code into the code helper. When I hit "decompile" it gives me the error:
"ERROR! OpCode TFORPREP NOT IMPLEMENTED
7 [-] TFORPREP 3 18 ; to 26"
So I replaced all TFORPREP's and TFORLOOP's with the " 1 [-] RETURN 0 1 0" code you gave me (and I replaced the 1 at the beginning with the appropriate line number.) Although it doesn't give me that error anymore, it instead gives me a more generic error message that says "Object reference not set to an instance of an object." When I click "more details" the text says the following:
(and hitting "continue" does nothing)
"ERROR! OpCode TFORPREP NOT IMPLEMENTED
7 [-] TFORPREP 3 18 ; to 26"
So I replaced all TFORPREP's and TFORLOOP's with the " 1 [-] RETURN 0 1 0" code you gave me (and I replaced the 1 at the beginning with the appropriate line number.) Although it doesn't give me that error anymore, it instead gives me a more generic error message that says "Object reference not set to an instance of an object." When I click "more details" the text says the following:
Hidden/Spoiler:
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: How do I delete specific missions?
Yep...
That can happen, it was worth a try though.
Can you paste the listing in here?
That can happen, it was worth a try though.
Can you paste the listing in here?
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
It exceeds the character limit, so here's the first half
Hidden/Spoiler:
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
and the second:
Hidden/Spoiler:
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: How do I delete specific missions?
Actually... The tool worked pretty well on that one.
I didn't get the error you posted when I replaced the (for loop) functions contents with the return statement.
the tool did miss some 'name' and 'about' fields for some reason, but those were very repetitive so copy and paste easily replicated those.
The 2 functions 'MergeTables' and 'AddNewGameModes' are commonly used in addme files and can be found by searching the forums.
I didn't get the error you posted when I replaced the (for loop) functions contents with the return statement.
the tool did miss some 'name' and 'about' fields for some reason, but those were very repetitive so copy and paste easily replicated those.
Hidden/Spoiler:
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
Wow, it's finally working. When I started looking into this I wasn't expecting it to be so complicated, but thanks for sticking through it. But before I add [solved] to the title I'd like to know what I did wrong with the decompiling so I can replicate this in the future, any ideas?
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: How do I delete specific missions?
The 2 functions defined in there 'MergeTables' and 'AddNewGameModes' Look like this in the listing:JustSomeGuy wrote: ↑Sun Jul 26, 2020 4:21 pmWow, it's finally working. When I started looking into this I wasn't expecting it to be so complicated, but thanks for sticking through it. But before I add [solved] to the title I'd like to know what I did wrong with the decompiling so I can replicate this in the future, any ideas?
Hidden/Spoiler:
Hidden/Spoiler:
-
- Private Recruit
- Posts: 16
- Joined: Wed Jul 22, 2020 4:25 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: How do I delete specific missions?
I see, I was just replacing the one line. I tested it and now it's working perfectly. Thanks for your help. I know it's blatantly obvious, but I couldn't have done it without you, every other person I asked about this just tried to give me a work-around. I know they were just trying to help, but thanks for being the only person actually willing to walk me through this.
- cbadal
- Corporal
- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: How do I delete specific missions?
I wouldn't hold it against the other members on this one.JustSomeGuy wrote: ↑Sun Jul 26, 2020 4:52 pmI see, I was just replacing the one line. I tested it and now it's working perfectly. Thanks for your help. I know it's blatantly obvious, but I couldn't have done it without you, every other person I asked about this just tried to give me a work-around. I know they were just trying to help, but thanks for being the only person actually willing to walk me through this.
I think very few people have attempted reversing the LUA code. I know how to do it only because I worked on a LUA decompiler and had have studied the listing stuff.
It's not normally a viable option.