Raised This Month: $410 Target: $400
 102% 

Solved [HELP] Particle precache with invalid handle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
laper32
Junior Member
Join Date: Nov 2019
Old 01-04-2020 , 12:07   [HELP] Particle precache with invalid handle
Reply With Quote #1

I'm using zombie plague's framework: https://forums.alliedmods.net/showthread.php?t=290657
When I import ZP's code about particle to my own, I found that here is an error occurs but several months ago it could work.

PHP Code:
L 01/05/2020 00:53:11: [SMException reportedInvalid Handle 0 (error 4)
L 01/05/2020 00:53:11: [SMCall stack trace:
L 01/05/2020 00:53:11: [SM]   [0SDKCall
L 01
/05/2020 00:53:11: [SM]   [1Line 170modules/manager/visualeffects/part
icles
.cpp::ParticlesFindTable
L 01
/05/2020 00:53:11: [SM]   [2Line 51modules/manager/visualeffects/parti
cles
.cpp::ParticlesOnCacheData 
The code is shown below:

PHP Code:
Handle hSDKCallContainerFindTable;

Address pNetworkStringTable;


void ParticlesOnCacheData()
{
    
// Validate that table is exist and it empty
    
Address pTable ParticlesFindTable("ParticleEffectNames");
    if(
pTable != Address_Null && !ParticlesCount())
    {
        
// Opens the file
        
File hFile OpenFile("particles/particles_manifest.txt""rt"true);
        
        
// If doesn't exist -> stop
        
if(hFile == null)
        {
            
SetFailState("Error opening file: \"particles/particles_manifest.txt\"");
            return;
        }

        
// Read lines in the file
        
static char sPath[256];
        while(
hFile.ReadLine(sPathsizeof(sPath)))
        {
            
// Checks if string has correct quotes
            
int iQuotes CountCharInString(sPath'"');
            if(
iQuotes == 4)
            {
                
// Trim string
                
TrimString(sPath);

                
// Copy value string
                
strcopy(sPathsizeof(sPath), sPath[strlen("\"file\"")]);
                
                
// Trim string
                
TrimString(sPath);
                
                
// Strips a quote pair off a string 
                
StripQuotes(sPath);

                
// Precache model
                
int i; if(sPath[i] == '!'i++;
                
PrecacheGeneric(sPath[i], true);
                
ParticlesClearTable(pTable); /// HACK~HACK
                /// Clear tables after each file because some of them contains
                /// huge amount of particles and we work around the limit
            
}
        }
    }
}

Address ParticlesFindTable(char[] sTable)
{
    return 
SDKCall(hSDKCallContainerFindTablepNetworkStringTablesTable);

I don't know why this error occurs....

UPDATE: This problem points to find signature eventually.
It seems that Valve has changed "CParticleSystemDictionary::~CParticleSystemD ictionary" address.
But overall, it solved, for me, at least.

Last edited by laper32; 01-05-2020 at 02:08.
laper32 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-04-2020 , 12:20   Re: [HELP] Particle precache with invalid handle
Reply With Quote #2

hSDKCallContainerFindTable isn't being set.
__________________
Mitchell is offline
laper32
Junior Member
Join Date: Nov 2019
Old 01-04-2020 , 12:38   Re: [HELP] Particle precache with invalid handle
Reply With Quote #3

Quote:
Originally Posted by Mitchell View Post
hSDKCallContainerFindTable isn't being set.
Hmm....But I have already set it as a Handle

PHP Code:
Handle hSDKCallContainerFindTable
laper32 is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 01-04-2020 , 13:37   Re: [HELP] Particle precache with invalid handle
Reply With Quote #4

You never setup the sdkcall (https://sm.alliedmods.net/new-api/sd...artPrepSDKCall)
Setting the info: https://sm.alliedmods.net/new-api/sd...ll_SetFromConf
For params: https://sm.alliedmods.net/new-api/sd...l_AddParameter
Return Info: https://sm.alliedmods.net/new-api/sd..._SetReturnInfo
Finalize the SDKCall with https://sm.alliedmods.net/new-api/sd...EndPrepSDKCall

Also make sure to check the value of EndPrepSDKCall if its a valid handle or not which indicates something went wrong during the setup process.

Last edited by xerox8521; 01-04-2020 at 13:38. Reason: Added Info about the return value of EndPrepSDKCall
xerox8521 is offline
laper32
Junior Member
Join Date: Nov 2019
Old 01-04-2020 , 19:48   Re: [HELP] Particle precache with invalid handle
Reply With Quote #5

Quote:
Originally Posted by xerox8521 View Post
You never setup the sdkcall (https://sm.alliedmods.net/new-api/sd...artPrepSDKCall)
Setting the info: https://sm.alliedmods.net/new-api/sd...ll_SetFromConf
For params: https://sm.alliedmods.net/new-api/sd...l_AddParameter
Return Info: https://sm.alliedmods.net/new-api/sd..._SetReturnInfo
Finalize the SDKCall with https://sm.alliedmods.net/new-api/sd...EndPrepSDKCall

Also make sure to check the value of EndPrepSDKCall if its a valid handle or not which indicates something went wrong during the setup process.
It is solved by using Signature.
------------------------------------------------
Referencing Zombie plague.

Last edited by laper32; 01-13-2020 at 21:29.
laper32 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:25.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode