Page 1 of 2

Serverside Weapons + Misc. Mod

Posted: Wed Sep 14, 2005 10:28 pm
by Kiko
I know there are tons of mods up for download, but not this specific...

Is there anyway someone could make this mod for me???



===========================




No Rockets
No Shotgun
No MG/SMG
No Pistol
Allied and Axis Rifles Exactly Equal (One Hit Kill, Balanced to the original axis rifle...)
Allied and Axis Snipers Exactly Equal (One Hit Kill, Balanced to the original axis sniper...)
2 Grenades


===========================


In the bottom left hand side I want it to show three different messages (not at the same time, but like it should post one, wait 3 seconds and post the next)

1st one

"Do not accuse anyone of hacking, ask a TH or L3 to spec them"

2nd one

"Do not ask to join, we will ask you"

3rd one

"Do not swear, you will be kicked"


===========================


Umm that's pretty much all :) Thanks!!!

Posted: Thu Sep 15, 2005 2:22 am
by LiquorKraZy
you can do all that with Elgan's admin pro...its got alot of nice features and the weapons limiter would be great in your case!

Posted: Thu Sep 15, 2005 2:56 am
by Kiko
I tried it... didn't like it much.

Posted: Thu Sep 15, 2005 3:13 am
by LiquorKraZy
well...for the weapons...you'll get the same results either way, except with Elgans AP everything will run faster and more efficiently...as for the messages...you could use Foresight or maybe someone here can script them for you...i know how to script them but not sure how to make them appear at the bottom lefthand side...

Posted: Thu Sep 15, 2005 3:18 pm
by Kiko
I'm sorry, I just tried it... it's kinda crappy with what I've used it... :(

so no one will build this mod for me? not even for an internet hug?


<<< crys >>>

Posted: Fri Sep 16, 2005 12:50 am
by LiquorKraZy
i'd make it for you...but for the weapons id use AP for it and you dont like AP...which really boggles my mind...

Posted: Fri Sep 16, 2005 1:21 am
by GiffE1118
i dont like ap either fyi, i mean its good and cool but i have my reasons

1. makes all the servers the same. every server has the same mods.
2. i like using my own stuff even if some1 else has done better

Posted: Fri Sep 16, 2005 3:39 am
by LiquorKraZy
well yea...i understand that...but taking away weapons and modding weapons all comes down to the same outcome whether you do it one or another..only in this case Elgans AP weapons limiter is by far the fastest and most efficient mod that i've seen...i agree on the aspects of some other parts of AP as there are some i dont like either...but why take the road less traveled in this case!

Posted: Fri Sep 16, 2005 11:23 am
by Elgan
i totaly agree also with all said.

However admins can customize every mod enough to make it their own, in effect servers are never the same.

ty for kind words, and for messages, do a search on HUD. for weapons stuff edit tik's. do a search for weapons tik.

try here

Posted: Fri Sep 16, 2005 7:36 pm
by GiffE1118
now if ap could have weapon settings like veiw kick, amno, dmg, and firedelay all setable then i would swear by it.

I only think it kinda brings them the same because when ppl have the option to have more they usually have it on lol
and most ppl dont know enough to do anything to make them different so they all glow the same green at spawn and all camp for the same ammount of time and all can give out the same ammount of heath only because ppl dont know anything,

Just kinda overwhelimg amount of stuff.

i agree it is the best way to change weapons and do alot of stuff like petey said. its alot more conveinient.

btw elgan that site is long since been deleted blazinmohaa.com is his new one.

Posted: Fri Sep 16, 2005 8:12 pm
by Elgan
GiffE1118 wrote:now if ap could have weapon settings like veiw kick, amno, dmg, and firedelay all setable then i would swear by it.

I only think it kinda brings them the same because when ppl have the option to have more they usually have it on lol
and most ppl dont know enough to do anything to make them different so they all glow the same green at spawn and all camp for the same ammount of time and all can give out the same ammount of heath only because ppl dont know anything,

Just kinda overwhelimg amount of stuff.

i agree it is the best way to change weapons and do alot of stuff like petey said. its alot more conveinient.

btw elgan that site is long since been deleted blazinmohaa.com is his new one.
oh, ty.

I thought about ammo, and ammo for nades etc., i might consider it. i also thought about a server side realism toggle. wud be easier with a client but o well. I'll think about it. I would have to change the weapons properties each time its swapped.

Posted: Sat Sep 17, 2005 12:44 am
by GiffE1118
in the raise weapon couldnt u add a exec so that it get his weapon then applys the properties. since even if you trade the gun u still gotta raise it again. so everytime ya pick it up it sends off the weapons stuff.

