Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Ayumi, Akow, AndrewAMD), 1,505 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: fighting the "my" pointer [Re: Ch40zzC0d3r] #396008
03/01/12 12:30
03/01/12 12:30
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I could not update anet because it changed some things that I am still using.

EvilSOB, the entity we were talking about first has nothing to do with Enet at all. I'm just saying I get a similar error somewhere else, and also in another ent_remove. So something seems to edit the data where "my" points without my permission or knowledge.

I can try your suggestion.


~"I never let school interfere with my education"~
-Mark Twain
Re: fighting the "my" pointer [Re: Germanunkol] #396075
03/02/12 12:19
03/02/12 12:19
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
EvilSOB, I tried your code. I get script crash in se8, but neither of the errors pop up...

What I was thinking: Is there a way to see all of the ram used by the entity somehow? Like, I'd like to dump all the ram used by the entity (maybe using size_of(ENTITY)) at the beginning of the function and then also at the end of the function...

Edit: I think I'm going to take this to the ask the developers forum. There's only two types of crashes left in my game that I currently know of. One's on the level_load function, and one on multiple ent_remove functions. And I simply know too little about what goes on behind the curtain in order to do anything useful.

Last edited by Germanunkol; 03/02/12 13:04.

~"I never let school interfere with my education"~
-Mark Twain
Re: fighting the "my" pointer [Re: Germanunkol] #396086
03/02/12 14:53
03/02/12 14:53
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Going to the developers forum is a good idea methinks. This is getting too weird...

But my last snippet may have been sucessfully linking to dead pointers.
So try this one...

Code:
...
	if(my) 
	{
		sys_marker("se6");
		logNewValue("mE", me, debugLog, OFF);
		logNewValue("mY", my, debugLog, OFF);

		sys_marker("se7");	ENTITY* tmpE;
		for(tmpE=ent_next(NULL); tmpE; tmpE=ent_next(tmpE)) 
		{	if(tmpE==me)	{	ent_remove(me);		break;	}	}
		if(tmpE != me)		{	error("entity not found ... dead?");	}
	}
	sys_marker("se8");
}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: fighting the "my" pointer [Re: EvilSOB] #396147
03/03/12 13:51
03/03/12 13:51
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I don't understand your code here. I DO get the error message, on the first time this entity is removed. Which, in my eyes, makes sense, because as soon as ent_remove is (successfully) called, me is set to NULL and tmpE is not, so outside the while loop tmpE != me is always true.

I posted the issue in the "ask the developers" forum. See here: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=396146#Post396146


~"I never let school interfere with my education"~
-Mark Twain
Re: fighting the "my" pointer [Re: Germanunkol] #396177
03/03/12 17:39
03/03/12 17:39
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ok, here is a revised version of my above code that should clarify what Im TRYING to do...
Code:
...
	if(my) 
	{
		sys_marker("se6");
		logNewValue("mE", me, debugLog, OFF);
		logNewValue("mY", my, debugLog, OFF);

		sys_marker("se7");	ENTITY* tmpE;
		for(tmpE=ent_next(NULL); tmpE; tmpE=ent_next(tmpE)) 
		{	if(tmpE==me)
			{	ent_remove(me);
				me = -1;
				break;
			}
		}
		if(me != -1)		{	error("entity not found ... dead?");	}
	}
	sys_marker("se8");
}



Beware of possibly flawed logic, but what Im trying to do is as follows...

The FOR loop is checking through all VALID entities.
If it finds a match to ME, then it ent)remove's ME and exits the loop.

The IF following the loop is meant to detect if the loop found ME and removed it,
or if it 'fell through' by not finding ME within all valid entities.


I havent tested this code at all, so I dont know if the "me = -1;" may need
re-casting, with something like "me = (ENTITY*)-1;".


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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