コード例 #1
0
ファイル: ScriptBind_Boids.cpp プロジェクト: AiYong/CryGame
CScriptBind_Boids::CScriptBind_Boids( ISystem *pSystem )
{
	m_pSystem = pSystem;
	CScriptableBase::Init( pSystem->GetIScriptSystem() );
	SetGlobalName( "Boids" );

	// For Xennon.
#undef SCRIPT_REG_CLASSNAME
#define SCRIPT_REG_CLASSNAME &CScriptBind_Boids::

	SCRIPT_REG_TEMPLFUNC(CreateFlock,"entity,nType,tParamsTable");
	SCRIPT_REG_TEMPLFUNC(SetFlockParams,"entity,tParamsTable");
	SCRIPT_REG_TEMPLFUNC(EnableFlock,"entity,bEnable" );
	SCRIPT_REG_TEMPLFUNC(SetFlockPercentEnabled,"entity,fPercentage" );
	SCRIPT_REG_TEMPLFUNC(OnBoidHit,"boidEntity,hit" );
	SCRIPT_REG_TEMPLFUNC(SetAttractionPoint, "entity,point");
	//SCRIPT_REG_TEMPLFUNC(Land, "flockEntity");
	//SCRIPT_REG_TEMPLFUNC(TakeOff, "flockEntity");

	m_pMethodsTable->SetValue( "FLOCK_BIRDS",EFLOCK_BIRDS );
	m_pMethodsTable->SetValue( "FLOCK_FISH",EFLOCK_FISH );
	m_pMethodsTable->SetValue( "FLOCK_BUGS",EFLOCK_BUGS );
	m_pMethodsTable->SetValue( "FLOCK_CHICKENS",EFLOCK_CHICKENS );
	m_pMethodsTable->SetValue( "FLOCK_FROGS",EFLOCK_FROGS );
	m_pMethodsTable->SetValue( "FLOCK_TURTLES",EFLOCK_TURTLES );
}
コード例 #2
0
ファイル: ScriptBind_Boids.cpp プロジェクト: aronarts/FireNET
CScriptBind_Boids::CScriptBind_Boids( ISystem *pSystem )
{
	m_pSystem = pSystem;
	CScriptableBase::Init( pSystem->GetIScriptSystem(),pSystem );
	SetGlobalName( "Boids" );

	// For Xennon.
#undef SCRIPT_REG_CLASSNAME
#define SCRIPT_REG_CLASSNAME &CScriptBind_Boids::

	SCRIPT_REG_TEMPLFUNC(CreateFlock,"entity,nType,tParamsTable");
	SCRIPT_REG_TEMPLFUNC(SetFlockParams,"entity,tParamsTable");
	SCRIPT_REG_TEMPLFUNC(EnableFlock,"entity,bEnable" );
	SCRIPT_REG_TEMPLFUNC(SetFlockPercentEnabled,"entity,fPercentage" );
	SCRIPT_REG_TEMPLFUNC(OnBoidHit,"boidEntity,hit" );
	SCRIPT_REG_TEMPLFUNC(SetAttractionPoint, "entity,point");
	SCRIPT_REG_TEMPLFUNC(CanPickup,"flockEntity,boidEntity");
	SCRIPT_REG_TEMPLFUNC(GetUsableMessage,"flockEntity");
	SCRIPT_REG_TEMPLFUNC(OnPickup,"flockEntity,boidEntity,isPickup,throwSpeed");

	//SCRIPT_REG_TEMPLFUNC(Land, "flockEntity");
	//SCRIPT_REG_TEMPLFUNC(TakeOff, "flockEntity");

	m_pMethodsTable->SetValue( "FLOCK_BIRDS",EFLOCK_BIRDS );
	m_pMethodsTable->SetValue( "FLOCK_FISH",EFLOCK_FISH );
	m_pMethodsTable->SetValue( "FLOCK_BUGS",EFLOCK_BUGS );
	m_pMethodsTable->SetValue( "FLOCK_CHICKENS",EFLOCK_CHICKENS );
	m_pMethodsTable->SetValue( "FLOCK_FROGS",EFLOCK_FROGS );
	m_pMethodsTable->SetValue( "FLOCK_TURTLES",EFLOCK_TURTLES );

	DefineConstIntCVarName("boids_enable", boids_enabled, 1, VF_CHEAT|VF_CHEAT_NOCHECK, 
		"Enable disables the boids. If set to 0 before the starting of the game will prevent"
		" the creation of the flocks.");
}
コード例 #3
0
//------------------------------------------------------------------------
CScriptbind_GameAudio::CScriptbind_GameAudio()
{
	Init( gEnv->pScriptSystem, gEnv->pSystem );
	SetGlobalName("GameAudio");

	RegisterMethods();
}
コード例 #4
0
//------------------------------------------------------------------------
CScriptBind_Game::CScriptBind_Game(ISystem *pSystem, IGameFramework *pGameFramework)
: m_pSystem(pSystem),
	m_pGameFW(pGameFramework)
{
	Init(pSystem->GetIScriptSystem(), m_pSystem);
	SetGlobalName("Game");

	RegisterMethods();
	RegisterGlobals();
}
コード例 #5
0
//------------------------------------------------------------------------
CScriptBind_Action::CScriptBind_Action(CCryAction *pCryAction)
: m_pCryAction(pCryAction)
{
	Init( gEnv->pScriptSystem, GetISystem() );
	SetGlobalName("CryAction");

	RegisterGlobals();
	RegisterMethods();

	m_pPreviousView=NULL;
}
//------------------------------------------------------------------------
CScriptBind_Network::CScriptBind_Network( ISystem *pSystem, CCryAction * pFW )
{
	m_pSystem = pSystem;
	m_pFW = pFW;

	Init( gEnv->pScriptSystem, m_pSystem );
	SetGlobalName("Net");

	RegisterGlobals();
	RegisterMethods();
}
コード例 #7
0
ファイル: ScriptBind_HUD.cpp プロジェクト: RenEvo/dead6
//------------------------------------------------------------------------
CScriptBind_HUD::CScriptBind_HUD(ISystem *pSystem, IGameFramework *pGameFramework)
: m_pSystem(pSystem),
	m_pSS(pSystem->GetIScriptSystem()),
	m_pGameFW(pGameFramework)
{
	Init(m_pSS, m_pSystem);
	SetGlobalName("HUD");

	RegisterMethods();
	RegisterGlobals();
}
コード例 #8
0
//------------------------------------------------------------------------
CScriptBind_UIAction::CScriptBind_UIAction()
{
	CScriptableBase::Init( gEnv->pScriptSystem, gEnv->pSystem );
	SetGlobalName("UIAction");

	RegisterMethods();
	
	if (gEnv->pFlashUI)
	{
		gEnv->pFlashUI->RegisterModule(this, "CScriptBind_UIAction");
	}
}
コード例 #9
0
//------------------------------------------------------------------------
CScriptBind_ActorSystem::CScriptBind_ActorSystem( ISystem *pSystem, IGameFramework *pGameFW )
{
	m_pSystem = pSystem;
	//m_pActorSystem = pActorSystem;
	m_pGameFW = pGameFW;

	Init( pSystem->GetIScriptSystem(), m_pSystem );
	SetGlobalName("Actor");

	RegisterGlobals();
	RegisterMethods();
}
コード例 #10
0
//------------------------------------------------------------------------
CScriptBind_GameAudio::CScriptBind_GameAudio(CGameAudio *pGameAudio)
{
    m_pSystem			= gEnv->pSystem;
    m_pSS					= gEnv->pScriptSystem;
    m_pGameAudio = pGameAudio;

    Init(m_pSS);
    SetGlobalName("GameAudio");

    RegisterMethods();
    RegisterGlobals();
}
コード例 #11
0
//------------------------------------------------------------------------
CScriptBind_MaterialEffects::CScriptBind_MaterialEffects(ISystem *pSystem, CMaterialEffects* pMFX)
{
	m_pSystem = pSystem;
	m_pMFX = pMFX;
	assert (m_pMFX != 0);

	Init( gEnv->pScriptSystem, m_pSystem );
	SetGlobalName("MaterialEffects");
  
	RegisterGlobals();
	RegisterMethods();
}
コード例 #12
0
//------------------------------------------------------------------------
CScriptBind_ItemSystem::CScriptBind_ItemSystem(ISystem *pSystem, CItemSystem *pItemSystem, IGameFramework *pGameFramework)
: m_pItemSystem(pItemSystem),
	m_pGameFramework(pGameFramework)  
{
	Init(pSystem->GetIScriptSystem(), pSystem);
	SetGlobalName("ItemSystem");
	
	RegisterGlobals();
	RegisterMethods();

  m_pEquipmentManager = static_cast<CEquipmentManager*>(pItemSystem->GetIEquipmentManager());
}
コード例 #13
0
CScriptBind_PortalManager::CScriptBind_PortalManager(ISystem *pSystem)
{
	assert(pSystem);
	m_pSystem = pSystem;
	m_pSS = pSystem->GetIScriptSystem();
	m_pPortalManager = NULL;

	// Initial init
	Init(m_pSS, m_pSystem);
	SetGlobalName("Portal");
	RegisterMethods();
	RegisterGlobals();
}
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CScriptBind_Physics::CScriptBind_Physics(IScriptSystem *pScriptSystem, ISystem *pSystem)
{
	m_pSystem = NULL;
	m_p3DEngine = NULL;

	CScriptableBase::Init( pScriptSystem,pSystem );
	SetGlobalName( "Physics" );
	m_pSystem = pSystem;
	m_p3DEngine = gEnv->p3DEngine;
	m_pPhysicalWorld = m_pSystem->GetIPhysicalWorld();

#undef SCRIPT_REG_CLASSNAME 
#define SCRIPT_REG_CLASSNAME &CScriptBind_Physics::

	SCRIPT_REG_TEMPLFUNC(SimulateExplosion,"tableExplosion" );
	SCRIPT_REG_TEMPLFUNC(RegisterExplosionShape,"sGeometryFile,fSize,nIdMaterial,fProbability,sSplintersFile,fSplintersOffset,sSplintersCloudEffect" );
	SCRIPT_REG_TEMPLFUNC(RegisterExplosionCrack,"sGeometryFile,nIdMaterial" );
	SCRIPT_REG_FUNC(RayWorldIntersection);
	SCRIPT_REG_TEMPLFUNC(RayTraceCheck,"vSrc,vTrg,hSkipEntityId1,hSkipEntityId2");
	SCRIPT_REG_TEMPLFUNC(SamplePhysEnvironment,"vPoint,fRadius");
}