🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Function names

Started by
2 comments, last by Maddi 18 years 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
Advertisement
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

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