NO Lua_scripting_guide.doc

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
mnl1121

NO Lua_scripting_guide.doc

Post by mnl1121 »

in the getting started document it says:

"Detailed information about the scripts can be found in the documents folder in Lua_scripting_guide.doc."

but theres no document for that. i REALLY need it b/c i need to know what the names of vehicles are to add them and lots of other stuff. (this would probably solve my vehicle spawn issues)

does anyone else have this document? and how could i get it if anyone else does?

all help is GREATLY appricieated.

EDIT: was it just called something different?
Captain_Mazda

Post by Captain_Mazda »

Vehicles:

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_aalya",
"rep_hover_barcspeeder",
"rep_hover_swampspeeder",
"rep_walk_oneman_atst",
"rep_fly_anakinstarfighter_sc",
"rep_fly_arc170fighter_sc",
"rep_fly_gunship",
"rep_walk_atte")

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_grievous",
"cis_hover_aat",
"cis_walk_spider",
"cis_tread_hailfire",
"cis_hover_stap",
"cis_tread_snailtank",
"cis_fly_tridroidfighter",
"cis_fly_droidfighter_sc",
"cis_fly_droidgunship")

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_luke_jedi",
"all_hover_combatspeeder",
"all_fly_snowspeeder",
"all_fly_gunship_sc",
"all_fly_awing",
"all_fly_xwing_sc")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_darthvader",
"imp_fly_destroyer_dome",
"imp_fly_tiefighter_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_hover_speederbike",
"imp_walk_atst",
"imp_hover_fightertank",
"imp_walk_atat")

Mobile CPs:

Imagine you want 4 AT-ATs in your map. This is what you do:

1. Place the vehicle spawns in ZoneEditor. When all 4 possess the "imp_walk_atat" code, make sure they all belong to Team 1.
2. Save your map.
3. Go into your XXXg_con LUA script and scroll down here:

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

AT-ATs have 2 pairs of legs, so make sure it looks like this:

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 4) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

There you have it. The 4 stands for 4x2 amount of legs on the map. 4 AT-ATs = 8 legs.

4. Scroll down to this part next:

local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)

Press enter under the last line. Type this in:

SetMemoryPoolSize("CommandWalker", 4)

It should look like this now:

local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("CommandWalker", 4)

5. Save your script. Munge your map and have fun with your mobile CPs.
Captain_Mazda

Post by Captain_Mazda »

In addition, do the same for AT-TEs, but instead of writing the numbers on the "x2 pairs of legs" lines, write them for x3. Like this:

-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 4) -- 3x2 (3 pairs of legs)
mnl1121

Post by mnl1121 »

WOW thanks Mazda. ur the best! i just don't get what happened to my document.
thx. i really appreciate it alot.

is that the whole document? im assuming it is
Captain_Mazda

Post by Captain_Mazda »

Well, no. The name of the document is "Battlefront II Mission LUA Guide". See if you have it.

I just wrote those in answer to your vehicle problems :D
mnl1121

Post by mnl1121 »

yeah i have that one
oh so u don't have the one i might need. oh well. if i have problems can i PM u?
Captain_Mazda

Post by Captain_Mazda »

Correct me if I'm wrong, but "Battlefront II Mission LUA Guide" is the only LUA scripting guide for the mod tools. The other one is for mission scripting.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Post by [RDH]Zerted »

Battlefront II Mission LUA Guide, Battlefront II Space LUA Guide, and Battlefront2 Scripting System are scripting guides.

I've started making a scripting API, but I can only create it in terms of how each functions/events are used throughout the game. I can't determine the type of filters on events not in the Battlefront2 Scripting System, so I'm not sure if I should keep working on it...
aconzihc

Post by aconzihc »

Can anyone expain why vehicles will spawn for one era but not the next?

My Clone Era vehicles spawn just fine....I cannot for the life of me figure out why the Galactic Civil War Era vehicles won't spawn.
mnl1121

Post by mnl1121 »

Battlefront II Mission LUA Guide, Battlefront II Space LUA Guide, and Battlefront2 Scripting System are the only scripting guides but in the Getting Started guide it says go to the Lua_scripting_guide.doc for more information regarding lua scritpting but there isn't one.

oh and aconzihc did u add the vehicles in the modidg_con.lua? b'c the clone wars and the GCW are two different scripts. though i don't know if im right or not.
Krun

Post by Krun »

[RDH]Zerted wrote:Battlefront II Mission LUA Guide, Battlefront II Space LUA Guide, and Battlefront2 Scripting System are scripting guides.

I've started making a scripting API, but I can only create it in terms of how each functions/events are used throughout the game. I can't determine the type of filters on events not in the Battlefront2 Scripting System, so I'm not sure if I should keep working on it...
This would be very useful :)
Down_U_Go

Post by Down_U_Go »

how do u get to the vehicles
aconzihc

Post by aconzihc »

mnl1121...

Yes....I've added the necessary lines there.

I'll keep tinkering.
Post Reply