LUA Sides & other questions -1 reply

Please wait...

Comrade H

I don't spend enough time here

50 XP

9th January 2007

0 Uploads

19 Posts

0 Threads

#1 11 years ago

Hello,

I Have several questions, most of which directly relate to creating custom sides.This is probably going to be long but I want to be through. I will start will explaining what I do know.

*I have the custom mod tools that lucas arts released. *I have a hex editor *I have photoshop *I have read the documentation that came with the lucas arts release *I have searched several forums for my answers already.

1. Custom character/weapons If I want to make a new character here are the steps I've explored and for the most part understand. a. All character classes are inherited from some Common parent class. b. Each child class over writes some function of the original class c. The last child class, eg: inf_ep3_rifleman calls the tga skin file d. The above is basically the same for weapons, and ordinace question I) if I want to say make a variation of the clone sniper while keeping the current, I could basically make a new version of the inf ep3 sniper file, give it a different name change the stats-same for the weapon file and skin file then for what ever world I would reference that file instead correct?

2.Adding the custom Character to a side a. I know that the individual level LUA references the side's *.lvl file: ReadDataFile("SIDE\\rep.lvl", "rep_inf_ep3_rifleman", "rep_inf_ep3_rocketeer", "rep_inf_ep3_engineer", "rep_inf_ep3_sniper", "rep_inf_ep3_officer", "rep_inf_ep3_jettrooper", "rep_hero_yoda") b. I know that further down in the Level's LUA you set up teams SetupTeams{ rep = { team = REP, units = 32, reinforcements = 150, soldier = { "rep_inf_ep3_rifleman",9, 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}, (code omitted)... } } SetHeroClass(REP, "rep_hero_yoda") c. The side *.req file must include all units that the above files call on ucft { REQN { -big list- d. The *shell.req I assume is the section which determines what shows up on the menu ingame when selecting-hence the term shell? ucft { REQN { "model" "rep_inf_ep3trooper" "rep_weap_inf_rifle" "rep_inf_ep3spacepilot" "rep_weap_inf_pistol" "rep_inf_ep3heavytrooper" "rep_weap_inf_launcher" "rep_inf_ep3sniper" "rep_weap_inf_sniperrifle" "rep_inf_ep3armoredpilot" "rep_inf_clonecommander" "rep_weap_inf_chaingun" "rep_inf_ep3jettrooper" } } Question 2: If I wanted to add my custom republic sniper I created in the above example, would I need to reference him on the rep.req, repshell.req, and in the world LUA?

Question 3: It appears that the world LUA has predetermined troop spaced you have to use-solider= assualt= etc. I imagine this limits your over all unit count to six. I want to add my new sniper along side these. Do I need to create a new unit type as in: solider= assault= snipe= engineer= special= Officer= newclass=?

If so is there some place I need to go to define this new class? I know that mos eisley in assualt mode has more than six units for heros no?

3: Mission.lvl a. I know, and have with limited sucess changed one of the existing six available character classes with hex editing. This was done in the Mission.lvl file.

Question: Does this mean as well as editing the above I need to some how edit this as well?

Final question: I can't make heads or tails of visual munge. I've read the documentation many times over but can't seem to figure out how to get it to work for me. Mostly I've been trying to munge existing levels with new sides to no success.

Goal: Ultimately what I am interested in is breaking this 6 unit cap so I can add several vartions of the heavy weapons, split the engineer into medic and engineer classes, always have the pilot avaliable creating a covert ops character-im working on scripting the ability for the covert ops to steal enemy uniforms Ala wolf:et. My friends and I find that the current classes and weapons to have a little less replayablity than what we would like especially at our lan shin digs.

response: What I would like to hear is some one to point me in the right direction as far as referencing which files and where, and maybe give me a quick and dirty walk through of munging my stuff in, or link me to some good documentation.

With Love from Moscow Comrade H.

PS: Also, over here soft ware piracy is a big problem. The copy of SWBF2 doesn't have any voice clips, movies, or anything beyond what seems like the barebones to make the game work, and in single player mode I constantly get this pop up with some neon colored lettering spelling Technic, and says to press enter. Is this normal? I fear that it is pirated because any lucas arts game is usually heavy on cut scenes and FMV, further more I can't get the application of the patch to work.

Ontop of that does any one know where I can download the" xbox exclusive" content for PC? As a PC user I feel a little cheated.:smokin:




Comrade H

I don't spend enough time here

50 XP

9th January 2007

0 Uploads

19 Posts

0 Threads

#2 11 years ago

think I've found part of my answer. Been rereading through some of the visual munge instruction and related scripts. For the hunt mode to create the tuskan raiders as a selectable side they use something like

addunitclass="tuskan raider"

So I am going to experiment with the LUA file portion where it lists the classes

sniper=xxx engineer=xxx and add the addunitclass="xxx" to see if I can go over the set unit limit, or possibly using the same method they use for heros on mos eisely.




Comrade H

I don't spend enough time here

50 XP

9th January 2007

0 Uploads

19 Posts

0 Threads

#3 11 years ago

okay found myself in the setup teams script file. Looks like this is where they define the types, but could just be a list?

local typeList = { "soldier", "pilot", "assault", "sniper", "marine", "engineer", "officer", "special" }




Comrade H

I don't spend enough time here

50 XP

9th January 2007

0 Uploads

19 Posts

0 Threads

#4 11 years ago

so in the setup teams script file undercommon under my XXX data folder I added "medic", "fieldops", "pilot" and then tried to define them in the xxx.lua

looked vaguely like the standard : solider = " xxx" assault = "xxx" with the added fieldops ="xxx"

where xxx refered to the actual file, for testing and debugging purposes I juse used the ep3 engineer since that ep3 side stuff was already being looked over.

New class Failed to show in the under instant action for conquest-file i was editing was xxxc_con or something to that effect premunge.




Comrade H

I don't spend enough time here

50 XP

9th January 2007

0 Uploads

19 Posts

0 Threads

#5 11 years ago

Hmm.. Didn't add it to the repshell.req that might be the problem? not sure how i'd include that in the munge though.




Comrade H

I don't spend enough time here

50 XP

9th January 2007

0 Uploads

19 Posts

0 Threads

#6 11 years ago

Voila the boy figures out the solution himself.

For those of you that wish to add new characters to the existing characters one can choose from an in instant action mode here is all you need to do-much simpler than I though.

1.Use visual munge to create a new template world-run from the start bar as opposed to inside another worlds build directory-

2. Enter your xxxdata folder, where xxx is your world's three letter code.

3. go to common folder

4. go to the scripts folder

5. go to your worlds code letter folder

6. Find the lua script file for which ever mode you are wishing to edit - in my case I wanted to edit xxxc_con and xxxg_con.lua -where xxx was my three letter world code -where the c following xxx means clone wars era -where the g following xxx was galatic wars era

7. scroll down to the load data area should look something like this

ReadDataFile("sound\\yav.lvl;yav1cw") ReadDataFile("SIDE\\rep.lvl", "rep_inf_ep3_rifleman", "rep_inf_ep3_rocketeer", "rep_inf_ep3_engineer", "rep_inf_ep3_sniper", "rep_inf_ep3_officer", "rep_inf_ep3_jettrooper", "rep_hover_fightertank", "rep_hero_anakin", "rep_hover_barcspeeder") ReadDataFile("SIDE\\cis.lvl", "cis_inf_rifleman", "cis_inf_rocketeer", "cis_inf_engineer", "cis_inf_sniper", "cis_inf_officer", "cis_inf_droideka", "cis_hero_darthmaul", "cis_hover_aat")

8. Add the folllowing new read sections in addition to the previos-im my test run I simply added a storm tropper to the Rep side, and Rebel to the CIS

ReadDataFile("sound\\tat.lvl;tat2gcw")*****make sure you load sounds ReadDataFile("SIDE\\all.lvl", "all_inf_rifleman")

ReadDataFile("SIDE\\imp.lvl", "imp_inf_rifleman")

9. Further down, find the setup teams section. It should look exactly like the following

SetupTeams{ rep = { team = REP, units = 20, reinforcements = 150, soldier = { "rep_inf_ep3_rifleman",9, 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}, }, cis = { team = CIS, units = 20, reinforcements = 150, soldier = { "cis_inf_rifleman",9, 25}, assault = { "cis_inf_rocketeer",1, 4}, engineer = { "cis_inf_engineer",1, 4}, sniper = { "cis_inf_sniper",1, 4}, officer = {"cis_inf_officer",1, 4}, special = { "cis_inf_droideka",1, 4}, } }

For those of you who don't have a background in programming-I do in c# and java- the { <--curly brackets can cause problems here.

If you look at the above you will notice that the SETUP TEAMS line's bracket encloses all other brackets

SETUPTEAM{ then inside the next layer of brackets we have the faction

SETUPTEAM{ REP{ at which point they provide us with handy premade classes we can just fill i n the blanks for. Except there are not more than the standard blanks, and as I found out it's far harder to create a new blank then to simply work around them.

For now we are going to leave those as they are because we aren't changing the set classes-thats far to easy- we want to add a new class to the existing ones!-

10. So what we will do next is close off the brackets for the Republic team

SETUPTEAM{REP{ classes={xxx} } As you can tell from above they only close off the REP side and not the setup teams Bracket. Since the command we are going to use is not a function of setup teams we want to close that area up by adding another closing bracket

Setupteam{rep{classes={xxx} } } <-- now it tells the computer we are completely done with that train of thought, so now we can feed it a new command more or less. In the actual code it should look exactly like the following before moving on

SetupTeams{ rep = { team = REP, units = 20, reinforcements = 150, soldier = { "rep_inf_ep3_rifleman",9, 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}, }, } 11.So what we want to add is a new unit class, which we will define with a character we've made or simply add some one from a different map. NOW REMEMBER THIS CLASS MUST BE ONE YOUVE LOADED INTO READ DATA-SEE STEP 8

During set 8 we added this line which told the computer to read from the side's file-where obviously teams keep their information about the soliders and told it to load an imperial rifleman--->imp_inf_rifleman ReadDataFile("SIDE\\imp.lvl", "imp_inf_rifleman")

12. Now that the computer has that class stored in memory we want to use it so you simply add the following line in this exact format below where you closed off the last bracket from the setup teams

SetupTeams{ rep = { team = REP, units = 20, reinforcements = 150, soldier = { "rep_inf_ep3_rifleman",9, 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 is the line---> AddUnitClass(REP,"imp_inf_rifleman", 1,2)

*where REP equals the side he's on in THIS battle, 1 is the min on the field, 2 is the max on the battlefield

13. Now were almost finished. Except! most of the LUA files for missions do not close off the setup teams brackets like we did. Since for the CIS side it was using the setup teams bracket, we will have to open a new set up teams bracket by adding this*SetupTeams{ above the CIS={ so it should look like:

SetupTeams{ rep = { team = REP, units = 20, reinforcements = 150, soldier = { "rep_inf_ep3_rifleman",9, 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}, }, } **********the bracket we added to close off setup teams AddUnitClass(REP,"imp_inf_rifleman", 1,2)***our new unit

SetupTeams{ **********reopening the setup teams cis = { team = CIS, units = 20, reinforcements = 150, soldier = { "cis_inf_rifleman",9, 25}, assault = { "cis_inf_rocketeer",1, 4}, engineer = { "cis_inf_engineer",1, 4}, sniper = { "cis_inf_sniper",1, 4}, officer = {"cis_inf_officer",1, 4}, special = { "cis_inf_droideka",1, 4}, } } ****finally closing the setup teams again SetHeroClass(CIS, "cis_hero_darthmaul")***adding heroes SetHeroClass(REP, "rep_hero_anakin")

Closing notes. I imagine you add as many units as you like for either side. I do not believe there is a paticular place where YOU have to place the add unit command, infact you probably could avoid the whole opening and closing brackets and just add it below next to the SetHeroClass , but I like to stay organised, and keep related elements together.