Campaign Help (@Mav)

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
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Campaign Help (@Mav)

Post by JimmyAngler »

Hey Mav, could you teach me how to set up the basics for a campaign? I tried to add one and I failed. I also tried just copying and pasting the original Death Star Campaign into my scripts and added it in addme, but couldn't get it working either.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Campaign Help (@Mav)

Post by Noobasaurus »

You can learn by studying why and how the original SWBF2 campaign scripts are done. Take a look at how they did certain things to achieve things. For example, if you wanted an object to explode after you capture a command post, you would look in these scripts for help. In them, you'd find the correct ways to do these things, like the functions for making an event happen when you capture a command post.

I'd recommend mapping out a full campaign mission first, either by writing or drawing. This way, you know exactly what you want to happen so you can script it exactly to that. Little by little, you will make progress with it, and if you need help, feel free to post here with your error log. The reason that the death star script didn't work in your map was because there were many elements in that script that were non-existent in your map.

So ask questions if you need.
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Campaign Help (@Mav)

Post by JimmyAngler »

yes that's a good idea, but I can't seem to get even a pre-made campaign in my map.
How do I do that?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Campaign Help (@Mav)

Post by AQT »

You were successful in getting shipped Death Star conquest mode to work, yes? It's no different than getting another preexisting mode from the Death Star map to work.
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Campaign Help (@Mav)

Post by JimmyAngler »

yes, I know, but it still isn't working!!!


I get : Fatal! unable to open/MISSION/SKNc_c.lvl


my log:
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LoadUtil.cpp(1019)
Unable to find level chunk in MISSION.lvl


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(112)
OpenScript(SKNc_c): script (67e76b96) not found

Message Severity: 5
C:\Battlefront2\main\Battlefront2\Source\GameState.cpp(1283)
Could not open MISSION\SKNc_c.lvl
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Campaign Help (@Mav)

Post by AQT »

If it's not working, then 99.9% of the time you most likely did something wrong. Here, it looks like you haven't created a REQ file for the campaign .lua file you added, and/or you didn't add the name of that REQ to the mission.req file. The mission.req file can be found in the Common folder where the scripts folder is normally located. In the Common folder is also the mission folder where you can see how REQ files for stock .lua files are set up.
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Campaign Help (@Mav)

Post by JimmyAngler »

Ah ha! finally some easy to understand help.
My new req goes in the data***/common/mission right?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Campaign Help (@Mav)

Post by THEWULFMAN »

Correct. Those .REQs are then referenced in the mission.REQ.
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Campaign Help (@Mav)

Post by JimmyAngler »

ok did that, but no cps are there so I can spawn. do I need to do something in ZE?

my munge log also says this:
Hidden/Spoiler:
C:\BF2_ModTools\data_SKN\_BUILD\Common\..\..\..\ToolsFL\Bin\luac.exe: ..\..\common\scripts\SKN\SKNc_c.lua:131: function arguments expected near `\'
ERROR[scriptmunge scripts\SKN\SKNc_c.lua]:Could not read input file.ERROR[scriptmunge scripts\SKN\SKNc_c.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

ERROR[levelpack mission\SKNc_c.req]:Expecting bracket, but none was found.
File : munged\pc\sknc_c.script.req(1)...

ucft <--
ERROR[levelpack mission\SKNc_c.req]:Expecting bracket, but none was found.
File : munged\pc\sknc_c.script.req(1)...

ucft <--

2 Errors 0 Warnings
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Campaign Help (@Mav)

Post by AQT »

What else did you do to that .lua file other than renaming it? The only other thing you should be doing to get this to work at all is to change the directory where the map .lvl file/campaign layer/mode is loaded from.
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Campaign Help (@Mav)

Post by JimmyAngler »

nothing this is the only thing I changed.
Hidden/Spoiler:
ReadDataFile("SKN\\SKN.lvl", "SKNc_c")
Is it supposed to say dc:? It still doesn't work like that either.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Campaign Help (@Mav)

Post by Marth8880 »

JimmyAngler wrote:
Hidden/Spoiler:
ReadDataFile("SKN\\SKN.lvl", "SKNc_c")
Is it supposed to say dc:? It still doesn't work like that either.
Yes.
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Campaign Help (@Mav)

Post by JimmyAngler »

hmm now I get this in my munge log:
Hidden/Spoiler:
C:\BF2_ModTools\data_SKN\_BUILD\Common\..\..\..\ToolsFL\Bin\luac.exe: ..\..\common\scripts\SKN\SKNc_c.lua:131: function arguments expected near `\'
ERROR[scriptmunge scripts\SKN\SKNc_c.lua]:Could not read input file.ERROR[scriptmunge scripts\SKN\SKNc_c.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

ERROR[levelpack mission\SKNc_c.req]:Expecting bracket, but none was found.
File : munged\pc\sknc_c.script.req(1)...

ucft <--
ERROR[levelpack mission\SKNc_c.req]:Expecting bracket, but none was found.
File : munged\pc\sknc_c.script.req(1)...

ucft <--

2 Errors 0 Warnings

ERROR[levelpack mission.req]:Expecting bracket, but none was found.
File : munged\pc\sknc_c.lvl.req(1)...

ucft <--
ERROR[levelpack mission.req]:Expecting bracket, but none was found.
File : munged\pc\sknc_c.lvl.req(1)...

ucft <--

2 Errors 0 Warnings
should I post my mission.req and my SKNc_c lua and SKNc_c.req?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Campaign Help (@Mav)

Post by AQT »

Unless you went through the trouble of renaming all of the related stock Death Star world files to SKN, the name of the map .lvl file and layer it uses for campaign should remain the same. In other words, change the stuff in red:
ReadDataFile("dc:SKN\\SKN.lvl", "SKNc_c")
back to what it was originally.
JimmyAngler
High General
High General
Posts: 837
Joined: Mon Nov 04, 2013 10:37 am
Projects :: Battlefront Halation
Games I'm Playing :: SWBF 1-2-2015
xbox live or psn: none
Location: Area 51

Re: Campaign Help (@Mav)

Post by JimmyAngler »

ok no I get the Fatal could not open MISSION/SKNc_c.lvl
Is there a foolproof way of making a campaign with the mission scripter?
Post Reply