When making an endlevel script (SOLVED)
Another question as well, When I make my modified instance with the new scrips. Do I need to have a modified one at the ending of mapp 2 as well if I want to take the players to the lobby, or does it somehow "remember" what the script said in the endlevel_room of the first map?
StGinger wrote:
Hey, it was - good for you - a long time ago I asked you something. But me and my friend are now done with two full .vmf files, so I think i'm gonna need some advice from you of how to make an endlevel script. I've been reading how to do it at the Mapping Wiki and I think I get almost everything of it. But there is just one (or two) questions, so far. When I go to the script map to create my own script I recognize that those files are .nut files. My computer can not handle that kind of files so do I need to download a .nut program to fix that or can hammer accept a normal .txt file?
It needs to be a .nut file.
To create this just open the .nut file with notpad and save it under another name, once again with the .nut extention, that shouldn't be much of a problem.
StGinger wrote:
Another question as well, When I make my modified instance with the new scrips. Do I need to have a modified one at the ending of mapp 2 as well if I want to take the players to the lobby, or does it somehow "remember" what the script said in the endlevel_room of the first map?
If you just make a transition list with these two maps finishing the second will automatically sent you back to the main menu 
First I make a .vmf file named "mp_coop_moose", there i make just 4 walls and place a coop spawnroom and my modified endlevel room. Then I compile it.
Then I make a new .vmf file named "mp_coop_moose_two", I do exactly as the first map and then I compile it.
This is my script:
// Map order
MapPlayOrder<- [
"mp_coop_moose",
"mp_coop_moose_two",
"mp_coop_lobby_2"
]
function TransitionFromMap()
{
local nextmap = -2
// Loop through maps
foreach( index, map in MapPlayOrder )
{
if( GetMapName() == MapPlayOrder[index] )
{
// This is the map we're on
nextmap = -1
}
else
{
if (nextmap == -1)
{
// This is the first map past that one
nextmap = index
}
}
}
printl( "nextmap = " + nextmap )
if (nextmap > 0)
{
// We found a map; go to it
EntFire( "@command", "command", "changelevel " + MapPlayOrder[nextmap], 1.0 )
}
else
{
// No map found; we're done
EntFire( "@command", "command", "disconnect", 2.0 )
}
When I load the mp_coop_moose map (in splitscreen mode) and try to get to the next level, it just keeps loading. In the consle I can see that the "nextmap" was set to 1.
Can anyone see the problem, or is it simply becouse I cant try this in splitscreen mode?