Page 1 of 1

issues with mod

Posted: January 3rd, 2014, 8:46 pm
by mox123456
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

Re: issues with mod

Posted: January 3rd, 2014, 10:37 pm
by Drofder2004
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.

Re: issues with mod

Posted: January 4th, 2014, 9:41 pm
by mox123456
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);
	}
}


Re: issues with mod

Posted: January 4th, 2014, 9:54 pm
by mox123456
nvm i have found the error and have fixed it.