Results 1 to 10 of 10

Thread: ERROR: SP_worldspawn: The first entity isn't 'worldspawn'

  1. #1
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts

    ERROR: SP_worldspawn: The first entity isn't 'worldspawn'

    Hello,
    i generated some log files to log some issues of my mod.
    The problem is, when i delete the "\n" at the end of the log message, it gives me after map_restart an error.

    ********************
    ERROR: SP_worldspawn: The first entity isn't 'worldspawn'
    ********************

    Btw, for telling me "Bla bla mapping" the map is mp_toujane. After removing the "\n" the error happends. Evene with " " it happends.

    I deleted the \n cause append do not need it.

    Code:
    thread earlmod\_logging::stats("L: Done loading stats file of Guid " + guid + " rank is " + self.stats["rank"] + " xp is " + self.stats["xp"] + "\n");
    Code:
    stats(mess)
    {
    	if(!level.logging["stats"])
    		return;
    	
    	if(!isDefined(mess))
    		return;
    	
    	file = openFile(level.logging_file["stats"], "append");
    	fPrintln(file, mess);
    	closeFile(file);
    }
    Any idea?

    (Quake code i found for Worldspawn > Click me)
    No ... No ... this is not possible .......

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Dont closefile() if fid == -1, cause file wont be opened

  3. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (9th February 2013)

  4. #3
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    File works, it adds the messages.
    I got some more threads in my script, that is just the adding of message.
    At initialation it checks for the cvars, folders and files and creates them if they don't exists.
    No ... No ... this is not possible .......

  5. #4
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Yep, i do hate Cod2 errors Stupid, no sense

    The check if the file exists, went a littbit wrong and cod2 just gave out this stupid error.
    But thanks for help, specialy to izno, he saw whats wrong ^^
    No ... No ... this is not possible .......

  6. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Did you also have also this error related to the codscript-file-functions?

    Code:
    No map specified in sv_mapRotation - forcing map_restart.
    ==== ShutdownGame ====
    ------- Game Initialization -------
    gamename: Call of Duty 2
    gamedate: Apr 19 2006
    ********************
    ERROR: G_ParseSpawnVars: closing brace without data
    ********************
    ----- Server Shutdown -----
    Sending heartbeat to cod2master.activision.com
    ==== ShutdownGame ====
    timescale 0.01

  7. #6
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    How did you fix this? I got the same error but I handle my open and closing files perfectly. Only open if it exists and only close if it exists

  8. #7
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Well, double check at closing!
    My problem was, the file was still open (I don't remember why) and if I restarted map (ONLY THEN) I had this error.
    So double check also use if(fid == -1).
    No ... No ... this is not possible .......

  9. #8
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    I have that :/
    PHP Code:
    saveacc()
    {
        
        
    f=openfile(self.pers["loginname"]+".cfg","write");
        if(
    f!=-1)
        {
            
    fprintln(f,self.pers["totalKills"]);
            
    fprintln(f,self.pers["totalHead"]);
            
    fprintln(f,self.pers["totalBash"]);
            
    fprintln(f,self.pers["loginpw"]);
            
    fprintln(f,self.pers["loadoldstats"]);
            
    closefile(f);
        }
    }

    loadacc()
    {

        
    f=openfile(self.pers["loginname"]+".cfg","read");
        if(
    f!=-1)
        {
            
    freadln(f);
            
    self.pers["totalKills"] = int(fgetarg(f,0));
            
    self.pers["totalHead"] = int(fgetarg(f,1));
            
    self.pers["totalBash"] = int(fgetarg(f,2));
            
    self.pers["loginpw"] = fgetarg(f,3);
            
    self.pers["loadoldstats"] = int(fgetarg(f,4));
            
    closefile(f);
        }


    And to get the old stats back from saving on GUID
    PHP Code:
    loadoldstats()
    {
        
    wait 1;
        if(
    isdefined(self.pers["login"])) 
        {
            
    self iprintlnbold("LOAD OLD STATS: "+self.pers["loadoldstats"]);
            if(
    self.pers["loadoldstats"]==0)
            {
                
    f=openfile("stats/player_" self getGuid() + ".txt","read");
                if(
    f!=-1)
                {
                    
    freadln(f);
                    
    self.pers["totalKills"] = int(fgetarg(f,0));
                    
    self iprintlnbold("^2Total kills Loaded!");
                    
    self iprintlnbold("^2Total kills: "+self.pers["totalKills"]);
                    
    wait 1;
                    
    self.pers["totalHead"] = int(fgetarg(f,1));
                    
    self iprintlnbold("^3Total Headshots Loaded!");
                    
    self iprintlnbold("^3Total headshots: "+self.pers["totalHead"]);
                    
    wait 1;
                    
    self.pers["totalBash"] = int(fgetarg(f,2));
                    
    self iprintlnbold("^4Total Bashes Loaded!");
                    
    self iprintlnbold("^4Total Bashes: "+self.pers["totalBash"]);
                    
    self.pers["loadoldstats"]=1;
                    
    closefile(f);
                    
    wait 1;

                    
    self maps\mp\gametypes\log::saveacc();
                }
            }
            else
            
    self iprintlnbold("already loaded");
        }


  10. #9
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    do NOT put waits between fileopen and fileclose.

    Serv might change map BEFORE file is closed, causing your bug.

    Get data, close file, then add waits and printlns, dont wait before closing after opening!

  11. #10
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Jep solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •