issues with mod

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
mox123456
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: October 21st, 2007, 7:58 am
Gamertag: mox123456
Location: Saint Louis, MO
Contact:

issues with mod

Post by mox123456 » January 3rd, 2014, 8:46 pm

Hey i wanted to see if someone could take look at my mod files see why it will not display the message in the middle of the screen i'm sure i have it all right.


Download files: http://mxcms.co/mx_mod.zip
i wove pedsdude and nightmare :D

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: issues with mod

Post by Drofder2004 » January 3rd, 2014, 10:37 pm

Firstly you receive an error:

Code: Select all

if ( level.inReadyUpPeriod )
Line 671 of _hud_util.gsc
There are no other references to "level.inReadyUpPeriod" in your code, I assume it has ties to another mod that your does not use.

Simple fix - Remove the offending code.
________________________________________________________________________

Your second error is:

Code: Select all

if(self.doinghud)
Line 103 of _mx.gsc
You are checking to see the value of a variable, but you have yet to define/initialise the variable.

Simple fix: check if the variable is defined first "if(isDefined(var) && var)"
________________________________________________________________________

Your third error is:

Code: Select all

self.mxhudQueue[self.mxhudQueue.size] = hudstuff;
Line 105 of _mx.gsc
You have again not initialised the variable (or in this case the array).

Simple fix: Add "arrayName = [];" before you try to use the array.
________________________________________________________________________

At this point you now have messages displayed.
You do not have any errors, but you do have a problem or two.

Problem 1: Your text displays straight away (as opposed to after the player spawns)
(Simply add a "self waittill("spawned");" call in your dowelcome function.

Problem 2: Your text is repeating twice.
(You are calling "onplayerconnect" twice, so you get twice the action).

Let me know how you get on.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

mox123456
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: October 21st, 2007, 7:58 am
Gamertag: mox123456
Location: Saint Louis, MO
Contact:

Re: issues with mod

Post by mox123456 » January 4th, 2014, 9:41 pm

Drofder2004 wrote:Firstly you receive an error:

Code: Select all

if(self.doinghud)
Line 103 of _mx.gsc
You are checking to see the value of a variable, but you have yet to define/initialise the variable.

Simple fix: check if the variable is defined first "if(isDefined(var) && var)"
________________________________________________________________________

Your third error is:

Code: Select all

self.mxhudQueue[self.mxhudQueue.size] = hudstuff;
Line 105 of _mx.gsc
You have again not initialised the variable (or in this case the array).

Simple fix: Add "arrayName = [];" before you try to use the array.
________________________________________________________________________

At this point you now have messages displayed.
You do not have any errors, but you do have a problem or two.

Let me know how you get on.

I've fixed the the small errors that you said but the above one's i'm very confused on where to add the lines of code to. Under this i have take out all the other code just need help on this one function.

Code: Select all


nowdohud(hudstuff)
{
	self endon("disconnect");
	
	if(self.doinghud)
	{
		self.mxhudQueue[self.mxhudQueue.size] = hudstuff;
		return;
	}

	self.doinghud = true;

	duration = 5.0;
	glowColor = (1,0,0);
	glowAlpha = 1;
	hudstuff.type setPoint( "CENTER", "CENTER", 0, 100);
	hudstuff.type setPulseFX(40, int(duration*1000), 1000);
	hudstuff.type.glowColor = glowColor;
	hudstuff.type.glowAlpha = glowAlpha;
	hudstuff.type.alpha = 1;
	hudstuff.type.label = &"";

	if(isDefined(hudstuff.msg))
		self.notifyText setText(hudstuff.msg);	

	wait 2;

	self.doinghud = false;	
	
	if(self.mxhudQueue.size > 0)
	{
		hudstuff = self.mxhudQueue[0];
		
		newQueue = [];
		for (i=1;i<self.mxhudQueue.size;i++)
			self.mxhudQueue[i-1] = self.mxhudQueue[i];
		self.mxhudQueue[i-1] = undefined;

		self thread nowdohud(hudstuff);
	}
}

i wove pedsdude and nightmare :D

mox123456
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: October 21st, 2007, 7:58 am
Gamertag: mox123456
Location: Saint Louis, MO
Contact:

Re: issues with mod

Post by mox123456 » January 4th, 2014, 9:54 pm

nvm i have found the error and have fixed it.
i wove pedsdude and nightmare :D

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests