Thread: [Request] add old entity

Results 1 to 13 of 13
  1. #1
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,965

    [Request] add old entity

    hello,
    search script add old entity for old maps
    thanks

    idea:
    Code:
    /*
    * This script implements all old entity
    */
    
    void PluginInit()
    {
        g_Module.ScriptInfo.SetAuthor( "none" );
        g_Module.ScriptInfo.SetContactInfo( "none @ Svencoop forums" );
    }
    
    void MapInit()
    {
        g_CustomEntityFuncs.RegisterCustomEntity( "info_landmark", "info_landmark" );
        g_CustomEntityFuncs.RegisterCustomEntity( "info_texlights", "info_texlights" );
    }
    
    class info_landmark : ScriptBaseEntity
    {
    }
    
    class info_texlights : ScriptBaseEntity
    {
    }
    
    void Spawn()
    {
        g_CustomEntityFuncs.RegisterCustomEntity( "info_landmark", "info_landmark" );
        g_CustomEntityFuncs.RegisterCustomEntity( "info_texlights", "info_texlights" );
    }

    remove text log
    WARNING: Cannot instantiate entity: Entity 'info_landmark' does not exist!
    WARNING: Cannot instantiate entity: Entity 'info_texlights' does not exist!
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

  2. #2
    Japanese Wannabe NYO~~~! ゞ(´゜ω゜)つ~☆ Nero's Avatar
    Join Date
    Jul 2002
    Location
    Eskilstuna, Sweden.
    Posts
    579

    Re: [Request] add old entity

    Instead of
    Code:
    void Spawn()
    {
        g_CustomEntityFuncs.RegisterCustomEntity( "info_landmark", "info_landmark" );
        g_CustomEntityFuncs.RegisterCustomEntity( "info_texlights", "info_texlights" );
    }
    use this:
    Code:
    void RegisterOldEntities()
    {
    	g_CustomEntityFuncs.RegisterCustomEntity( "info_landmark", "info_landmark" );
    	g_CustomEntityFuncs.RegisterCustomEntity( "info_texlights", "info_texlights" );
    }

    If this is a map script:
    Remove the MapInit() as it isn't needed.

    Then you need to #include this script and add RegisterOldEntities(); to any map scripts.


    If this is a plugin:
    add RegisterOldEntities(); to PluginInit (or MapInit if that doesn't work) and remove
    g_CustomEntityFuncs.RegisterCustomEntity( "info_landmark", "info_landmark" );
    g_CustomEntityFuncs.RegisterCustomEntity( "info_texlights", "info_texlights" );



    This might yield positive results. :3
    Nero of TSP and Wotnet
    Ingame names: Nero, Horny-Girl-13
    IRC nick: Nero (probably)

  3. #3
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,599

    Re: [Request] add old entity

    I think he's asking someone else to write the script, and the code he wrote there was just an example of what it might do.

    Maybe better to just ripent those entities out of the map? info_landmark and info_texlights wouldn't work anyway since landmarks would likely spawn players outside the map, and info_texlights would require the map to be recompiled.
    Love,
    w00tguy

  4. #4
    begadang jangan begadang =_= anggara_nothing's Avatar
    Join Date
    Jan 2016
    Location
    Indonesia
    Posts
    155

    Re: [Request] add old entity

    It's good to find entity alternatives that replace the old one, using angelscript as wrapper. like this example

    PHP Code:
    // Used as an invisible playerclip wall in CSO, now it's just a wrapper for func_clip
    // anggaranothing

    enum FClipSpawnFlags {
        
    SF_CLIP_STARTOFF            =    1,    // "START OFF"

        
    SF_CLIP_DIRECTIONAL            =    2,    // (ANGLES)

        
    SF_CLIP_NOCLIENT            =    4,

        
    SF_CLIP_MONSTER                =    8,

        
    SF_CLIP_PUSHABLE            =    16,

        
    SF_CLIP_EVERYTHINGELSE        =    32,

        
    SF_CLIP_ITEMINV                =    64
    }

    class 
    invisible_entity ScriptBaseEntity
    {
        
    //Overriden because the default rules don't work correctly here
        
    bool IsBSPModel()
        {
            return 
    true;
        }
        
        
    bool KeyValue( const stringin szKey, const stringin szValue )
        {
            if (
    szKey == "solid1" && ( szValue == "not" || szValue == "trigger" ) )
            {
                
    m_startoff true;
                return 
    true;
            }
            else
                return 
    BaseClass.KeyValueszKeyszValue );
        }
        
        
    void Spawn()
        {
                
    m_startoff false;
                
    self.pev.solid SOLID_NOT;
                
    self.pev.movetype MOVETYPE_NONE;
                
    self.pev.effects |= EF_NODRAW;
                
    self.pev.flags &= ~FL_WORLDBRUSH;
                
                
    /*self.pev.rendermode  = kRenderTransTexture;
                self.pev.renderamt   = 0;*/
                
                
    g_EntityFuncs.SetModel(selfself.pev.model);
                
    g_EntityFuncs.SetSize(self.pevself.pev.minsself.pev.maxs);
                
    g_EntityFuncs.SetOrigin(selfself.pev.origin);
                
                
    CreateInvisibleWall();
                
                
    g_EntityFuncs.Removeself );
        }
        
        
    void CreateInvisibleWall( )
        {
                
    int flags SF_CLIP_MONSTER SF_CLIP_PUSHABLE SF_CLIP_ITEMINV;
                
    CBaseEntityendEntity g_EntityFuncs.Create"func_clip"self.pev.originVector(000), true );
                
    g_EntityFuncs.DispatchKeyValueendEntity.edict(), "model"self.pev.model );
                
    g_EntityFuncs.DispatchKeyValueendEntity.edict(), "targetname"self.pev.targetname );
                
    //g_EntityFuncs.DispatchKeyValue( endEntity.edict(), "skin", "-1" );
                
                
    if( m_startoff )
                    
    flags |= SF_CLIP_STARTOFF;
                
                
    g_EntityFuncs.DispatchKeyValueendEntity.edict(), "spawnflags"flags );
                
    g_EntityFuncs.DispatchSpawnendEntity.edict() );
                
                
    endEntity.pev.effects |= EF_NODRAW;
        }
        
        
    bool m_startoff;
    }

    /*
    *    Call this to init func_vehicle_custom
    *    If you want debugging code accessible through chat, set fAddDebugCode to true
    */
    void InvisibleEntityMapInit( )
    {
        
    g_CustomEntityFuncs.RegisterCustomEntity"invisible_entity""invisible_entity" );


  5. #5
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,965

    Re: [Request] add old entity

    Quote Originally Posted by w00tguy123 View Post
    I think he's asking someone else to write the script, and the code he wrote there was just an example of what it might do.
    Yes,

    ex: toonrun1
    remove error:
    ERROR: Angelscript: Cannot instantiate entity: Entity 'info_landmark' does not exist!
    ERROR: Angelscript: Cannot instantiate entity: Entity 'TODO' does not exist!
    ERROR: Angelscript: Cannot instantiate entity: Entity 'info_texlights' does not exist!
    Angelscript: Beginning plugin 'old_entity' compilation
    Angelscript: Starting compilation: 1 scripts
    ERROR: Angelscript: x:/server/svencoop/scripts/plugins/old_entity.as (12, 23) : Identifier 'ScriptBaseEntity' is not a data type in global namespace
    ERROR: Angelscript: x:/server/svencoop/scripts/plugins/old_entity.as (16, 24) : Identifier 'ScriptBaseEntity' is not a data type in global namespace
    Angelscript: e:/server/svencoop/scripts/plugins/old_entity.as (20, 1) : Compiling void RegisterOldEntities()
    ERROR: Angelscript: x:/server/svencoop/scripts/plugins/old_entity.as (22, 2) : 'g_CustomEntityFuncs' is not declared
    ERROR: Angelscript: x:/server/svencoop/scripts/plugins/old_entity.as (23, 21) : Illegal operation on 'int'
    ERROR: Angelscript: Plugin script compilation failed

    Code:
    /*
    * This script implements all old entity
    */
    
    void PluginInit()
    {
    	g_Module.ScriptInfo.SetAuthor( "none" );
    	g_Module.ScriptInfo.SetContactInfo( "none @ Svencoop forums" );
    	RegisterOldEntities();
    }
    
    class info_landmark : ScriptBaseEntity
    {
    }
    
    class info_texlights : ScriptBaseEntity
    {
    }
    
    void RegisterOldEntities()
    {
    	g_CustomEntityFuncs.RegisterCustomEntity( "info_landmark", "info_landmark" );
    	g_CustomEntityFuncs.RegisterCustomEntity( "info_texlights", "info_texlights" );
    }
    help me
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

  6. #6
    200 MB Angelscript log file KernCore's Avatar  
    Artist
    Join Date
    Apr 2016
    Location
    Brazil
    Posts
    274

    Re: [Request] add old entity

    Do you know what each of these entities does? Or are supposed to do?

  7. #7
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,965

    Re: [Request] add old entity

    no,
    I want to delete errors in the console and log.
    Je souhaite supprimer les erreurs dans la console et les log.

    copy code script to env_te.as
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

  8. #8
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,054

    Re: [Request] add old entity

    Info_texlights is an ZHLT entity that is only used for compiling the map. It is strange that this error message is found in the log, since that entity should be removed after compiling. Maybe some of the old compile tools didn't do that.

    As far as I know, info_landmark is a single player only entity. It remembers the entities around the player before the level change and carries them over to the next. Since servers start a whole new map upon a level change, all this information is lost. Therefore info_landmark is useless. It's also no longer in the FGD.

    The script Spy is asking for would only remove the error messages from the console and the log. The entities themselves don't do any harm to the map. If everyone had to run this AS to fix a few console lines then that would be much more of a hassle. I guess the dev's should just make sure that the engine removes any unnecessary entities (such as info_landmarks) in the future if we really want to be nitpicky. But I guess 99% of our players will not care much about those few lines.

  9. #9
    Sharding /dev/null Duggles's Avatar  
    Programmer
    Join Date
    May 2005
    Posts
    99

    Re: [Request] add old entity

    Angelscript iterates over all the entities found in the map file and attempts to map them to entities defined in the game. I'll see if I can make a list of exceptions to this mapping so these known problematic entities can be safely ignored (obviously you don't want to ignore entities which should be mapped but are failing, so I don't want to turn off this error reporting completely).

  10. #10
    Registered User
    Join Date
    Mar 2012
    Posts
    538

    Re: [Request] add old entity

    Quote Originally Posted by Hezus View Post
    As far as I know, info_landmark is a single player only entity. It remembers the entities around the player before the level change and carries them over to the next. Since servers start a whole new map upon a level change, all this information is lost. Therefore info_landmark is useless. It's also no longer in the FGD.
    In HL, info_landmark only works with level transitions. However, it has an additional function in the Source engine with trigger_teleports.

    Normally a trigger_teleport will just dump whatever it teleports to the destination teleport target. If you specify a landmark in the trigger_teleport, you will be teleported to the destination relative to your location of the info_landmark. So instead of everything getting dumped to the same location, entities will be teleported to different relative positions.

  11. #11
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,965

    Re: [Request] add old entity

    Quote Originally Posted by Duggles View Post
    ... I'll see if I can make a list of exceptions to this mapping so these known problematic entities can be safely ignored ...
    Thanks, Duggles

    bts 3485
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

  12. #12
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,965

    Re: [Request] add old entity

    Hello, Duggles

    Did you find out how to create an exceptions list to ignore known error messages?
    Avez-vous trouvé comment créer une liste exceptions pour ignorer les messages d'erreur connus ?

    Thanks
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

  13. #13
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,965

    Re: [Request] add old entity

    Hello

    I have update the code
    svencoop\scripts\plugins\old_entity.as

    Code:
    /*
    * This script implements all old entity
    */
    
    //OK
    
    void MapInit()
    { 
    	RegisterOldinfolandmarkEntities();
    	RegisterOldinfotexlightsEntities();
    }
    
    void PluginInit()
    {
    	g_Module.ScriptInfo.SetAuthor( "Spy" );
    	g_Module.ScriptInfo.SetContactInfo( "Spy @ Svencoop forums" );
    }
    
    class info_landmark : ScriptBaseEntity
    {
    }
    
    class info_texlights : ScriptBaseEntity
    {
    }
    
    string GetinfolandmarkName()
    {
    	return "info_landmark";
    }
    
    string GetinfotexlightsName()
    {
    	return "info_texlights";
    }
    
    void RegisterOldinfolandmarkEntities()
    {
    	g_CustomEntityFuncs.RegisterCustomEntity( "info_landmark", GetinfolandmarkName() );
    }
    
    void RegisterOldinfotexlightsEntities()
    {
    	g_CustomEntityFuncs.RegisterCustomEntity( "info_texlights", GetinfotexlightsName() );
    }
    as_reloadplugins
    WARNING: Angelscript: Skipping plugin 'old_entity', plugin already exists and requires delayed removal.

    Thank you
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

Posting Permissions

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