void RPG_AiSpawnPoint::MessageFunction(int iID, INT_PTR iParamA, INT_PTR iParamB) { RPG_SpawnPoint::MessageFunction(iID, iParamA, iParamB); switch(iID) { case VIS_MSG_TRIGGER: { // if a trigger is calling this object, spawn the NPC. OnSpawn(); break; } //case VIS_MSG_EDITOR_GETLINKS: //{ // VShapeLinkConfig* linkConfig = reinterpret_cast<VShapeLinkConfig*>(iParamA); // // setup the number of links // linkConfig->AllocateLinks(1); // // create the trigger target // VShapeLinkInfo& triggerTarget(linkConfig->GetLinkInfo(0)); // triggerTarget.m_eType = VShapeLinkInfo::LINK_TARGET; // triggerTarget.m_sDisplayName = "Trigger Target"; // triggerTarget.m_sUniqueStringID = "trigger_target"; // break; //} //case VIS_MSG_EDITOR_CANLINK: //{ // VShapeLink* link = reinterpret_cast<VShapeLink*>(iParamA); // VisTypedEngineObject_cl* otherObject = link->m_pOtherObject; // if(!link->m_pOtherObject) // { // link->m_bResult = false; // } // else if(link->m_pOtherObject->IsOfType(V_RUNTIME_CLASS(VisTriggerSourceComponent_cl))) // { // // allow a trigger source to link to this // link->m_bResult = true; // } // break; //} default: { break; } } }
void Entity::Spawn(GameState* state) { mGameState = state; mLifetime = 0; OnSpawn(state); }