Page 2 of 2

Re: Server Mods

Posted: Wed Sep 09, 2009 9:55 pm
by myers73
Zerted, where can I find your docs? I cant seem to find relevant information in the docs that came with 1.3-2.2

Re: Server Mods

Posted: Wed Sep 09, 2009 10:42 pm
by Maveritchell
myers73 wrote:Zerted, where can I find your docs? I cant seem to find relevant information in the docs that came with 1.3-2.2
GameData\addon\AAA-v1.3patch\docs\howtos

-has the relevant information. The document is called "Make Custom User Scripts."

Re: Server Mods

Posted: Sat Sep 12, 2009 3:14 pm
by myers73
Make Custom User Scripts wrote:2) Then you need to pick a user script slot. The slots are from zero to ten. This guide will use slot four: "4". If you plan to distribute your scripts to others, it is best to copy your files and munge a custom lvl for each slot. This way, the user can decide which slot to use if he or she already has other user scripts in different slots.
so I do ^this^ in the name user_script_X where X is the slot?
Make Custom User Scripts wrote:4) user_script_4.lvl must, at the very least, contain the lua script: "user_script_4". When your custom lvl is processed by the game, it will load only this script. You can always include more scripts or resources in the lvl if you need them, but the expected script (user_script_4) must load them (use ScriptCB_DoFile() or ReadDataFile()).
^this^ is very broad. So how would the lua here be setup, and could I set it up for each map in one script. And would I need to reference the map-that-is-loading's lua(dont think i would need to).

Don't keep reposting the same thing and deleting your old post just to bump the topic. -Staff

EDIT
Staff, im am not in double posting out of neglect for rules, but you told me not to update the above post again. Just trying to please you, not make a scene about nothing.

So thanks to Mav, I located the example script for the user_sript. Please tell me if this script will work in giving all the classes included the amount of health specified, or tell me where the SetClassProperty() should be if not where it is.

my script:
Hidden/Spoiler:
[code]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
--build the FakeConsole list
ff_rebuildFakeConsoleList()

--do the FakeConsole commands we want to happen each time a new map starts (when ScriptPostLoad() is normally called)
ff_DoCommand( "Lock Vehicles" ) --prevents everyone from entering vehicles (not good on space maps...)
ff_DoCommand( "Remove Award Effects" ) --no more graphical hues or annoying sounds when you get awards
SetClassProperty("rep_inf_ep2_rifleman", "MaxHealth", 120)
SetClassProperty("rep_inf_ep2_rocketeer", "MaxHealth", 120)
SetClassProperty("rep_inf_ep2_sniper", "MaxHealth", 120)
SetClassProperty("rep_inf_ep2_engineer", "MaxHealth", 120)
SetClassProperty("rep_inf_ep2_jettrooper", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_rifleman", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_rocketeer", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_sniper", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_engineer", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_officer", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_jettrooper", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_sniper_felucia", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_pilot", "MaxHealth", 120)
SetClassProperty("rep_inf_ep3_marine", "MaxHealth", 120)
SetClassProperty("cis_inf_rifleman", "MaxHealth", 120)
SetClassProperty("cis_inf_rocketeer", "MaxHealth", 120)
SetClassProperty("cis_inf_sniper", "MaxHealth", 120)
SetClassProperty("cis_inf_engineer", "MaxHealth", 120)
SetClassProperty("cis_inf_officer", "MaxHealth", 120)
SetClassProperty("cis_inf_droideka", "MaxHealth", 120)
SetClassProperty("cis_inf_pilot", "MaxHealth", 120)
SetClassProperty("cis_inf_marine", "MaxHealth", 120)
SetClassProperty("all_inf_rifleman", "MaxHealth", 120)
SetClassProperty("all_inf_rocketeer", "MaxHealth", 120)
SetClassProperty("all_inf_sniper", "MaxHealth", 120)
SetClassProperty("all_inf_engineer", "MaxHealth", 120)
SetClassProperty("all_inf_officer", "MaxHealth", 120)
SetClassProperty("all_inf_wookie", "MaxHealth", 120)
SetClassProperty("all_inf_rifleman_jungle", "MaxHealth", 120)
SetClassProperty("all_inf_rocketeer_jungle", "MaxHealth", 120)
SetClassProperty("all_inf_sniper_jungle", "MaxHealth", 120)
SetClassProperty("all_inf_rifleman_snow", "MaxHealth", 120)
SetClassProperty("all_inf_rocketeer_snow", "MaxHealth", 120)
SetClassProperty("all_inf_sniper_snow", "MaxHealth", 120)
SetClassProperty("all_inf_engineer_snow", "MaxHealth", 120)
SetClassProperty("all_inf_officer_snow", "MaxHealth", 120)
SetClassProperty("all_inf_wookie_snow", "MaxHealth", 120)
SetClassProperty("all_inf_pilot", "MaxHealth", 120)
SetClassProperty("all_inf_marine", "MaxHealth", 120)
SetClassProperty("imp_inf_rifleman", "MaxHealth", 120)
SetClassProperty("imp_inf_rocketeer", "MaxHealth", 120)
SetClassProperty("imp_inf_sniper", "MaxHealth", 120)
SetClassProperty("imp_inf_engineer", "MaxHealth", 120)
SetClassProperty("imp_inf_officer", "MaxHealth", 120)
SetClassProperty("imp_inf_darktrooper", "MaxHealth", 120)
SetClassProperty("imp_inf_rifleman_snow", "MaxHealth", 120)
SetClassProperty("imp_inf_rocketeer_snow", "MaxHealth", 120)
SetClassProperty("imp_inf_sniper_snow", "MaxHealth", 120)
SetClassProperty("imp_inf_engineer_snow", "MaxHealth", 120)
SetClassProperty("imp_inf_pilot", "MaxHealth", 120)
SetClassProperty("imp_inf_marine", "MaxHealth", 120)


--give humans a health regeneration
ff_healthRegen( 15, "humans" )

--clear the FakeConsole table to save memory
gConsoleCmdList = {}
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")[/code]
HTML strips out extra whitespace. Use code tags to view indentation. Also, if you didn't change the example version, there is no reason to post it. ~Staff

Re: Server Mods

Posted: Sat Sep 12, 2009 4:56 pm
by [RDH]Zerted
I don't think your map has all of those unit classes in it...

The v1.3 patch keeps track of all the unit classes added to the map. It stores them in the table uf_classes. If you aren't adding new unit classes to the teams after the map starts, you can just use that table instead of manually typing all those unit classes:

Code: Select all

--set the max health to 120 for all added unit classes
for i=1,table.getn(uf_classes) do
    SetClassProperty(uf_classes[i], 'MaxHealth', 120)
end
Other then that, the code seems fine. Go test it. The way you have it written, it will only change the health when in singleplayer. Did you want it that way?

Re: Server Mods

Posted: Sat Sep 12, 2009 5:01 pm
by myers73
no, I want a multiplayer version too. I say where that is changed, but forgot to ask how exactly to change it. Thanks a bunch Zerted and Mav for the help and great documentation. I dont have time to test now as I am doing a project for AP history. Hopefully i can test tomorrow.

EDIT: found some break time and tested. Works like a charm. Now I just need to get it working in multiplayer and tweek the health. A bothan rips through people at 120.