Raised This Month: $ Target: $400
 0% 

[Orpheu] Invalid parameter count


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 09-23-2011 , 09:23   [Orpheu] Invalid parameter count
Reply With Quote #1

I've been playing around with orpheu and i got this error that i don't understand.

Code:
L 09/23/2011 - 15:19:07: [ORPHEU] Invalid parameters count. Expected [5]. Got [4]
L 09/23/2011 - 15:19:07: [AMXX] Displaying debug trace (plugin "test.amxx")
L 09/23/2011 - 15:19:07: [AMXX] Run time error 10: native error (native "OrpheuCall")
L 09/23/2011 - 15:19:07: [AMXX]    [0] test.sma::CmdGib (line 24)
According to the hlsdk & the linux binaries in IDA pro it only has 3 parameters:

Code:
void CGib :: SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs )
{
	int i;

	if ( g_Language == LANGUAGE_GERMAN )
	{
		// no sticky gibs in germany right now!
		return; 
	}

	for ( i = 0 ; i < cGibs ; i++ )
	{
		CGib *pGib = GetClassPtr( (CGib *)NULL );

		pGib->Spawn( "models/stickygib.mdl" );
		pGib->pev->body = RANDOM_LONG(0,2);

		if ( pevVictim )
		{
			pGib->pev->origin.x = vecOrigin.x + RANDOM_FLOAT( -3, 3 );
			pGib->pev->origin.y = vecOrigin.y + RANDOM_FLOAT( -3, 3 );
			pGib->pev->origin.z = vecOrigin.z + RANDOM_FLOAT( -3, 3 );

			/*
			pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * (RANDOM_FLOAT ( 0 , 1 ) );
			pGib->pev->origin.y = pevVictim->absmin.y + pevVictim->size.y * (RANDOM_FLOAT ( 0 , 1 ) );
			pGib->pev->origin.z = pevVictim->absmin.z + pevVictim->size.z * (RANDOM_FLOAT ( 0 , 1 ) );
			*/

			// make the gib fly away from the attack vector
			pGib->pev->velocity = g_vecAttackDir * -1;

			// mix in some noise
			pGib->pev->velocity.x += RANDOM_FLOAT ( -0.15, 0.15 );
			pGib->pev->velocity.y += RANDOM_FLOAT ( -0.15, 0.15 );
			pGib->pev->velocity.z += RANDOM_FLOAT ( -0.15, 0.15 );

			pGib->pev->velocity = pGib->pev->velocity * 900;

			pGib->pev->avelocity.x = RANDOM_FLOAT ( 250, 400 );
			pGib->pev->avelocity.y = RANDOM_FLOAT ( 250, 400 );

			// copy owner's blood color
			pGib->m_bloodColor = (CBaseEntity::Instance(pevVictim))->BloodColor();
		
			if ( pevVictim->health > -50)
			{
				pGib->pev->velocity = pGib->pev->velocity * 0.7;
			}
			else if ( pevVictim->health > -200)
			{
				pGib->pev->velocity = pGib->pev->velocity * 2;
			}
			else
			{
				pGib->pev->velocity = pGib->pev->velocity * 4;
			}

			
			pGib->pev->movetype = MOVETYPE_TOSS;
			pGib->pev->solid = SOLID_BBOX;
			UTIL_SetSize ( pGib->pev, Vector ( 0, 0 ,0 ), Vector ( 0, 0, 0 ) );
			pGib->SetTouch ( &CGib::StickyGibTouch );
			pGib->SetThink (NULL);
		}
		pGib->LimitVelocity();
	}
}


My code:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <orpheu>

new OrpheuFunctionFwdSpawnStickyGibs;

public 
plugin_precache()
    
precache_model("models/stickygib.mdl");
    
    
public 
plugin_init()
{
    
FwdSpawnStickyGibs OrpheuGetFunction("SpawnStickyGibs""CGib");

    
register_clcmd("say /gib""CmdGib");
}


