Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 45 Guests
Online:

LATEST FORUM THREADS

»
Call of DutyŽ: WWII
CoD WW2 General
SOF2 Prefabs map
SoFII Mapping
coduo mapping tools
CoDUO Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD+UO Map + Mod Releases
Release announcements of custom maps and other content related to Call of Duty and Call of Duty United Offensive.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Weapon Reload System MOD
mebloscian
General Member
Since: Sep 9, 2012
Posts: 2
Last: Sep 26, 2012
[view latest posts]
Level 0
Category: CoD+UO Map + Mod Releases
Posted: Wednesday, Sep. 26, 2012 01:37 pm
http://papysh123.cba.pl/zz_reload_system_alpha.pk3

This mod makes stock ammo clip based. So every reload will take full clip. It also take under account open and closed bolt system weapons.

It is alpha version, made for cod 1.1.
Can work with 1.5 also, but it will change weapons parameters to those from 1.1. I'm working now on 1.5 version of this mod, it requires little work to upgrade. Gonna update it soon.

Anyway, would be nice if someone could tell me how to improve code.
Source:
http://codepad.org/N9anNG3F
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD+UO Map + Mod Releases
Posted: Wednesday, Sep. 26, 2012 02:55 pm
Wrote a version of this for cod2. If you want, plz port it :)

code:

Code:

main()
{
	thread waitforconnect();
}

waitforconnect()
{
	while(true)
	{
		level waittill("connecting",player);
		player thread waitforspawn();
	}
}

waitforspawn()
{
	self endon("disconnect");
	while(true)
	{
		self waittill("spawned_player");
		self thread forcefullclipreload();
	}
}

forcefullclipreload()
{
	self endon("disconnect");
	self endon("killed_player");
	self endon("spawned_player");
	clip=self getweaponslotclipammo("primary");
	ammo=self getweaponslotammo("primary");
	slot="primary";
	weap=self getcurrentweapon();
	while(true)
	{
		wait 0.05;
		if(self getcurrentweapon()==weap&&clip>=self getweaponslotclipammo(slot))
		{
			clip=self getweaponslotclipammo(slot);
			continue;
		}
		if(self getcurrentweapon()!=weap)
		{
			if(self getcurrentweapon()==self getweaponslotweapon("primary"))
				slot="primary";
			else if(self getcurrentweapon()==self getweaponslotweapon("primaryb"))
				slot="primaryb";
			clip=self getweaponslotclipammo(slot);
			ammo=self getweaponslotammo(slot);
			weap=self getcurrentweapon();
		}
		else
		{
			//player reloaded
			if(self getweaponslotammo(slot)<clip)
			{
				//out of ammo, reduce clip to proper size
				self setweaponslotclipammo(slot,ammo);
				self setweaponslotammo(slot,0);
				clip=ammo;
				ammo=0;
			}
			else
			{
				ammo=self getweaponslotammo(slot)-clip;
				self setweaponslotammo(slot,ammo);
				clip=self getweaponslotclipammo(slot);
			}
		}
	}
}


I have never ever touched anything cod1/uo related, so dont ask me. Works great on cod2, much less script cluttering compared to your version. Also no need for custom configurations for different weapons.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD+UO Map + Mod Releases
Posted: Wednesday, Sep. 26, 2012 03:03 pm
IzNoGoD writes...
Quote:
Wrote a version of this for cod2. If you want, plz port it :)

code:

Code:

main()
{
	thread waitforconnect();
}

waitforconnect()
{
	while(true)
	{
		level waittill("connecting",player);
		player thread waitforspawn();
	}
}

waitforspawn()
{
	self endon("disconnect");
	while(true)
	{
		self waittill("spawned_player");
		self thread forcefullclipreload();
	}
}

forcefullclipreload()
{
	self endon("disconnect");
	self endon("killed_player");
	self endon("spawned_player");
	clip=self getweaponslotclipammo("primary");
	ammo=self getweaponslotammo("primary");
	slot="primary";
	weap=self getcurrentweapon();
	while(true)
	{
		wait 0.05;
		if(self getcurrentweapon()==weap&&clip>=self getweaponslotclipammo(slot))
		{
			clip=self getweaponslotclipammo(slot);
			continue;
		}
		if(self getcurrentweapon()!=weap)
		{
			if(self getcurrentweapon()==self getweaponslotweapon("primary"))
				slot="primary";
			else if(self getcurrentweapon()==self getweaponslotweapon("primaryb"))
				slot="primaryb";
			clip=self getweaponslotclipammo(slot);
			ammo=self getweaponslotammo(slot);
			weap=self getcurrentweapon();
		}
		else
		{
			//player reloaded
			if(self getweaponslotammo(slot)<clip)
			{
				//out of ammo, reduce clip to proper size
				self setweaponslotclipammo(slot,ammo);
				self setweaponslotammo(slot,0);
				clip=ammo;
				ammo=0;
			}
			else
			{
				ammo=self getweaponslotammo(slot)-clip;
				self setweaponslotammo(slot,ammo);
				clip=self getweaponslotclipammo(slot);
			}
		}
	}
}


I have never ever touched anything cod1/uo related, so dont ask me. Works great on cod2, much less script cluttering compared to your version. Also no need for custom configurations for different weapons.


