Page 1 of 1
lua variable for mission era?
Posted: Sat Mar 05, 2016 12:07 am
by commanderawesome
Quick question: is there any lua variable for what era the mission is?
Re: All-Purpose Request Thread (Mk. IV)
Posted: Sat Mar 05, 2016 6:04 am
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__
Re: All-Purpose Request Thread (Mk. IV)
Posted: Sat Mar 05, 2016 2:14 pm
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.
Re: All-Purpose Request Thread (Mk. IV)
Posted: Sat Mar 05, 2016 2:32 pm
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.
Re: All-Purpose Request Thread (Mk. IV)
Posted: Sat Mar 05, 2016 2:45 pm
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.
Re: All-Purpose Request Thread (Mk. IV)
Posted: Sat Mar 05, 2016 3:32 pm
by commanderawesome
Link please.
Re: All-Purpose Request Thread (Mk. IV)
Posted: Sat Mar 05, 2016 3:57 pm
by AnthonyBF2
Re: All-Purpose Request Thread (Mk. IV)
Posted: Sat Mar 05, 2016 5:32 pm
by Anakin
Great. That way is much easier then my script things. But my mod is finished
Any way great found. Maybe this will make text removing from HUD easier.