Renegade Public Forums
C&C: Renegade -- Dead since 2012!™
Home » Renegade Discussions » Tiberian Technologies Forum » Client Crash
Client Crash [message #484515] Wed, 20 November 2013 16:18 Go to next message
Neijwiert  is currently offline Neijwiert  
Messages: 124
Registered: October 2009
Recruit
From: *dynamic.upc.nl
Crash type:
Internal error, nothing else specified.

Set-Up:
I have the latest version of scripts on both my client and server, I am running a single custom plugin. This plugin does something that makes the client crash under these conditions:

- The player is already in the game
- The server loads the next map
- On the OnLoadLevel SSGM event there is a chain of events and it eventually leeds to this code:

GameObject *TimerObj = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
this->_TimerObject = TimerObj->Get_ID();
TimerObj->Add_Observer(this);

- There no longer is any crash when the Add_Observer line is removed.

Layout of the class 'this' points to:

Toggle Spoiler


I was unable to reproduce it with an empty class that called the same pieces of code on the constructor of the class at the same time.

CrashDump attached.

Re: Client Crash [message #484516] Wed, 20 November 2013 17:00 Go to previous messageGo to next message
jonwil  is currently offline jonwil  
Messages: 3544
Registered: February 2003
General (3 Stars)

From: *static.tpgi.com.au
Try this code instead for NTCPowerupSpawner.
class NTCPowerupSpawner : public GameObjObserverClass
{
	friend class NTCPowerupControl;
	friend class NTC_Powerup;

	public:
		NTCPowerupSpawner(int SpawnerID, bool Enabled, const char *Preset, Vector3 &Position, int MaxSpawnCount, float SpawnDelay);
		virtual void Timer_Expired(GameObject *obj, int number);
		int Get_Spawner_ID();
		void Toggle_Spawner(bool Enable);
		void Spawn_Powerup(bool Decrease);
		void Entered( GameObject* pObj, GameObject* pEnterer )  {}
		void Exited( GameObject* pObj, GameObject* pExiter )    {}
		void Attach ( GameObject* pObj ) {};
		void Detach ( GameObject* pObj ) {};
		void Animation_Complete ( GameObject *pObj, const char *animation_name ) {};
		void Created(GameObject* pObj) {};
		void Destroyed(GameObject* pObj) {};
		void Killed(GameObject* pObj,GameObject* pKiller) {};
		void Damaged(GameObject* pObj,GameObject* pDamager,float amount) {};
		void Custom(GameObject* pObj,int type,int param,GameObject* pSender) {};
		void Sound_Heard(GameObject* pObj,const CombatSound & sound) {};
		void Enemy_Seen(GameObject* pObj,GameObject* pEnemy) {};
		void Action_Complete(GameObject* pObj,int action_id,ActionCompleteReason complete_reason) {};
		void Poked(GameObject* pObj,GameObject* pPoker) {};
		const char* Get_Name() { return "NTCPowerupSpawner"; }
	protected:
		void OnThink();
		void Remove_Powerup();
		bool Can_Spawn();
		void Force_Spawn_Powerup(bool Decrease);
		GameObject *Create_Timer_Object();
		void Start_Timer(float Delay = 0);
		GameObject *Get_Object(int &ID);
		void Remote_Spawn_Powerup(bool Decrease);
	private:
		int _SpawnerID;
		bool _Enabled;
		StringClass _Preset;
		Vector3 _Position;
		int _SpawnsRemaining;
		int _Item;
		bool _SpawnPending;
		float _SpawnDelay;
		int _TimerObject;
};


Since NTCPowerupSpawner isn't a script (it doesn't have a ScriptFactory and it isn't created via Create_Script), it should not derive from ScriptImpClass but instead from GameObjObserverClass.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Client Crash [message #484522] Thu, 21 November 2013 06:44 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 124
Registered: October 2009
Recruit
From: *dynamic.upc.nl
Changed it.

It now is a seperate class that is registered to the scriptfactory.

I still experience a client crash.

[Updated on: Thu, 21 November 2013 06:45]

Re: Client Crash [message #484523] Thu, 21 November 2013 09:52 Go to previous messageGo to next message
danpaul88  is currently offline danpaul88  
Messages: 5792
Registered: June 2004
Location: England
General (5 Stars)
From: *fluke.nl
And did you actually attach it as a script? You can't use Add_Observer with a ScriptImpClass, they're not designed for that. Use GameObjObserverClass as your base class if you want to use Add_Observer, as jonwil posted above.


http://steamsignature.com/card/1/76561197975867233.png
Re: Client Crash [message #484533] Thu, 21 November 2013 18:15 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 124
Registered: October 2009
Recruit
From: *dynamic.upc.nl
Didn't elaborate my second message well enough. I am not attaching the script trough Add_Observer anymore, but trough Commands->Attach_Script.

I'm still experiencing client crashes.
Re: Client Crash [message #484537] Fri, 22 November 2013 01:03 Go to previous messageGo to next message
iRANian  is currently offline iRANian  
Messages: 4293
Registered: April 2011
General (4 Stars)
From: *cm-8.dynamic.ziggo.nl
Try doing it with Add_Observer() now as you changed your class to derive from GameObserverClass


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: Client Crash [message #484538] Fri, 22 November 2013 03:20 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 124
Registered: October 2009
Recruit
From: *dynamic.upc.nl
Quote:

Try doing it with Add_Observer() now as you changed your class to derive from GameObserverClass


That will not suit my needs, that class doesn't support Commands->Start_Timer.

The point is that it still crashes, even when I now have a seperate class that is a valid ScriptImpClass registered at the Scriptfactory.

This indicates that the problem lays elsewhere.
Re: Client Crash [message #484549] Sat, 23 November 2013 10:16 Go to previous messageGo to next message
Ethenal  is currently offline Ethenal  
Messages: 2532
Registered: January 2007
Location: US of A
General (2 Stars)

From: *static.leds.al.charter.com
Have you attached to the FDS with the debugger and walked through to see which step is crashing? Might save you a tremendous amount f time...


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Client Crash [message #484551] Sat, 23 November 2013 12:09 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 124
Registered: October 2009
Recruit
From: *dynamic.upc.nl
Well something is going wrong externally, but I have no way of knowing what I'm doing wrong that's causing it. I'm missing source code...
Re: Client Crash [message #484552] Sat, 23 November 2013 12:13 Go to previous messageGo to next message
Ethenal  is currently offline Ethenal  
Messages: 2532
Registered: January 2007
Location: US of A
General (2 Stars)

From: *static.leds.al.charter.com
What do you mean? The crash isn't occurring in your code?

If that's true and you're sure it's not some Microsoft DLL (i.e. incorrect usage of a string function or something) then post up (or private message to StealthEye or jonwil) the source and crash dump and the TT developers can look at it, since they actually have the symbols for tt.dll.


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Client Crash [message #484566] Sat, 23 November 2013 17:35 Go to previous messageGo to next message
jonwil  is currently offline jonwil  
Messages: 3544
Registered: February 2003
General (3 Stars)

From: *static.tpgi.com.au
I can confirm that yes its crashing somewhere in the tt code.
However, our debug symbol server is down right now so we cant debug the crash at this point.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Client Crash [message #484596] Tue, 26 November 2013 22:37 Go to previous message
jonwil  is currently offline jonwil  
Messages: 3544
Registered: February 2003
General (3 Stars)

From: *static.tpgi.com.au
Our debug symbol server is back and I have examined this dump. Not sure why its crashing, all I can say is that it seems to be crashing in the netcode somewhere.
If its still failing once 4.1 is out, we will debug further.

[Updated on: Tue, 26 November 2013 22:37]


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Previous Topic:windows 8.1 not working with my scripts
Next Topic:WeaponBag
Goto Forum:
  


Current Time: Thu Nov 15 12:15:53 MST 2018
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7RC2.
Copyright ©2001-2007 FUD Forum Bulletin Board Software