here is my moddification so far of the user_script_1
Hidden/Spoiler:
[munge log]
Hidden/Spoiler:
does anyone know...
Moderator: Moderators


Code: Select all
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
ScriptCB_GetAmHost()
ScriptCB_InMultiplayer()
ff_rebuildFakeConsoleList()
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 <------Why?--------------------------------------------------------------------------
print("user_script_1: Have control of ScriptPostLoad()")
else <---- because, this else doesnt have a parent if-----------------------------------------
print("user_script_1: Warning: No ScriptPostLoad() to take over")
print("user_script_1: Exited")
return
end
print("user_script_1: Exited")



(i never tryed making one of these before and got no clue how...)501st_commander wrote:Your welcome.
Next time, look the code and use common logic![]()
i need to get my luaeditor done......