for the realism toggle do ya mean for AA, since sh and bt have a realism var already

Posted: Sat Sep 17, 2005 12:38 pm
by Elgan
yes but each time they swap, pick up. do anytrhign with the weapon u wud have to set them again

Posted: Sat Sep 17, 2005 5:17 pm
by GiffE1118
doesnt everytime u swap or pick up a gun u raise it again.
so in the raise weapon cmp u add a exec to change the guns settings

just tell me how i can change the settings and ill give it a shot :)

is it one of those dual weapon cmd's?

can u just list the cmd's i need to set

fire delay, viewkick, dm dmg, zoom, dm amno, and clip size

Posted: Sat Sep 17, 2005 6:49 pm
by Elgan
well u cud easily make a add on to admin pro that does that. You could even make it switchable on and off via console and make all its cmds via console.

I will talk you through the whole process :D. The mod wil add to the state file as a new script under weapons raise.

i will call this mod "custom", you can use whatever name you like. I have yet to write all this in the help files so any q's, ask.

I will cover adding "custom" to the state file as well as the mods.txt. I will also create a custom settings file and cover the commands for getting the info from the settings file. in "custom" i will also show u how to make the mod turn on and off via console by adding 1 or 2 lines of check script. ALl the console and cvar handling is done for you.


Stage A, Creating the script.

How to make a script that gives a weapon a custom dmbulletdamage and firedelay

1. Create a script named custom.scr. Place this script in global. The full path of this script will now be global/custom.scr

2. Open the script up and add the main thread. The self object of the thread will eb the player as it is executed from the state files everytime a weapon is changed/picked up. 'raised'.

Code: Select all


main:

end

First we want to check if the mod is "on". If it's not then we exit. TO do this we check the level.run array. This array has all the mods on and off settings. the settings are in a string, However thats no problem. 1 is on and 0 is off.

We acess the mod we want with the name of the mod.

Code: Select all


main:

	// If custom is not on then exit
	if(level.run["custom"] != "1")[end}

end

ok, thats it for on and off checking. If the mod is turned off in console this will update and the mod will stop running.

Now we must script some actual behaviour. to get settings we just exec the settings.scr:;getcmd and wait for the result. Thats easy :D. However you will probably want damn weapon specific settings. Well i didnt really write a clean way to add weapon specific mods yet. as i didnt think i would use it more then once. However this would be the 3rd time its been in use.

The script below. Gets a list of specific weapons from a weapon specific list in the settings file linked with this mod. game.file ["custom"]

It then loads the weapons into the main commands list and keeps track of where they are. THen when it needs a weapon it loops through and find it, It then returns the setting. if the setting is 0 . Then nothing is set to change and it doesnt change anything.

Code: Select all


main:

	// If custom is not on then exit
	if(level.run["custom"] != "1")[end}

	//Mod is on if we got this far.


	// get the new damamge for the weapon
	local.settings =  waitthread check_weapon self 

	// the first damage bit is the first setting in the array
	local.damage =  int local.settings[0]
	local.firedelay =  int local.settings[1]

	// if a new damage is set then change it to new setting
	if(local.damage != 0)
	{
		self weaponcommand duel dmbulletdamage  local.damage
	}

	// if a new firedelay is set then change it to new setting
	if(local.firedelay != 0)
	{
		self weaponcommand duel dmfiredelay local.firedelay
	}
end

check_weapon local.player:

	if(local.player.dmteam=="spectator" || local.player == NIL || local.player == NULL)
	{
		end
	}

	// if the setting aare missing load them
	if(game.custom_weapons==NIL)
	{
		waitthread load_weapons 
	}

	self.weapon = NIL	

	self waitexec global/get_weapon.scr

	// determine the weapon of the player. 
	local.true = 1
	for(local.true =0;local.true <= 1; local.true++)
	{
		wait 1
		if(self.weapon==NIL)
		{
			while(self.weapon==NIL)
			{
				if(self == NULL || self == NIL)
				{
					end
				}
				waitframe
			}
		}

		if(self.weapon != "models/weapons/unarmed.tik")
		{
			local.true = 2
		}

		waitexec global/get_weapon.scr

	}

	// check for the weapon in the settings list and return the parameter for damage.
	

	for(local.load=game.custom_weap_start;local.load<=game.all_commands.size;local.load++)
	{
		if((self.weapon + "-custom") == ("models/weapons/" + game.all_commands[local.load][1]))
		{
			// return new settings
			local.custom[0] = game.all_commands[local.load] [2]
			local.custom[1] = game.all_commands[local.load] [3]
			end local.custom
		}
	}

