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

Members Online

»
0 Active | 71 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP 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: CoDUO Mapping
CoD United Offensive mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Error while scripting in weapon
fainter
General Member
Since: Mar 19, 2005
Posts: 110
Last: May 15, 2006
[view latest posts]
Level 4
Category: CoDUO Mapping
Posted: Wednesday, Mar. 22, 2006 08:35 pm
I have created a new weapon for the Germans. I want this weapon to replace the satchel for there team. But I am getting this error while I try to load the map.
"count = GetWeaponBasedSatchelChargeCount{spawnweapon}
*bad syntax"
When I was first looking threw the _teams.gsc, I noticed that the satchel charge did not have the scripting in it, that allowed you to specify which team got what weapon. Incase I didnt explain that very well, in _team.gsc you can choose what grenade you want what team to spawn with; that I what I want to do with that satchel weapon slot. Knowing that, I tried taking the scripting from the grenade, and applied it into the satchel part. This is the exact part from my _teams.gsc
Code:

giveSatchelCharges(spawnweapon)
{
	self takeWeapon("satchelcharge_mp");
	self takeWeapon("gladung_mp");

	if (!level.allow_satchel)
		return;

	if(self.pers["team"] == "allies")
		{
			switch(game["allies"])		
			{
			case "american":
				satcheltype = "satchelcharge_mp";
				break;
	
			case "british":
				satcheltype = "satchelcharge_mp";
				break;
	
			case "russian":
				satcheltype = "satchelcharge_mp";
				break;
			}
		}
		else if(self.pers["team"] == "axis")
		{
			switch(game["axis"])
			{
			case "german":
				satcheltype = "gladung_mp";
				break;
			}
		}	
	}		
		
	count = getWeaponBasedSatchelChargeCount(spawnweapon);
	
	if ( count )
	{
	    } self setWeaponSlotWeapon("satchel", "satcheltype");
		        self setWeaponSlotClipAmmo("satcheltype", count);
	
}

getWeaponBasedSatchelChargeCount(weapon)
{
	// if battle rank is on then call the battle rank function
	if ( isDefined(level.battlerank) && level.battlerank)
	{
		return maps\mp\gametypes\_rank_gmi::getWeaponBasedSatchelChargeCount(weapon);
	}
	
	// no satchel charges given if we are not in battle rank mode
	return 0;
}

I understand the error I am getting, but I dont understand WHY I am getting it. Everything in the script looks fine to me. Is there something I am over looking and missed? any help woudl be appreciated. thanks!
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoDUO Mapping
Posted: Wednesday, Mar. 22, 2006 09:50 pm
Does it give you this error always, or only when you have a certain rank? If so.. maybe you should check out the function

getWeaponBasedSatchelChargeCount(weapon); in the _rank_gmi.gsc file
Share |
Drapan
General Member
Since: May 9, 2004
Posts: 290
Last: Apr 18, 2009
[view latest posts]
Level 5
Category: CoDUO Mapping
Posted: Wednesday, Mar. 22, 2006 10:02 pm
very often when you get bad syntax error its nothing wrong with the exact part its whining about

I think it is actully this thats the problem:
Code:

	if ( count )
	{
	    } self setWeaponSlotWeapon("satchel", "satcheltype");
		        self setWeaponSlotClipAmmo("satcheltype", count);
	
}


ït should be:
Code:
if ( count )
{
	self setWeaponSlotWeapon("satchel", "satcheltype");
	self setWeaponSlotClipAmmo("satcheltype", count);
}




edited on Mar. 22, 2006 05:03 pm by Drapan
Share |
fainter
General Member
Since: Mar 19, 2005
Posts: 110
Last: May 15, 2006
[view latest posts]
Level 4
Category: CoDUO Mapping
Posted: Sunday, Mar. 26, 2006 06:27 pm
Caretaker, it gives me the error as soon as I try to load up a map, cant get into it.
Drapan, thanks for the help, i replaced what you typed with what I had but am getting still,
******script compile error ********
bad syntax: {file '/maps/mp/gametype/mp/_teams.gsc', line 1398)
count = getWeaponBasedSatchelChargeCount(spawnweapon);
*
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoDUO Mapping

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

»