lua variable for mission era?

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
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

lua variable for mission era?

Post by commanderawesome »

Quick question: is there any lua variable for what era the mission is?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: All-Purpose Request Thread (Mk. IV)

Post by Anakin »

No, the only things you can use are:
__thisMapsMode__
__thisMapsCode__

from the v1.3 patch. I had the same problem, so i added a new Boolean variable for my own republic commando era. I set it in the lua script and used it in an custom user script, to do some changes only to my own era.
__thisIsRcEra__
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: All-Purpose Request Thread (Mk. IV)

Post by commanderawesome »

Anakin wrote: I had the same problem, so i added a new Boolean variable for my own republic commando era. I set it in the lua script and used it in an custom user script, to do some changes only to my own era.
__thisIsRcEra__
How would I do that? I want to make some commands do different things on mod eras than they do on the stock eras.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: All-Purpose Request Thread (Mk. IV)

Post by Anakin »

That will be difficult. try to find how these (__thisMapsMode__, __thisMapsCode__) are defined and get the era from there.
I added __thisIsRcEra__ = true to all rc lua scripts and in my custom_user_script i use if(__thisIsRcEra__) then,... to make the changes only to my mod.

But it will be harder to get it working for stock era. I couldn't find a way to get the era code, so made this work around. Start a modding thread. I'm interested in a solution, too.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: All-Purpose Request Thread (Mk. IV)

Post by AnthonyBF2 »

Anakin wrote:That will be difficult. try to find how these (__thisMapsMode__, __thisMapsCode__) are defined and get the era from there.
I added __thisIsRcEra__ = true to all rc lua scripts and in my custom_user_script i use if(__thisIsRcEra__) then,... to make the changes only to my mod.

But it will be harder to get it working for stock era. I couldn't find a way to get the era code, so made this work around. Start a modding thread. I'm interested in a solution, too.
The 1.3 source files for utility_functions2.lua and fakeconsole_functions.lua are available and I recently noticed - you can call those scripts in your mission.req as a "script" entry, and your game will load them and ignore the 1.3 scripts from the actual game's 1.3 patch files.

This means you can insert more era thingies for your own specific mod by adding them to those two scripts. You can also edit fakeconsole_fucntions.lua so that you can remove specific fake console items to prevent the player from doing something in your own mod.

Kinda unrelated - you can call many scripts in your mission.req that would normally load from ingame.lvl or common.lvl and the mission.lvl will use them instead of default ones.

I've been able to do this with;
ifs_pausemenu.lua
ifs_pc_spawnselect.lua
fakeconsole_functions.lua
points.lua
Haven't actually tried this with utility_functions2.lua but it should work.
Last edited by AnthonyBF2 on Sat Mar 05, 2016 4:00 pm, edited 1 time in total.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: All-Purpose Request Thread (Mk. IV)

Post by commanderawesome »

Link please.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: All-Purpose Request Thread (Mk. IV)

Post by AnthonyBF2 »

commanderawesome wrote:Link please.
http://www.mediafire.com/download/k3ych ... Source.zip
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: All-Purpose Request Thread (Mk. IV)

Post by Anakin »

Great. That way is much easier then my script things. But my mod is finished :D

Any way great found. Maybe this will make text removing from HUD easier.
Post Reply