Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [ZM] Highest Round Tracker Error

[ZM] Highest Round Tracker Error

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
10 Posts 3 Posters 944 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MetalThunderundefined Offline
    MetalThunderundefined Offline
    MetalThunder
    wrote on last edited by MetalThunder
    #1

    Heyy, hi there. Recently i tried this script in my server:
    https://forum.plutonium.pw/topic/3649/release-zm-highest-round-tracker-updated-3-13-2020?_=1622220235477

    I've seen that the autor updated it a few months ago, i had the old version so i deleted all i had from it and i added the new version lines instead. But im getting the next error in the cmd window or console when i launch the server: fopen Invalid Path.

    It seems that the server cant create the .txt file with the records in the correct path. I ran the server in Administrator mode too, in case it was something of writing permissions.

    I checked several times that the codes in the gsc are Okey. Also i checked the old version is completely erased.
    So the record is saved but when the new round begins, the record is lost. Always at the end of the game shows "New Record:...", "Beaten by:..." in chat but not at the begining of the match.

    Also, idk if this affects to the tracker but, recently i noticed my server logs are not saved in t6r/data/logs folder anymore. It creates a sub folder called t6/logs (t6 without the "r"). The .cfg server config file still the same as always, i never touched that since i create it. (for example, for the map Town: g_log "logs\games_zm_town.log", is by default)

    init(){
    	level thread onplayerconnect();
    	thread high_round_tracker(); //High Round Tracker	
    }
    
    onplayerconnect(){ 
    	for (;;)
           {
    		level waittill( "connected", player ); 
    		player thread onplayerspawned();
    		player thread high_round_info();
    	}
    
    //And then all the scripts at the end of the file//
    
    high_round_tracker()
    {
    	thread high_round_info_giver();
    	gamemode = gamemodeName( getDvar( "ui_gametype" ) );
    	map = mapName( level.script );
    	if( level.script == "zm_transit" && getDvar( "ui_gametype" ) == "zsurvival" )
    		map = startLocationName( getDvar( "ui_zm_mapstartlocation" ) );
    	//file handling//
    	level.basepath = getDvar("fs_basepath") + "/" + getDvar("fs_basegame") + "/";
    	path = level.basepath + "/logs/" + map + gamemode + "HighRound.txt";
    	file = fopen(path, "r");
    	text = fread(file);
    	fclose(file);
    	//end file handling//
    	highroundinfo = strToK( text, ";" );
    	level.HighRound = int( highroundinfo[ 0 ] );
    	level.HighRoundPlayers = highroundinfo[ 1 ];
    	for ( ;; )
    	{
    		level waittill ( "end_game" );
    		if ( level.round_number > level.HighRound )
    		{
    			level.HighRoundPlayers = "";
    			players = get_players();
    			for ( i = 0; i < players.size; i++ )
    			{
    				if( level.HighRoundPlayers == "" )
    				{
    					level.HighRoundPlayers = players[i].name;
    				}
    				else
    				{
    					level.HighRoundPlayers = level.HighRoundPlayers + "," + players[i].name;
    				}
    			}
    			foreach( player in level.players )
    			{
    				player tell( "New Record: ^1" + level.round_number );
    				player tell( "Set by: ^1" + level.HighRoundPlayers );
    			}
    			log_highround_record( level.round_number + ";" + level.HighRoundPlayers );
    		}
    	}
    }
    
    log_highround_record( newRecord )
    {
    	gamemode = gamemodeName( getDvar( "ui_gametype" ) );
    	map = mapName( level.script );
    	if( level.script == "zm_transit" && getDvar( "ui_gametype" ) == "zsurvival" )
    		map = startLocationName( getDvar( "ui_zm_mapstartlocation" ) );
    	level.basepath = getDvar("fs_basepath") + "/" + getDvar("fs_basegame") + "/";
    	path = level.basepath + "/logs/" + map + gamemode + "HighRound.txt";
    	file = fopen( path, "w" );
    	fputs( newRecord, file );
    	fclose( file );
    }
    
    startLocationName( location )
    {
    	if( location == "cornfield" )
    		return "Cornfield";
    	else if( location == "diner" )
    		return "Diner";
    	else if( location == "farm" )
    		return "Farm";
    	else if( location == "power" )
    		return "Power";
    	else if( location == "town" )
    		return "Town";
    	else if( location == "transit" )
    		return "BusDepot";
    	else if( location == "tunnel" )
    		return "Tunnel";
    }
    
    mapName( map )
    {
    	if( map == "zm_buried" )
    		return "Buried";
    	else if( map == "zm_highrise" )
    		return "DieRise";
    	else if( map == "zm_prison" )
    		return "Motd";
    	else if( map == "zm_nuked" )
    		return "Nuketown";
    	else if( map == "zm_tomb" )
    		return "Origins";
    	else if( map == "zm_transit" )
    		return "Tranzit";
    	return "NA";
    }
    
    gamemodeName( gamemode )
    {
    	if( gamemode == "zstandard" )
    		return "Standard";
    	else if( gamemode == "zclassic" )
    		return "Classic";
    	else if( gamemode == "zsurvival" )
    		return "Survival";
    	else if( gamemode == "zgrief" )
    		return "Grief";
    	else if( gamemode == "zcleansed" )
    		return "Turned";
    	return "NA";
    }
    
    high_round_info_giver()
    {
    	highroundinfo = 1;
    	roundmultiplier = 5;
    	level endon( "end_game" );
    	while( 1 )
    	{	
    		level waittill( "start_of_round" );
    		if( level.round_number == ( highroundinfo * roundmultiplier ))
    		{
    			highroundinfo++;
    			foreach( player in level.players )
    			{
    				player tell( "High Round Record for this map: ^1" + level.HighRound );
    				player tell( "Record set by: ^1" + level.HighRoundPlayers );
    			}
    		}
    	}
    }
    
    high_round_info()
    {
    	wait 6;
    	self tell( "High Round Record for this map: ^1" + level.HighRound );
    	self tell( "Record set by: ^1" + level.HighRoundPlayers );
    }
    

    Im at your disposition, Thanks in advance.
    Metal

    Cahzundefined Kalitosundefined 2 Replies Last reply
    0
    • Cahzundefined Offline
      Cahzundefined Offline
      Cahz VIP
      replied to MetalThunder on last edited by
      #2

      MetalThunder
      I'm unsure why it would be giving that error besides two possibilities.

      1. It is possible that the game is giving the fopen Invalid path because the txt files to not initially exist. You can try downloading a blank slate of records from here that might fix the issue.
      2. It is also possible that you aren't using the newest version of fed's t6 gsc utilites found here

      If you are still having issues, feel free to check my profile for my discord and add me. If we find a solution I will still post it here too

      MetalThunderundefined 1 Reply Last reply
      1
      • MetalThunderundefined Offline
        MetalThunderundefined Offline
        MetalThunder
        replied to Cahz on last edited by MetalThunder
        #3

        Cahz Hi cahz, sorry i replied your old post, they always told me its better create a new thread instead of post a question in an old one haha. Thanks for your answer 🙂

        About the fed's t6 gsc utilites , i only downloaded the .dll file and pasted it inside the plugins folder. Or i have to also download the source code zip and place it somewhere?
        I have Version 1.6.1 i think is the last one.

        Also, Im dowloading the file you gave me right now. I'll reply the results soon. Thanks again Cahz.

        EDIT: i still getting the error, i checked the server folder isnt read only too 👽

        Cahzundefined 1 Reply Last reply
        0
        • Cahzundefined Offline
          Cahzundefined Offline
          Cahz VIP
          replied to MetalThunder on last edited by Cahz
          #4

          MetalThunder What's the directory your game is stored at?

          MetalThunderundefined 1 Reply Last reply
          0
          • MetalThunderundefined Offline
            MetalThunderundefined Offline
            MetalThunder
            replied to Cahz on last edited by MetalThunder
            #5

            Cahz The server is at E:\Juegos\gameserver. Inside gameserver are all the config files folders, and that

            Sin título.jpg

            I tryed writing in console the next things:

            get fs_basepath and get fs_basegame:
            the first one gave me the correct path as above (E:\Juegos\gameserver). But with fs_basegame i get "".

            level.basepath = getDvar("fs_basepath") + "/" + getDvar("fs_basegame") + "/";
            path = level.basepath + "/logs/" + map + gamemode + "HighRound.txt";
            

            If im getting this right... the final value of path is (For example in the map Farm):

            "E:/Juegos/gameserver//logs/FarmSurvivalHighRound.txt".

            So yes.. that path doesnt exist. It have to be E:/Juegos/gameserver/t6r/data/logs.

            I think we can "fix" this problem temporarly, remplacing:

            level.basepath = getDvar("fs_basepath") + "/" + getDvar("fs_basegame") + "/";
            

            with:

            level.basepath = getDvar("fs_basepath") + "/t6r/data";
            

            As you can see here, thats the t6 folder i was talking about, idk why my last logs are stored there, instead of t6r.

            Cahzundefined MetalThunderundefined 2 Replies Last reply
            0
            • Cahzundefined Offline
              Cahzundefined Offline
              Cahz VIP
              replied to MetalThunder on last edited by
              #6

              MetalThunder I'm unable to replicate your errors so I unfortunately have no other recommendations for how you could fix it....

              Maybe messing with the path in the GSC or just removing the t6r folder to match where your other logs are at

              1 Reply Last reply
              0
              • Kalitosundefined Offline
                Kalitosundefined Offline
                Kalitos
                replied to MetalThunder on last edited by
                #7

                MetalThunder In general, with the last update of plutonium, in T6 it changed the main folder from t6r to t6 and at the moment all the logs are stored in t6.

                MetalThunderundefined 1 Reply Last reply
                0
                • MetalThunderundefined Offline
                  MetalThunderundefined Offline
                  MetalThunder
                  replied to Kalitos on last edited by
                  #8

                  Kalitos Ohhh i see. And do you have all your server's data there too?
                  Can you share with me the .bat file you are using to launch your server?
                  Maybe i have an old one, because my .GSC and .cfg files still being loaded in T6r folder

                  Cahz You did your best trying to help! And im happy with that. I will keep searching 🙂

                  Kalitosundefined 1 Reply Last reply
                  0
                  • Kalitosundefined Offline
                    Kalitosundefined Offline
                    Kalitos
                    replied to MetalThunder on last edited by
                    #9

                    MetalThunder At the moment t6 only stores the logs files in the "t6" folder, the rest is handled in the old folder.

                    1 Reply Last reply
                    1
                    • MetalThunderundefined Offline
                      MetalThunderundefined Offline
                      MetalThunder
                      replied to MetalThunder on last edited by
                      #10

                      Cahz Finally, Round tracker is working for all maps. It was strange.
                      After i changed that line of the path that was causing me problems, records were tracked in Origins, Motd, Buried and DieRise only, for maps like town, farm, nuketown and tranzit the thing was different.

                      For nuketown: i had to change the txt name you shared with me, with the correct gametype (Standard instead of Survival).
                      Now for Town, Farm and Transit: the same as nuked with the txt files Plus: Change also this other line in the gsc

                      if( level.script == "zm_transit" && getDvar( "ui_gametype" ) ==  "zstandard" ) 
                      

                      idk why but in those maps, ui_gametype returned me zstandard instead of zsurvival. With that fixed, it can go through the if condition (in maps like farm, town, etc) and return the right name for the highround .txt, after it returns from the startLocationName function.

                      im using this server files:
                      https://github.com/xerxes-at/T6ServerConfigs
                      so the map locations and gametypes are pre-loaded with that configs.

                      I think its the end of the line. Thanks again for helping me, the txt files you shared helped me a lot to figure out how your script works 😄

                      1 Reply Last reply
                      1

                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Donate