Page 1 of 1
user scripts
Posted: Sun Feb 20, 2011 12:49 pm
by Dakota
ok i have been trying to make a custom user script for the past week but i can't get it to work (or even munge fully) how would i make one i am working with the one in the example thing for the 1.3 patch. i read both of the documents about it and still have no idea how to use or make one. i want it for my dedicated server for cp locking.
here is my moddification so far of the user_script_1
plase help me (wow maybe i should have added an extra please...)
[munge log]
i just checked the all you need to know thread i didn't find anything...
does anyone know...
Re: user scripts
Posted: Sun Feb 20, 2011 8:57 pm
by 501st_commander
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")
Re: user scripts
Posted: Sun Feb 20, 2011 8:59 pm
by Dakota
Re: user scripts
Posted: Sun Feb 20, 2011 9:02 pm
by 501st_commander
Your welcome.
Next time, look the code and use common logic
i need to get my luaeditor done......
Re: user scripts
Posted: Sun Mar 13, 2011 10:15 pm
by Dakota
501st_commander wrote:Your welcome.
Next time, look the code and use common logic
i need to get my luaeditor done......
(i never tryed making one of these before and got no clue how...)
well time to test
(i hope that lua editor you are making gets finished soon and is susscessfull i really need it...)
EDIT: ok new problem the script still won't work (i probably did something wrong i need an example of what the script should look like)
here is my munge log and script
munge log
Script
(once again i think i need a step by step tutorial, i am good at odfs but i fail horribly in scripting)
can someone please help its been awhile...
been about a month, i know, but i still really need some help with this.