Advertisement

Function names

Started by June 21, 2006 04:10 AM
2 comments, last by Maddi 18 years, 5 months ago
Me again. I have now written an .as code that I try to compile and run.

class CMyGame
{
	// Functions
	void init()
	{
		this.m_inst.setTemplate(cast(this.m_tile));
	}
	
	void update()
	{
	this.m_inst.render();
	}
	// Member Variables
	instance	m_inst;
	tile		m_tile;	
};
CMyGame game;
void init()
{
	game.init();
}
void update()
{
	game.update();
}
If I now try to call the function init() with:

m_iInitFuncId = m_pEngine->GetFunctionIDByDecl("game", "void init()");

if(!m_iInitFuncId)
	return false;
if(m_pContext->Prepare(m_iInitFuncId) != 0)
	return false;
if(m_pContext->Execute() != 0)
	return false;
return true;
}
m_iInitFuncId is now 'asMULTIPLE_FUNCTIONS'. Why is that, can't as differ between class and global functions ? As I understood, to retrieve class methods one uses 'GetMethodIDxxx'. Maddi
This might be a bug in AngelScript. What version are you using?

I'll investigate this.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
I've fixed this bug now. You can find the fix in the SVN (rev 45).

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks !

This topic is closed to new replies.

Advertisement