Page 1 of 1

Loading additional ingame.lvl through custom user script

Posted: Tue Aug 23, 2011 7:53 am
by DarthD.U.C.K.
i want to replace some common models and effect through a new ingame.lvl. because i dont have the sourcefiles for the 1.2/1.3 ingame.lvl their updates dont affect the game anymore and the 1.2 weapons have no proper hudicons anymore if i replace the main ingame.lvl. therefore i tried making a custom user script that loads "ingame_2.lvl" with all the modified files whenever a map is loaded. however it doesnt seem to work.
heres my shell.req:
Hidden/Spoiler:
ucft
{

REQN
{
"script"
"user_script_11"
}
}
my user_script_11.lua:
Hidden/Spoiler:
print("user_script_1: Entered")

--attempt to take control of (or listen to the calls of) the ScriptPostLoad function
if ScriptPostLoad then
print("user_script_1: Taking control of ScriptPostLoad()...")

--check for possible loading errors
if us1_ScriptPostLoad then
print("user_script_1: Warning: Someone else is using our us1_ScriptPostLoad variable!")
print("user_script_1: Exited")
return
end

--backup the current ScriptPostLoad function
us1_ScriptPostLoad = ScriptPostLoad

--this is our new ScriptPostLoad function
ScriptPostLoad = function()
print("user_script_1: ScriptPostLoad(): Entered")

--only do these changes when in SP
--if we wanted them done in MP too, we should check to make sure that we are the server's host: ScriptCB_GetAmHost()
if not ScriptCB_InMultiplayer() then
ReadDataFile("ingame_2.lvl")
end

--make sure to forward the method call to the real ScriptPostLoad, so the game can function normally
us1_ScriptPostLoad()
print("user_script_1: ScriptPostLoad(): Exited")
end

print("user_script_1: Have control of ScriptPostLoad()")
else
print("user_script_1: Warning: No ScriptPostLoad() to take over")
print("user_script_1: Exited")
return
end

print("user_script_1: Exited")
after munging, i rename the shel.lvl to "user_script_11.lvl" and put it into battlefronts lvl_pc folder and of course copy the "ingame_2.lvl" in too.

do i have some fault in the code or is it simply not possible to replace content from the ingame.lvl through an userscript?

Re: loading additional ingame.lvl through custom user script

Posted: Wed Aug 24, 2011 4:42 am
by [RDH]Zerted
What's your debug output?

Re: loading additional ingame.lvl through custom user script

Posted: Wed Aug 24, 2011 4:51 am
by DarthD.U.C.K.
-previous content removed-
-and again-

for some reason battlefront now load the custom ingame.lvl without any problems and loads all the included files, but they dont replace anything. how can that be when a custom userscript should act as if it was the maps scriptpostload??