Gamestudio Links
Zorro Links
Newest Posts
A8 and Draw_Line3D (SOLVED)
by Dooley. 06/19/19 21:27
Bring the old grin back!
by alibaba. 06/19/19 20:35
FXCM: "Can't connect to price server"
by jcl. 06/19/19 15:47
Data Execution Prevention Strikes Again
by Dooley. 06/19/19 15:38
assert
by jcl. 06/19/19 14:59
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
6 registered members (Dooley, AndrewAMD, alibaba, Quad, 2 invisible), 645 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Qw3rty, Dal, Carson, giantj, dh85
18236 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Error E1515: Invalid arguments #439939
04/13/14 12:09
04/13/14 12:09
Joined: Dec 2011
Posts: 1,811
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,811
Netherlands
Hey all,

I sometimes get the invalid arguments error in my mp game when I test it with several clients and let a client fire. The error refers to my 'missile' code (code is below). It probably has got something to do with ent_remove (at the end of the code) that makes a pointer unusable. If I remove the ent_remove(me) line, the code gives no errors. So that is probably the cause of the error, but I have no idea how to solve since the manual does not give e.g. examples of ent_remove in multiplayer (yes blame the manual grin ). Anyway, below is the code of missile (where the error refers too):

Code:
action gun_laser_missile()
{	 	
if (connection & CONNECT_SERVER) my.smask |= NOSEND_FRAME | NOSEND_ALPHA | NOSEND_COLOR | NOSEND_FLAGS | NOSEND_SCALE;
while(connection != 0 && my.client_id < 0) wait(1);
...

	/////////////////////////////
	my.STATE = 1;
	
	....
	
	wait(1);
	c_setminmax(me);

	while(1)
	{	
	// state 1: flying ///////////////////////////////////////////  
		if (my.STATE == 1) 
		{
			if (connection == 2 && my.LIFETIME != 0) {
			ent_createlocal("MDL_MissileLaser.mdl",vector(my.x,my.y,my.z),gun_client_missile);
			my.LIFETIME = 0;
			set(my,INVISIBLE); }  

			//on server	
 			if (connection & CONNECT_SERVER || connection == 0) {
 			if (blabla == blabla) my.smask |= NOSEND_ORIGIN;	
 			my.LIFETIME -= time_step *4;
 			if (my.LIFETIME <= 0) my.STATE = 2; //go to STATE 2		
			//move projectile 	
			c_ignore(1,2,4,0);
			c_move(me,vector(my.MOVEMENTSPEED*time_step,0,0),vector(0,0,my.GRAVITY_SUM),IGNORE_PASSABLE);
			 //go to STATE 2
			 if (HIT_TARGET && my.STATE == 1) my.STATE = 2;
			}
		}

	// state 2: exploding ////////////////////////////////////////  
		if (my.STATE == 2) 
		{
			my.smask |= NOSEND;
                        break;
		} 
	wait(1);	
	}
	ent_remove(me);
}



Thanks in advance!

Re: Error E1515: Invalid arguments [Re: Reconnoiter] #439941
04/13/14 13:34
04/13/14 13:34
Joined: Jan 2002
Posts: 4,221
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,221
Germany / Essen
The "ent_remove(me);" is dead code anyways. So this call is not your problem for sure.


Always learn from history, to be sure you make the same mistakes again...
Re: Error E1515: Invalid arguments [Re: Uhrwerk] #439943
04/13/14 15:04
04/13/14 15:04
Joined: Dec 2011
Posts: 1,811
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,811
Netherlands
Thank you for commenting. But besides ent_remove, what could it be than?

I have in the action gun_client_missile (called by the line: ent_createlocal("MDL_MissileLaser.mdl",vector(my.x,my.y,my.z),gun_client_missile);), a few 'you's'. Could that be it, even though the error is refering to the action gun_laser_missile?

Re: Error E1515: Invalid arguments [Re: Reconnoiter] #439945
04/13/14 15:07
04/13/14 15:07
Joined: Jan 2002
Posts: 4,221
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,221
Germany / Essen
What does the error message exactly say?


Always learn from history, to be sure you make the same mistakes again...
Re: Error E1515: Invalid arguments [Re: Uhrwerk] #439947
04/13/14 15:38
04/13/14 15:38
Joined: Dec 2011
Posts: 1,811
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,811
Netherlands
"Error E1515:

Invalid function arguments in gun_laser_missile."

I get the error on the clients, but not on the server.

Re: Error E1515: Invalid arguments [Re: Reconnoiter] #440006
04/15/14 10:57
04/15/14 10:57
Joined: Dec 2011
Posts: 1,811
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,811
Netherlands
Also have the same error (but than 'invalid function arguments in enemy_missile') in my code for the enemy projectiles. Maybe it is the same thing that causes it?
Here's the code for the enemy projectile:

