How to edit class scripts for vanilla maps?

Started by Gizzmo, January 20, 2019, 03:02:11 AM

Previous topic - Next topic
Just gotten into modding this game, and have the mod tools

My goal for now is to make the republic rep_inf_ep3_sniper_felucia into rep_inf_ep3_sniper
I've gotten it to work easily for my own custom map, however I've had no luck with vanilla maps.

Note: this is not my end goal, just a quick way to test how to do this so I edit a lot more with the maps.

I've added kas2c_con.lua into Data_(my map)/Common/scripts/KAS
with the changes being:

ReadDataFile("SIDE\\rep.lvl",
                                 "rep_inf_ep3_rifleman",
                                 "rep_inf_ep3_rocketeer",
                                "rep_inf_ep3_sniper",
                                "rep_inf_ep3_engineer",
                                "rep_inf_ep3_jettrooper",
                                "rep_inf_ep3_officer",
                                "rep_hero_yoda",
                                "rep_hover_fightertank",
                                "rep_fly_cat_dome",
                                "rep_hover_barcspeeder")
and

    SetupTeams{

        rep={
            team = REP,
            units = 29,
            reinforcements = 150,
            soldier = {"rep_inf_ep3_rifleman",10, 25},
            assault = {"rep_inf_ep3_rocketeer",1, 4},
            engineer = {"rep_inf_ep3_engineer",1, 4},
            sniper  = {"rep_inf_ep3_sniper",1, 4},
            officer = {"rep_inf_ep3_officer",1, 4},
            special = {"rep_inf_ep3_jettrooper",1, 4},

This works on my own map but not on vanilla maps, so there must be another thing I need to change.
I also edited the mission.req in Data_(my map)/Common, adding:

REQN
    {
        "lvl"
        "SKAg_con"
        "SKAc_con"
   "kas2c_con"
    }

I'm still not getting any luck, could anyone point out what I'm missing?


Did you add a req file for it in Common/mission?
Did you modify your addme file to also load the script for the stock map?


Seeing how it is kas2c_con, there should be a req file already in your Common folder.

Go to data_yourmap/addme and open the addme.lua and read through this: http://www.gametoast.com/viewtopic.php?p=350615#p350615
before editing it to make sure it doesn't mess with your other mods.
The code below should work for your addme.
[spoiler]
--add my modes to the singleplayer map selection screen

AddNewGameModes( sp_missionselect_listbox_contents, "kas2%s_%s", {era_c = 1, mode_con_c = 1,} )
-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier.  the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("kas2","kas2c_con",4)
[/spoiler]


Add it in the appropriate place, and after that, munge the addme and make sure you copy the munged addme.script from your addme/munged folder to your mod folder in addon.