• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Multi Load Messages

Status
Not open for further replies.

The0Eldest

New member
There are precompilers out there that have their custom messages, and that is cool. But I wanted to have it change, like real EQ, static ones are BORING (<3 you precompilers). This guide will make it so you too can have a non-static, non-boring loading message!

Multiple Loading Messages!

This guide assumes you can compile MQ2 yourself, if you can't you need more help than I will give. The required file is MQ2CleanUI.cpp. Also, I use nested if/else, that is how I like to do this, if you want to use a switch/case, go ahead.

At the top of this file is something that looks like:

Rich (BB code):
char *OurCaption = "MQ2: Think of it as evolution in action.";

Change that to something like this(explaination below):
Rich (BB code):
char *OurCaption1 = "I R TEH HAXOR!";
char *OurCaption2 = "U IS TEH HAXOR!";
char *OurCaption3 = "WE PWNZOR!";

You are going to change this, first you can change *OurCaption to *OurCaption1 . Second, you are going to customize what is in the " " so you too can be T3H H4X0R. third if you want don't want multiple loading messages, THE GUIDE ENDS HERE just compile and poof custom message. If you want the multiple loading messages, add another line after this one, I copy and paste because I am lazy, it will be the same, other than *OurCaption1 should change to *OurCaption2 and the message in " " should change also, repeat till you have all your messages.

Next up we change this class:

Rich (BB code):
class EQ_LoadingSHook
{
public:

	VOID SetProgressBar_Trampoline(int,char const *);
	VOID SetProgressBar_Detour(int A,char const *B)
	{
		if (gbMQ2LoadingMsg)
            SetProgressBar_Trampoline(A, OurCaption);
		else
			SetProgressBar_Trampoline(A,B);
	}
};

To this (explaination below):

Rich (BB code):
class EQ_LoadingSHook
{
public:

	INT MsgNum;
	VOID SetProgressBar_Trampoline(int,char const *);
	VOID SetProgressBar_Detour(int A,char const *B)
	{
		if (gbMQ2LoadingMsg)
		{
			srand(time(NULL));
			int RANGE_MIN = 0;
			int RANGE_MAX = 2;
			MsgNum = (((double) rand() / (double) RAND_MAX) * RANGE_MAX + RANGE_MIN);

			if(MsgNum == 0)
			{
            	SetProgressBar_Trampoline(A, OurCaption1);
        	} 
        	else
        	{
	        	if(MsgNum == 1)
	        	{
		        	SetProgressBar_Trampoline(A,OurCaption2);
	        	}
	        	else
	        	{
		        	if(MsgNum == 2)
		        	{
			        	SetProgressBar_Trampoline(A,OurCaption3);
		        	}
	        	}
        	}
        }
		else
			SetProgressBar_Trampoline(A,B);
	}
};

This is the progress bar loader (I think, cause when I did something wrong here, the bar dissappeared lol) If you know anything about coding, reading or anything else, it should be simple to edit this so that it works for the number of messages you have. It starts at 0, so remember that when determining the MsgNum, and also change the RANGE_MAX to the appropriate number. This is where someone could use a switch/case if they wanted, I use nested if/else because that is how I like to program.

Lastly we edit:
Rich (BB code):
if (gbMQ2LoadingMsg)
	{
    	char **ptr = (char **) EQ_LoadingS__Array;
    	int i;

    	for (i=0;i<EQ_LoadingS__ArraySize;i++)
        	ptr = OurCaption;
	}


And change that to:
Rich (BB code):
if (gbMQ2LoadingMsg)
	{
		char **ptr = (char **) EQ_LoadingS__Array;
		int i=0;
	
		while (i<EQ_LoadingS__ArraySize)
		{
			ptr = OurCaption1;
			if((i+1)<EQ_LoadingS__ArraySize) ptr[i++] = OurCaption2;
			if((i+1)<EQ_LoadingS__ArraySize) ptr[i++] = OurCaption3;
			i++;
		}
	}


Here you need to add in a line of "if((i+1)<EQ_LoadingS__ArraySize) ptr[i++] = OurCaption3;" for each caption.

Compile it and VIOLA! You have your own custom loading messages. It works for me, and I did a diff to make sure I caught all my changes. If you have a problem, post away.

Hit me with a RedCent if you like it :D.
 
Multi Load Messages
Status
Not open for further replies.

Users who are viewing this thread

Back
Top
Cart