Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Squared'D

Member Since 08 Apr 2013
Offline Last Active Today, 07:15 AM

Topics I've Started

C++ STL-Style Array That's Compatible with AngelScript

04 January 2014 - 08:06 PM

I've written a wrapper for the CScriptArray add-on that makes it so you can use it almost exactly like std::vector. I wrote it so I could more easily share arrays with the C++ program and AngelScript. I've written a blog post for it. You can find the CScriptArraySTL class here:

 

http://squaredprogramming.blogspot.kr/2014/01/c-stl-style-array-thats-compatible-with.html

or

http://www.gamedev.net/blog/1670/entry-2259127-c-stl-style-array-thats-compatible-with-angelscript/

 

Let me know if you have any problems or if it's lacking any important functionality. I hope it's useful to others.


Assert Triggered in CScriptWeakRef with AngelScript 2.28 samples/game

19 December 2013 - 08:36 PM

I've been meaning to use AngelScript for some time, but I'm just getting around to adding it. I thought I'd start with the sample game. I compiled it and ran the program, but after selecting an action, the program gives the following assert message "Assertion failed: strcmp(type->GetName(), "weakref") == 0, file ...\weakref.cpp line 85". I did some investigating and found that when I downgraded to 2.27 it works. So I tried just using the weakref.cpp file from 2.27 with 2.28 and it worked. I'm not experienced enough with AngelScript to figure out why it crashes, but here's the difference in the code

 

2.28 Crashes

CScriptWeakRef::CScriptWeakRef(void *ref, asIObjectType *type)
{
	refCount = 1;
	m_ref  = ref;
	m_type = type;
	m_type->AddRef();

	// The given type should be the weakref template instance
	assert( strcmp(type->GetName(), "weakref") == 0 );

	// Get the shared flag that will tell us when the object has been destroyed
	// This is threadsafe as we hold a strong reference to the object
	m_weakRefFlag = m_type->GetEngine()->GetWeakRefFlagOfScriptObject(m_ref, m_type->GetSubType());
	if( m_weakRefFlag )
		m_weakRefFlag->AddRef();
}

2.27 Works

CScriptWeakRef::CScriptWeakRef(void *ref, asIObjectType *type)
{
	refCount = 1;
	m_ref  = ref;
	m_type = type;
	m_type->AddRef();

	// Get the shared flag that will tell us when the object has been destroyed
	// This is threadsafe as we hold a strong reference to the object 
	m_weakRefFlag = m_type->GetEngine()->GetWeakRefFlagOfScriptObject(m_ref, m_type->GetSubType());
	if( m_weakRefFlag )
		m_weakRefFlag->AddRef();

	// Release the handle that was received, since the weakref isn't suppose to prevent the object from being destroyed
	m_type->GetEngine()->ReleaseScriptObject(m_ref, m_type->GetSubType());
}

I don't know enough about AngelScript to say if a script error (the script needs to be updated) or if there's a problem with the sample's C++ code.


Auxnet: Battlegrounds

19 October 2013 - 05:32 PM

We've been working hard developing our game and have decided to show it to everyone. The game's name is Auxnet: Battlegrounds. Auxnet is a futuristic 3D arena game that was developed by 5 people, including just 1 programmer. The engine was developed internally by that programmer using Direct X.

 

You can find more information here.


Click here to view the project


PARTNERS