I cant Change The Weapons [Solved]

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
pk01
Recruit Womprat Killer
Posts: 12
Joined: Fri Jun 30, 2017 11:53 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

I cant Change The Weapons [Solved]

Post by pk01 »

I am having trouble change the weapon of the jet trooper. I have the rep side in my side folder and went into the rep_inf_default_jettrooper and changed the weapon1 to rep_weap_inf_rifle. I munged the sides and went to test it out but there were no changes. Does anyone know why this could be?
Last edited by pk01 on Sat Nov 25, 2017 8:37 pm, edited 1 time in total.
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

Re: I cant Change The Weapons

Post by LitFam »

Is the dc in your .lua for the side loading part?
Hidden/Spoiler:
[code]ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer")

ReadDataFile(“dc:SIDE\\rep.lvl”,
“rep_inf_ep3_jettrooper”)[/code]
pk01
Recruit Womprat Killer
Posts: 12
Joined: Fri Jun 30, 2017 11:53 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: I cant Change The Weapons

Post by pk01 »

Yes I did that but nothing happened. I tried changing the weapon of the engineer and nothing happened again.
LitFam
Sergeant Major
Sergeant Major
Posts: 234
Joined: Sat Feb 04, 2017 5:52 pm
Games I'm Playing :: SWBF II 2005
xbox live or psn: No gamertag set
Location: Milky Way, Solar System, Earth, Antarctica

Re: I cant Change The Weapons

Post by LitFam »

Could you post your .lua please?
pk01
Recruit Womprat Killer
Posts: 12
Joined: Fri Jun 30, 2017 11:53 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: I cant Change The Weapons

Post by pk01 »

This is from c_con.
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)

conquest:Start()

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptInit()

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight (30)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc: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_default_jettrooper",
"rep_hover_fightertank",
"rep_hero_yoda",
"rep_hover_barcspeeder")
ReadDataFile("dc: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")


ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_tower")

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},
}
}

SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(REP, "rep_hero_yoda")


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- 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)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:TST\\TST.lvl", "TST_conquest")
ReadDataFile("dc:TST\\TST.lvl", "TST_conquest")
SetDenseEnvironment("false")[/code]
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: I cant Change The Weapons

Post by ARCTroopaNate »

rep inf default jettrooper should be rep inf ep3 jettrooper.
pk01
Recruit Womprat Killer
Posts: 12
Joined: Fri Jun 30, 2017 11:53 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: I cant Change The Weapons

Post by pk01 »

Ok so I changed it. Now I added the dc: and got rid of jett default. But now whenever I start it up it goes to loading screen then crashes. I made a new world to see what was causing this and it was the adding dc:. What am I doing wrong?
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: I cant Change The Weapons

Post by ARCTroopaNate »

The problem isn't the DC, it's something in your sides. The fact that it's crashing now is good, it means the game is loading your custom sides. Could you post the error log that you get from running the debug version of the game??
pk01
Recruit Womprat Killer
Posts: 12
Joined: Fri Jun 30, 2017 11:53 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: I cant Change The Weapons

Post by pk01 »