Code:
action enemy_missile()
{
if (connection & CONNECT_SERVER) my.smask |= NOSEND_FRAME | NOSEND_ALPHA | NOSEND_COLOR | NOSEND_FLAGS | NOSEND_SCALE;	
while(connection != 0 && my.client_id < 0) wait(1);	

my.group = 1; //projectiles		
...

my.STATE = 1;
	
my.LIFETIME = 200;
...
 	
	wait(1);
	c_setminmax(me);

	while(1)
	{	
	// state 1: flying ///////////////////////////////////////////  
		if (my.STATE == 1) 
		{  
			//on server	
 			if ((connection & CONNECT_SERVER) || connection == 0) {	
 			my.LIFETIME -= time_step *4;
			my.GRAVITY_SUM -= my.GRAVITY * time_step;	
 			if (my.LIFETIME <= 0) my.STATE = 2; //go to STATE 2		
			 //go to STATE 2
		 	 if (global_timer_cscan == 1 || global_timer_cscan == 3) {
			 c_ignore(1,3,4,0); 
			 if (c_scan(my.x, my.pan, vector(360, 360, my.AREAOFEFFECT), SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME) > 0) 
			  { my.STATE = 2; send_skill(my.STATE,SEND_ALL); }
			 }
			//move projectile 	
			c_ignore(1,2,3,4,0);
			c_move(me,vector(my.MOVEMENTSPEED*time_step,0,0),vector(0,0,my.GRAVITY_SUM),IGNORE_PASSABLE);
			 //go to STATE 2
			 if (HIT_TARGET && my.STATE == 1) { my.STATE = 2; send_skill(my.STATE,SEND_ALL); }
			}

                        //on client
			else {  
			//move projectile 	
			c_ignore(1,2,3,4,0);
			c_move(me,vector(my.MOVEMENTSPEED*time_step,0,0),vector(0,0,my.GRAVITY_SUM),IGNORE_PASSABLE);
			if (global_timer_cscan == 1 || global_timer_cscan == 3) {
			c_ignore(1,3,4,0); c_scan(my.x, my.pan, vector(360, 360, my.AREAOFEFFECT), SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME); }
			}
		}

	// state 2: exploding ////////////////////////////////////////  
		if (my.STATE == 2) 
		{
			my.smask |= NOSEND;
			break;
		} 

		wait(1);	
	}
	ent_remove(me);
}


Re: Error E1515: Invalid arguments [Re: Reconnoiter] #451253
04/30/15 21:12
04/30/15 21:12
Joined: Dec 2009
Posts: 82
D
Denn15 Offline
Junior Member
Denn15  Offline
Junior Member
D

Joined: Dec 2009
Posts: 82
Im sorry for reviving an old topic but i just want to know if you found a solution to this, cause I am experiencing this excact error myself too.

If I spamshoot alot of missiles, then eventually the client will crash with "invalid function arguments in shot_action", which is the action for the missiles and it is always the clients that get the error. I tried to do the same on the server however it does not crash.

Last edited by Denn15; 04/30/15 21:13.
Re: Error E1515: Invalid arguments [Re: Denn15] #451297
05/01/15 17:35
05/01/15 17:35
Joined: Dec 2011
Posts: 1,811
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,811
Netherlands
I haven't touched gs3d multiplayer the last couple months, but I think it has something to do with invalid pointers.

I think EpsiloN's idea in this thread ( http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=450296&page=2 ) of doing only local bullets is a way to completely solve it.

What at that time somewhat helped for me was to wait a bit before doing ent_remove (I made the bullet invisible, break the while loop and removing it from groups etc.) which seemed to help quite a bit, but not solving it completely.
It is playable though when warn level is set to a low number, though this is ofcourse not recommended if your going to make a commercial game of it since sooner or later some clients will get weirds bugs grin .
But for short/quick games its fine.

Re: Error E1515: Invalid arguments [Re: Reconnoiter] #451301
05/01/15 18:58
05/01/15 18:58
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Use ANet or another third party plugin. More power over the process is sometimes more better wink

Re: Error E1515: Invalid arguments [Re: Ch40zzC0d3r] #451303
05/01/15 19:29
05/01/15 19:29
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Some tips about these errors...

Never try to send a handle over the network.

Always check if you're spawning entities every frame (even
local ones, as in the first code posted here...) it will eventually crash laugh

You should try to use local bullets/missiles instead of global 'shared'. It will save you a lot of traffic, the error margin is the same...

Always wait one frame before an ent_remove statement. Another function might be running something on the current entity that's being deleted...So, wait until it finish and then remove!
(A wait call before an ent_remove will cause the ent_remove to be one of the first calls that will happen in the next frame, before any other function tries to access this entity...)

I cant say a correct reason for this error, but it might be caused by wrong number of parameters passed, I think, to a function, or the wrong type of parameter passed (eg, passing a string that contains a bitmap's name to a function that expects a bitmap pointer...)

I hope at least some of this helps laugh

Originally Posted By: Ch40zzC0d3r
Use ANet or another third party plugin. More power over the process is sometimes more better wink

I tried using ANet once...and some others...but eventually, I found out the native is best. Its just not used right or explained right laugh
I'll post my tutorial soon, and you'll understand my pov.

Last edited by EpsiloN; 05/01/15 19:32. Reason: ANet

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1