public 
CmdGib(id)
{
    new 
FloatflOrigin[3];
    
pev(idpev_originflOrigin);
    
    
OrpheuCall(FwdSpawnStickyGibsidflOrigin10);

    
client_print(idprint_chat"GIBBING...");


Signature:
Code:
{
	"name"		: "SpawnStickyGibs",
	"class"		: "CGib",
	"library"	: "mod",
	"arguments" : 
	[
		{
			"info" : "Victim id",
			"type" : "entvars_s *"
		},
		{
			"info" : "Origin",
			"type" : "Vector"
		},
		{
			"info" : "Amount of gibs",
			"type" : "int"
		}
	],
	"identifiers":
	[
		{
			"os"	: "windows",
			"mod"	: "cstrike",
			"value"	: [0x8B,0x49,"*",0x83,0xEC,"*",0x83,0xC1,"*",0xD9,0x41,"*",0xD9,0x41,"*",0xD9]
		},
		{
			"os"	: "linux",
			"mod"	: "cstrike",
			"value" : "SpawnStickyGibs__4CGibP9entvars_sG6Vectori"
		}
	]
}
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-23-2011 , 09:48   Re: [Orpheu] Invalid parameter count
Reply With Quote #2

I don't think orpheu has support for Vector at this point. I'm sure Arkshine or quim will chime in to confirm the problem.
__________________
Bugsy is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 09-23-2011 , 10:00   Re: [Orpheu] Invalid parameter count
Reply With Quote #3

Yeah, i've checked the orpheu thread again & found these data types:
Code:
    "bool"
    "byte"
    "long"
    "CBaseEntity *"
    "char *"
    "edict_s *"
    "float"
    "Vector *"
    "CMBaseMonster *"
    "char"
    "short"
    "entvars_s *"
I guess i'll just have to wait for an update

Thanks


Edit:
The argument type is accepted when the signatures are loaded though, not sure if this means anything:
Code:
Parsing file "SpawnStickyGibs" started
 Argument type "entvars_s *" validated
 Argument type "Vector" validated
 Argument type "int" validated
 Searching for signature "[0x8b][0x49][*][0x83][0xec](...)" ... FOUND
Parsing file "SpawnStickyGibs"
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 09-23-2011 at 10:02. Reason: Fixed typo
drekes is offline
Send a message via MSN to drekes
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-23-2011 , 10:15   Re: [Orpheu] Invalid parameter count
Reply With Quote #4

don't wait for the update, cause you can't pass a class member as parameter through pawn, you will find that all the para types listed above are actually sort of value, number or address. that's the limitation of this script stuff.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 09-23-2011 , 10:28   Re: [Orpheu] Invalid parameter count
Reply With Quote #5

I don't know much about those things :S

Could you explain what class members are ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-23-2011 , 10:29   Re: [Orpheu] Invalid parameter count
Reply With Quote #6

a member of a class, like Vector origin;
origin is the member of class "Vector"
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 09-23-2011 , 10:29   Re: [Orpheu] Invalid parameter count
Reply With Quote #7

Quote:
Originally Posted by drekes View Post
Could you explain what class members are ?
Variables and functions declared in a class. Same goes for Pawn's enumerations.
PHP Code:
enum TestEnumeration
{
    
TestVariable,
    
TestArray[2]
}; 
TestVariable and TestArray[] are members of TestEnumeration.
__________________

Last edited by hleV; 09-23-2011 at 10:32.
hleV is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 09-23-2011 , 10:37   Re: [Orpheu] Invalid parameter count
Reply With Quote #8

Okay, now i get it.

So there's no way to handle that function ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-23-2011 , 10:43   Re: [Orpheu] Invalid parameter count
Reply With Quote #9

then orpheu will change the way how it works, like get the float x,y,z pawn passed, and declare temp Vector(x, y, z), pass manually to that function. that conflit with the original procedure how orpheu does.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 09-23-2011 , 10:46   Re: [Orpheu] Invalid parameter count
Reply With Quote #10

I'll try to figure it out, thanks everyone.

Edit:
I seem to have the same problem with CGib::SpawnHeadGib() which doesn't use Vector *

My code:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <orpheu>

new OrpheuFunctionFwdSpawnHeadGib;


public 
plugin_init()
{
    
FwdSpawnHeadGib OrpheuGetFunction("SpawnHeadGib""CGib");
    
    
register_clcmd("say /gib""CmdGib");
}


public 
CmdGib(id)
{
    
OrpheuCall(FwdSpawnHeadGibid);
    
    return 
PLUGIN_HANDLED;

Signature:
Code:
{
	"name"		: "SpawnHeadGib",
	"class"		: "CGib",
	"library"	: "mod",
	"arguments" : 
	[
		{
			"info" : "Player Id",
			"type" : "entvars_s *"
		}
	],
	"identifiers":
	[
		{
			"os"	: "windows",
			"mod"	: "cstrike",
			"value"	: [0x83,0xEC,"*",0x56,0x57,0xFF,"*","*","*","*","*",0x85,0xC0,"*","*",0x33,0xFF,"*","*",0x8D,0xB8,"*","*","*","*",0x8B,0x87,"*","*","*","*",0x85,0xC0,"*","*",0x8B,0x70,"*",0x85,0xF6,"*","*",0x68,"*","*","*","*",0x50,0xFF,"*","*","*","*","*",0x83,0xC4,"*"]
		},
		{
			"os"	: "linux",
			"mod"	: "cstrike",
			"value" : "SpawnHeadGib__4CGibP9entvars_s"
		}
	]
}
Error:
Code:
L 09/23/2011 - 17:23:34: [ORPHEU] Invalid parameters count. Expected [3]. Got [2]
L 09/23/2011 - 17:23:34: [AMXX] Displaying debug trace (plugin "test.amxx")
L 09/23/2011 - 17:23:34: [AMXX] Run time error 10: native error (native "OrpheuCall")
L 09/23/2011 - 17:23:34: [AMXX]    [0] test.sma::CmdGib (line 18)
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 09-23-2011 at 11:29.
drekes is offline
Send a message via MSN to drekes
Reply



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 19:31.


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