Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Set_Map errors?
Set_Map errors? [message #464388] |
Tue, 13 March 2012 18:21  |
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 #464422 is a reply to message #464388] |
Wed, 14 March 2012 15:53   |
iRANian
Messages: 4312 Registered: April 2011
Karma: 1
|
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.
[Updated on: Wed, 14 March 2012 15:54] Report message to a moderator
|
|
|
|
|
|
|
Re: Set_Map errors? [message #465305 is a reply to message #464388] |
Mon, 02 April 2012 08:20  |
|
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
|
|
|
Goto Forum:
Current Time: Sat Apr 12 12:20:54 MST 2025
Total time taken to generate the page: 0.00770 seconds
|