Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Set_Map errors?
Set_Map errors? [message #464388] Tue, 13 March 2012 18:21 Go to next message
Agent is currently offline  Agent
Messages: 46
Registered: November 2010
Location: United States
Karma: 0
Recruit
I don't feel like retyping my question/problem, so:

[20:49:42] <SSIhekill> So, I've a simple lil bit here:
int x = Get_Current_Map_Index();
if (Set_Map(hfsparams, x+1) == 1) sprintf_s(tempstr,"Map %s set successfully to position %d.\n",Get_Map(x+1), x+1);
[20:50:11] <SSIhekill> It prints it out as if it were a success
[20:50:20] <SSIhekill> and any future calls to Get_Map print the map that was set
[20:50:34] <SSIhekill> however, when gameover is initialized, it does not proceed to the map which was set
[20:53:12] <SSIhekill> (Instead, it proceeds to the next map in the cycle in tt.cfg)
[20:53:49] <SSIhekill> And I'm pretty sure that it worked in beta 3 (this is in beta 4)
[20:58:12] <SSIhekill> So... Was anything changed that might cause this...?
[21:00:55] <SSIhekill> I would also like to note that Set_Map will not set mission maps (such as M01, M00_Tutorial, or Skrimish00) at all.

The position in which it's being set to is correct, but it seems that when the server is determining which map to load after a gameover, it does not load the map in Set_Map, instead it loads the map that's in tt.cfg. Just in case I've gone blind and made an error:

if ((_strcmpi(hscommand,"setnext") == 0) || (_strcmpi(hscommand,"setnextmap") == 0))
{
if (!hfsparams || hfsparams[0] == '\0')
{
Console_Output("No parameters for sub-command: %s given.\n",hscommand);
Console_Output("Syntax: SETNEXT <map>\n");
return;
}
int x = Get_Current_Map_Index();
char tempstr[1024];
if (Set_Map(hfsparams, x+1) == 1)
{
sprintf_s(tempstr,"Map %s set successfully to position %d.\n",Get_Map(x+1), x+1);
}
else
{
char tempstr2[1024];
sprintf_s(tempstr2,"C&C_%s",hfsparams);
if (Set_Map(tempstr2, x+1) == 1) sprintf_s(tempstr,"Map %s set successfully to position %d.\n",Get_Map(x+1), x+1);
else sprintf_s(tempstr,"Error: could not set the next map to %s or C&C_%s.\n",hfsparams,hfsparams);
}
SSGMGameLog::Log_Message(tempstr,"_NEXTMAPSET");
Console_Output(tempstr);
return;
}
Re: Set_Map errors? [message #464390 is a reply to message #464388] Tue, 13 March 2012 19:22 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
use mlistc console command.

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Set_Map errors? [message #464415 is a reply to message #464388] Wed, 14 March 2012 12:50 Go to previous messageGo to next message
Agent is currently offline  Agent
Messages: 46
Registered: November 2010
Location: United States
Karma: 0
Recruit
I'll keep that in mind, but that doesn't really fix the Set_Map issue, it just avoids it...
Re: Set_Map errors? [message #464421 is a reply to message #464388] Wed, 14 March 2012 15:46 Go to previous messageGo to next message
Agent is currently offline  Agent
Messages: 46
Registered: November 2010
Location: United States
Karma: 0
Recruit
Also:
If I use mlistc (i.e mlistc 1 C&C_Islands) the server will set the map to the correct position and begin to load that map when it has reached that position, however, it will also crash after gameover (more precisely, after the map begins to load and before LoadLevelHook is called). Both the Set_Map and mlistc errors seem to occur on multiple environments. I'm fairly confident these are errors in tt.dll.
Re: Set_Map errors? [message #464422 is a reply to message #464388] Wed, 14 March 2012 15:53 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
I had the exact same issues with Set_Map() and mlistc with beta 3. This is what I used for Set_Map(), mlistc was set manually, the behavior for Set_Map() and mlistc is different:

void SetNextMap::Activate_IRC(StringClass Nick, StringClass Channel, Tokenizer Msg)
{
	if (Msg.Size() != 2)
	{
		IRC::Send("PRIVMSG %s :usage !setnextmap <name>.\n", Channel);
		return;
	}
	int NextID = Get_Current_Map_Index() + 1;

	const char *temp = Get_Map(NextID);
	if( temp == NULL)
	{
		NextID = 0;
	}
		
	for(int i = 0;; i++)
	{
		const char *x = Get_Map(i);
		if( x != NULL)
		{
			if (stristr(x, Msg[2]))
			{
				if (Set_Map(x, NextID))
				{
					IRC::Send("PRIVMSG %s :The next map was set to %s.\n", Channel, x);
				}
				else
				{
					IRC::Send("PRIVMSG %s :Unknown error trying to set map to %s.\n", Channel, x);
				}
				return;
			}
		}
		else
		{
			break;
		}
	}
	IRC::SendC(Channel, "Map not found.");
}


I've got a a server directory setup that can be used to reproduce the issue, if needed I can upload it.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Wed, 14 March 2012 15:54]

Report message to a moderator

Re: Set_Map errors? [message #464707 is a reply to message #464388] Tue, 20 March 2012 13:48 Go to previous messageGo to next message
Agent is currently offline  Agent
Messages: 46
Registered: November 2010
Location: United States
Karma: 0
Recruit
So... I'm assuming this is already fixed for the next beta...? I never really got a response about that. :\
Re: Set_Map errors? [message #464720 is a reply to message #464388] Tue, 20 March 2012 18:48 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

It's on the bug tracker, it will likely be fixed for beta5. Thanks for reporting. Smile

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Set_Map errors? [message #464722 is a reply to message #464388] Tue, 20 March 2012 19:11 Go to previous messageGo to next message
Agent is currently offline  Agent
Messages: 46
Registered: November 2010
Location: United States
Karma: 0
Recruit
Oh, okay. Thanks Very Happy
Re: Set_Map errors? [message #465301 is a reply to message #464388] Mon, 02 April 2012 07:53 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

ok, Set_Map has been fixed and its loading the correct map.
There is another issue to do with mlistc and Set_Map causing a garbage objects file to be loaded but that's being investigated right now and will be fixed.



Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Set_Map errors? [message #465305 is a reply to message #464388] Mon, 02 April 2012 08:20 Go to previous message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

ok, the other issue is fixed.
All known issues with Set_Map & mlistc should now be fixed, as should all issues related to custom objects files (both global and per-map)


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Previous Topic: Bug involving custom objects and mslistc
Next Topic: Resource Manager
Goto Forum:
  


Current Time: Sat Oct 05 07:52:06 MST 2024

Total time taken to generate the page: 0.00895 seconds