end

load_weapons:

	// Load the settings depending on the game
	switch(game.game)
	{
	case "AA":
		game.custom_weapons =  waitexec game.file["custom"]::weaponsaa
	break
	case "SH":
		game.custom_weapons =  waitexec game.file["custom"]::weaponssh
	break
	case "BT":
		game.custom_weapons =  waitexec game.file["custom"]::weaponsbt
	break
	}

	// crea a game variable to keep track of the setting.
	local.i = game.all_commands.size
	game.custom_weap_start = local.i

	for(local.n=1;local.n<=game.custom_weapons.size;local.n++)
	{
		local.i++
		for(local.s=1;local.s <= game.custom_weapons[local.n].size; local.s++ )
		{
			if(local.s == 1)
			{
				game.all_commands[local.i][local.s] = (game.custom_weapons[local.n][local.s] + ".tik-custom")
			}
			else
			{
				game.all_commands[local.i][local.s] = (game.custom_weapons[local.n][local.s])
			}
		}
	}
end


If something is found then the new damage is given to the weapon. etc


Stage b. Settings

ok. now your script is there. Now we have to make the settings file. We also have add the mod "custom" to the mods.txt or it wont get loaded and nothing will work because level.run["custom"] will not be 1.

ok, lets add it to the mods.txt mod array. THis is simple adding like the others. It MUST be named custom, The same as in the script so it can link with gamefile and level.run. The map list etc can be whatever you like. THe pat to the script can be "none" also because it is loaded by the state file. The setting file can be wherever you like also as long as that is actualy where you add it. game.file contains the pat to the settings file for the mod.

So now lets add it.

Code: Select all

main:		//					 |
	local.scripts = makearray //                     |
		//				        \|/
		// Mod Name			// ON or Off. ( "1" = ON. "0" = OFF)		//Help and about								//Path	to mod script, Set "none" if none.			//Maps list ("all" for all maps)				// game type list ("all" for all game types.				// Settings file. Specify the path to the settings file				// Map Specific
		//-----1---------------------------------2---------------------------------------------------3-----------------------------------------------------------------------------4-------------------------------------------------------------------5----------------------------------------------------------------------6----------------------------------------------------------------------------7-------------------------------------------------------------8----------------------------------------------------------------------------------------------------------------------------------------------------------------
		"weapons-limiter"			"0"					" limit weapons or just take, swap them"					weapon_limit/weapons_limiter.scr				all								all											settings/weapons-limiter						"0"								
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"spawn-protection"			"1"					" Protect spawning in AA. Wont run in SH or BT"					global/ac/spawn_protection_setup.scr				all								all											settings/spawn-protection 						"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"camper" 				"0"  					" Turns camper on and off 1=On, 0 = OFF"					global/anti_camper.scr						all								all											settings/camper								"0"			
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"cvar-forcing"				"0"					" Turns cvar forcing on or off. 1= on, 0 = off"					global/ac/cvar_forcer.scr					all								all											settings/cvar-force							"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"team-balance"				"0"					" Turns Jim's team balance on or off. 1= on, 0 = off"				global/ac/team_balance.scr					all								settings/team-balance.txt::gametypes							settings/team-balance							"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"music"					"0"					" Play music to players depending on settings"					global/ac/music.scr						all								all											settings/music								"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"mines"					"0"					" Random, stickybombs, proimity, plant mines"					global/ac/mines/mines.scr					settings/mines.txt::maps					settings/mines.txt::gametypes								settings/mines								"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"time-alive"				"1"					" Count time alive for"								"none"								all								all											"none"									"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"spec-eye"				"0"					" Spectators use eyes of person they spectate "					global/ac/spec_eye.scr						all								all											"none"									"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"message-center"			"1"					" Server Messages using hud Draw"						global/ac/server_messages.scr					all								all											settings/message-center							"0"		
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"medics"				"0"					" Players can heal other players"						global/ac/medics/setup.scr					all								all											settings/medics								"0"
		//Game types																									
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"countdown"				"0"					" Each team must find and hold the radio"					HTR/setup.scr							all								all											settings/countdown							"0"
		//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		"survivor"				"0"					" Battle until you have no lives"						Survivor/setup.scr						all								all											settings/survivor							"0"
	
		//
		// CUSTOM ADD ON
		"custom"				"1"					"whatever i want"								"none"								all								all											settings/custom								"0"			
	endarray
