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

Members Online

»
0 Active | 67 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: Sound script compile error
EL_Zoido
General Member
Since: Dec 8, 2008
Posts: 5
Last: Jun 27, 2012
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Saturday, Jun. 16, 2012 08:38 am
Hello folks,

Trying to work a sound thing for a new map idea, running into a problem so here I am to get some extra eyes.

What I'm trying to make happen.
voice1
German player runs into/looks at trigger "ger1run"
All Allied players play a local sound, then a brief wait and another local sound.
voice2
Allied players runs through trigger "bu2"
A nearby script entity "bu2e" randomly plays 1 of 4 sounds.

Developer mode tells me that this line >> } << in voice2 is in error (if I can count right [lol]).This line comes just before >> else if(temp == 1) <<

So my close bracket after playing the first sound it doesnt like, which I have done before and never had trouble with [ohwell]

I haven't found any similar things before from searching and some parts of this are new to me, so I've put both below in for completeness.
Now I go back to my end, but maybe someone else has a solution before I can find one ;)

Code:
voice1() 
{ 
	messagetrig = getent ("ger1run","targetname");
	messagetrig waittill ("trigger",player);
	if(player.pers["team"] == "axis")
	{	
	players = getentarray("player", "classname");
		for(i = 0; i < players.size; i++)
		{
		player = players[i];
			if(player.pers["team"] == "allies")
			{
			player playLocalSound("wfi");
			wait (6);
			player playLocalSound("mg");
			}
		}
	}
	wait 5;
	thread voice1();
}
voice2()
{
	messagetrig = getent ("bu2","targetname");
	messagetrig waittill ("trigger",player);
	alert = getent ("bu2e", "targetname");
	if(player.pers["team"] == "allies")	
		{
		temp = randomInt(4);
		if(temp == 0)
		{
			alert playsound("dp")					
		}
		else if(temp == 1)
		{
			alert playsound("fs")					
		}
		else if(temp == 2)
		{
			alert playsound("ammo")				
		}
		else
		{
			alert playsound("nb")
		}
	wait 5;
	thread voice2();
}


edited on Jun. 16, 2012 01:48 am by EL_Zoido

edited on Jun. 16, 2012 01:50 am by EL_Zoido

edited on Jun. 16, 2012 01:51 am by EL_Zoido
Share |
EL_Zoido
General Member
Since: Dec 8, 2008
Posts: 5
Last: Jun 27, 2012
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Sunday, Jun. 17, 2012 01:35 am
Then after a nights sleep you notice you were missing some semi colons.

Oops!

All is well now.
Share |
bubbazan68
General Member
Since: May 24, 2010
Posts: 62
Last: Oct 3, 2016
[view latest posts]
Level 3
Category: CoDUO Mapping
Posted: Tuesday, Jun. 19, 2012 06:11 am
[jumping]

you should post the fixed script for any one who is looking for the same thing, as it might help them
Share |
EL_Zoido
General Member
Since: Dec 8, 2008
Posts: 5
Last: Jun 27, 2012
[view latest posts]
Level 0
Category: CoDUO Mapping
Posted: Wednesday, Jun. 27, 2012 09:01 am
Thats a good point, below is what I fixed it to. Notice the extra semi colons after the "playsound"

Code:
voice2()
{
	messagetrig = getent ("bu2","targetname");
	messagetrig waittill ("trigger",player);
	alert = getent ("bu2e", "targetname");
	if(player.pers["team"] == "allies")
		{
			temp = randomInt(4);
			if(temp == 0)
			{
				alert playsound("dp");
			}
			else if(temp == 1)
			{
				alert playsound("fs");
			}
			else if(temp == 2)
			{
				alert playsound("ammo");
			}
			else
			{
				alert playsound("nb");
			}
		}
	wait 5;
	thread voice2();
}
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

»