That wont work in COD1/UO. For one thing, it contains notifications from COD2 which just aren't present in COD1/UO. For another, COD1/UO doesn't have weapon slots, so all the functions for those, plus the ammo functions wont work. It will just crash out with unknown function, etc.

Best not to try to answer posts for a game you don't know. It will inevitably just waste the original posters time and energy.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD+UO Map + Mod Releases
Posted: Wednesday, Sep. 26, 2012 03:07 pm
mebloscian writes...
Quote:
http://papysh123.cba.pl/zz_reload_system_alpha.pk3

This mod makes stock ammo clip based. So every reload will take full clip. It also take under account open and closed bolt system weapons.

It is alpha version, made for cod 1.1.
Can work with 1.5 also, but it will change weapons parameters to those from 1.1. I'm working now on 1.5 version of this mod, it requires little work to upgrade. Gonna update it soon.

Anyway, would be nice if someone could tell me how to improve code.
Source:
http://codepad.org/N9anNG3F


The code seems to be based on Chris_P's merciless code from his very first merciless mod for COD1 version 1.1. The script language for COD never changed through all 5 patches so what worked in 1.1 will more-or-less work in 1.5. What is it exactly you are asking for? You say "improve" it. In what way do you want it improved?
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD+UO Map + Mod Releases
Posted: Wednesday, Sep. 26, 2012 03:35 pm
Tally writes...
Quote:
IzNoGoD writes...
Quote:
Wrote a version of this for cod2. If you want, plz port it :)

I have never ever touched anything cod1/uo related, so dont ask me. Works great on cod2, much less script cluttering compared to your version. Also no need for custom configurations for different weapons.


That wont work in COD1/UO. For one thing, it contains notifications from COD2 which just aren't present in COD1/UO. For another, COD1/UO doesn't have weapon slots, so all the functions for those, plus the ammo functions wont work. It will just crash out with unknown function, etc.

Best not to try to answer posts for a game you don't know. It will inevitably just waste the original posters time and energy.


I would advise you to actually read my post.

It says the following:


Wrote a version of this for cod2. If you want, plz port it :)

I have never ever touched anything cod1/uo related, so dont ask me. Works great on cod2, much less script cluttering compared to your version. Also no need for custom configurations for different weapons.

Which might actually be EXACTLY what you are replying: IT MIGHT NOT WORK OR IT JUST MIGHT.

Also, if you want it to work, you'd probably have to port it:
Wrote a version of this for cod2. If you want, plz port it :)
Wrote a version of this for cod2. If you want, plz port it :)


Also:
For another, COD1/UO doesn't have weapon slots, so all the functions for those, plus the ammo functions wont work.

If i open OP's code, there are an awful lot of weaponslot functions in there.

Only thing im not sure about in my code is the handling of non-emptying weaponammo, which might be handled incorrectly. Might just test that, or just leave it be.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD+UO Map + Mod Releases
Posted: Wednesday, Sep. 26, 2012 04:31 pm
IzNoGoD writes...
Quote:
Tally writes...
Quote:
IzNoGoD writes...
Quote:
Wrote a version of this for cod2. If you want, plz port it :)

I have never ever touched anything cod1/uo related, so dont ask me. Works great on cod2, much less script cluttering compared to your version. Also no need for custom configurations for different weapons.


That wont work in COD1/UO. For one thing, it contains notifications from COD2 which just aren't present in COD1/UO. For another, COD1/UO doesn't have weapon slots, so all the functions for those, plus the ammo functions wont work. It will just crash out with unknown function, etc.

Best not to try to answer posts for a game you don't know. It will inevitably just waste the original posters time and energy.


I would advise you to actually read my post.

It says the following:


Wrote a version of this for cod2. If you want, plz port it :)

I have never ever touched anything cod1/uo related, so dont ask me. Works great on cod2, much less script cluttering compared to your version. Also no need for custom configurations for different weapons.

Which might actually be EXACTLY what you are replying: IT MIGHT NOT WORK OR IT JUST MIGHT.

Also, if you want it to work, you'd probably have to port it:
Wrote a version of this for cod2. If you want, plz port it :)
Wrote a version of this for cod2. If you want, plz port it :)


Also:
For another, COD1/UO doesn't have weapon slots, so all the functions for those, plus the ammo functions wont work.

If i open OP's code, there are an awful lot of weaponslot functions in there.

Only thing im not sure about in my code is the handling of non-emptying weaponammo, which might be handled incorrectly. Might just test that, or just leave it be.


Your code wont work because it has notifications for a connecting player, a spawned player, and a dead player which don't exist in COD1. Hence why I said your code would not work. Yes: you can "port it over" as you say, but it needs such serious recoding, it seems foolish in my opinion to even offer it given the request in post #1.

As for weapon slots, yeah I should have been clearer: COD1 has 8 weapon slots, which include grenades and pistols. You cycle through them with your mouse scroll wheel. COD2 has 2 weapon slots for guns, and no weapon slots for grenades. Grenades are offhand classes. Not slots. You cannot hold a grenade in COD2 - the action button simply throws a grenade, whereas in COD1, you can stand with one in your hand in idle fashion. I didn't even look at your code, so I incorrectly assumed it might be trying to arm grenades with functions which don't work in COD1.

Now, because of your petulance, in future, if I see one of your posts, I will steer clear of it. It seems you are incapable of conducting yourself in a mature manner.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoD+UO Map + Mod Releases

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»