end local.scripts

now its there loading on all game types and all maps. The settings file we make wwill be called 'custom' and placed inside the settings folder. The path we add to the mods list is thus 'settings/custom'


Now in the settings file we must create some weapon specific setting thread, named weaponsAA, or weaponsSH for SH etc. Because it looks for these in the script.

Code: Select all

		game.custom_weapons =  waitexec game.file["custom"]::weaponsaa
game.file["custom"] would be settings/custom.txt
So the whole thing is.
settings/custom.txt::weaponsaa
so really the same as. however game.file changes if you change the mods.txt

Code: Select all

		game.custom_weapons =  waitexec settings/custom.txt::weaponsaa
2. Make the settings file!

now in the settings file we must list the weapons with 2 parameters, 1 for damage and 1 for firedelay as we check for 2 in the script.

go to the medics and camper and copy the whole list over and make a new text file named 'custom', paste them inside.

you then must add a new section and change the wording and its done!

Code: Select all


// set a main thread with a dummy array so settings loading dont give //errors when it finds no settings. All settings are loaded by itself.

main:

local.dummy = makearray
endarray

end local.dummy


// Allied Assault

weaponsaa:

	local.weapons =  makearray
		//weapon name			//weapon damage		//fire delay
		"bar" 				""			""			
		"bazooka" 			""			""
		"kar98" 			""			""
		"kar98sniper" 			""			""
		"m1_garand" 			""			""
		"mp40" 				""			""
		"mp44" 				""			""
		"panzerschreck" 		""			""
		"shotgun"			""			""
		"springfield" 			""			""
		"thompsonsmg" 			""			""
		"unarmed" 			""			""
	endarray
end local.weapons

// SPEARHEAD

weaponssh:
	local.weapons =  makearray
		//weapon name			//weapon damage		//fire delay
		"bar" 				""			""
		"bazooka" 			""			""
		"kar98" 			""			""
		"kar98sniper" 			""			""
		"m1_garand" 			""			""
		"mp40" 				""			""
		"mp44" 				""			""
		"panzerschreck" 		""			""
		"shotgun"			""			""
		"springfield" 			""			""
		"thompsonsmg" 			""			""
		"enfield" 			""			""
		"g43" 				""			""
		"mosin_nagant_rifle" 		""			""
		"ppsh_smg" 			""			""
		"sten" 				""			""
		"svt_rifle" 			""			""
		"kar98_mortar" 			""			""
		"unarmed" 			""			""
	endarray
end local.weapons

// BREAKTHROUGH

weaponsbt:
	local.weapons =  makearray
		
		//weapon name			//weapon damage			//fire delay
		"bar"				""			""			
		"bazooka"			""			""		
		"delisle"			""			""
		"enfield"			""			""
		"g43"				""			""
		"gr_w_minedetector"		""			""
		"it_w_breda"			""			""		
		"it_w_carcano"			""			""
		"2it_w_howitzerdes"		""			""
		"it_w_moschetto"		""			""
		"kar98"				""			""
		"kar98sniper"			""			""
		"kar98_mortar"			""			""
		"m1_garand"			""			""
		"mosin_nagant_rifle"		""			""
		"mp40"				""			""
		"mp44"				""			""
		"panzerschreck"			""			""
		"ppsh_smg"			""			""
		"shotgun"			""			""
		"springfield"			""			""
		"sten"				""			""
		"svt_rifle"			""			""
		"thompsonsmg"			""			""
		"1uk_w_l42a1"			""			""
		"uk_w_piat"			""			""
		"uk_w_vickers"			""			""
		"us_w_minedetector"		""			""
		"unarmed" 			""			""
	
	endarray
end local.weapons


I just took the one form medics and did replace all on help to "".

now if u changed "" to anything in the first section the new damage for the gun will be what you set.


finished!

"bar" "1" "23"

damage of 1,. fire delay of 23.


Hope that helps!

if u do admin_cmd "help"

you will notice you have a load of new settings. These will be called "custom-bar"

or something, i think.hehe because when i added them in the script to the settings list i added "custom-" to it. So it will not conflict with the ones from camper which are in the settings list as the name of the weapon on its own.

now i typed all these and copied from the ones already made and changed them in here so maybe i did make some msitakes more than just spelling and english. sorry about them:\


You dont have to add anything to mods.txt. Thats just for gaining the ona nd off feature. You could have it load the settings normaly from a file if u specify the static path to the file in the script.