The debug log is just the BFront2 text you get from running modtools right?
Hidden/Spoiler:
Opened logfile BFront2.log 2017-11-24 2158
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: Found custom_gc_8.lvl
custom_gc_8: RCM GC Entered
ifs_freeform_init_rc.lua
ifs_freeform_start_rc.lua
custom_gc_8: Taking control of custom_GetGCButtonList()...
custom_gc_8: unable to find RCM installation
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: Found custom_gc_12.lvl
custom_gc_12: RCM GC Entered
custom_gc_12: Taking control of custom_GetGCButtonList()...
custom_gc_12: unable to find RCM installation
custom_gc_10: No custom_gc_13.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
this.CurButton = check_mode1
cur_button = nil
Checkbox for check_era3 clicked
this.CurButton = check_era3
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 0565A16C
The key, value is: era_g 1
The key, value is: mode_con_c 1
The key, value is: isModLevel 1
The key, value is: bSelected 1
The key, value is: era_c 1
The key is mapluafile, the formated value is: AAA<A>_<B>
The key, value is: mode_con_g 1
The key, value is: mode_ctf_g 1
The key, value is: mode_ctf_c 1
custom_printTable(): Returning
custom_printTable(): table: 0565FD0C
The key, value is: key mode_con
The key, value is: subst con
The key, value is: showstr modename.name.con
The key, value is: descstr modename.description.con
The key, value is: icon mode_icon_con
custom_printTable(): Returning
gMapEras.key = era_c Era = era_c subst = c
Adding map: AAAc_con idx: 1
this.CurButton = Launch
cur_button = nil

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\HUDElementBitmap.cpp(380)
HUD BitmapElement unable to find texture hud_target_hint_offscreen

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\HUDElementBitmap.cpp(380)
HUD BitmapElement unable to find texture hud_target_hint_offscreen

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\HUDElementBitmap.cpp(380)
HUD BitmapElement unable to find texture btn_directional_pad_LR
game_interface: Entered
utility_functions2: Listening on AddUnitClass() calls
utility_functions2: Listening on SetHeroClass() calls
utility_functions2: Listening on ReadDataFile() calls
game_interface: Reading in custom strings
game_interface: No user_script_0.lvl
game_interface: Found user_script_1.lvl
user_script_1: entered
user_script_1: Taking control of ScriptCB_DoFile()...
user_script_1: exited
game_interface: No user_script_2.lvl
game_interface: No user_script_3.lvl
game_interface: Found user_script_4.lvl
user_script_4: entered
user_script_4: Taking control of ScriptCB_DoFile()...
user_script_4: exited
game_interface: No user_script_5.lvl
game_interface: No user_script_6.lvl
game_interface: No user_script_7.lvl
game_interface: No user_script_8.lvl
game_interface: No user_script_9.lvl
game_interface: Found user_script_10.lvl
user_script_10: Entered
user_script_10: Replacing v1.3 (r117)'s AddUnitClass as it should've had a return value. This fixes the Leia bug.
user_script_10: Found user_script_11.lvl
user_script_10: No user_script_12.lvl. Will stop searching for any more user scripts.
user_script_10: Exited
ifs_sideselect_fnBuildScreen()
game_interface: Exited

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(317)
Memory pool "ClothData" set item count after being allocated

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(1604)
Weapon base class "com_weap_inf_lightsaber" not found
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: I cant Change The Weapons

Post by Marth8880 »

pk01 wrote:The debug log is just the BFront2 text you get from running modtools right?
Correct.

As for your problem, it looks as if there's a missing weapon class that's trying to be used:

Code: Select all

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Weapon.cpp(1604)
Weapon base class "com_weap_inf_lightsaber" not found
Determine which unit class is calling for it and then find out if the weapon class actually exists somewhere.
pk01
Recruit Womprat Killer
Posts: 12
Joined: Fri Jun 30, 2017 11:53 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: I cant Change The Weapons

Post by pk01 »

I found it but what do I do with it? I don't know why this would happen because I didn't change any of the weapons except the jet trooper to getting a rifle.
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: I cant Change The Weapons

Post by Anakin »

You copied the stock REP folder right?? So you copied the Heros as well.

Code: Select all

SetHeroClass(REP, "rep_hero_yoda")
This will add yoda as a hero to your map. What you did not copy was the common folder, or you miss the single file in the common folder.

Let me start explaining the common folder to you. Pretty sure it's something the most beginning modders do not know about:
You have multiple fractions and for each you have a own lvl file such as rep, cis, ... But they all have some values in common. Such as the termaldetonator. So the base files go all to the common FOLDER(!!) if you name your file just com_inf_....odf and put it in the rep folder it won't work. So let's say the file is in the common folder those files will be merged into ALL other fraction files (rep, cis, all, imp). That's why you need to munge the common side at first everytime you did some changes and AFTER that you can munge the sides.
In your case you made a custom cis and rep side, but in your common files you miss the lightsaber (used by maul and yoda).
2 solutions:

1) remove yoda and maul completely from your custom (dc:) lvl and load them from the stock rep file instead
2) add the missing file to the common folder, remunge all sides, or munge them manuell (common first and rep + cis second)

If you ONLY want to add the rifle to the jettrooper you should ONLY add the jettrooper with all needed files to your side folder and munge it. In the lua you'll load the jettrooper from your dc:rep.lvl and the other sides from the stock lvl files (without dc).But if you just wanted to start with the jettrooper, solution 2 would be the best choice for you. To understand the structure of SWBF2 and how the files belong to each other you better start with the last option i explained to you (only jettrooper and nothing else)
pk01
Recruit Womprat Killer
Posts: 12
Joined: Fri Jun 30, 2017 11:53 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBF2
xbox live or psn: No gamertag set

Re: I cant Change The Weapons

Post by pk01 »

Thank you that worked. The problem was (I'm dumb) that I totally forgot to put a common folder in sides.
Post Reply