|
|
#1 |
![]() Join Date: May 2007
Reputation: 0
Posts: 43
|
Brush entity outputs.
So I finally have my objective gameplay working how I want. My next step is having my objective entities fire things at certain points, if desired by the map makers. So I have outputs that fire from the entities Touch() function when a player starts\stops activating it, starts\stops deactivating it and completing the activation\deactivation of it( Basically, these would be like when a player in CS would be planting\defusing a bomb). These all fire appropriately of course. Now I need to have an output that fires when the objective is taken\won...aka Bomb explodes. The issue I am having is that there can be multiple instances of this entity...maybe that need to be taken in a certain order. So I have this being fired from my objective entity's Think() function. It is getting called...my problem is that when the first one goes, it fires the output on all instances of the entity...not just the active one. It's not an issue if I could have the output fire from my gamerules. How do I get a specific instance of an entity from within the entity?
|
|
|
|
|
|
#2 |
![]() Join Date: May 2007
Reputation: 0
Posts: 43
|
Nevermind, modified this in my gamerules when objective completes to go through instances of my entity and check for the right one. Duh.
Code:
CBaseEntity* pResult = gEntList.FindEntityByClassname(NULL,"npc_*");
while (pResult)
{
CAI_BaseNPC* pNPC = dynamic_cast<CAI_BaseNPC*>(pResult);
if (pNPC)
pNPC->SetState(NPC_STATE_IDLE);
pResult = gEntList.FindEntityByClassname(pResult,"npc_*");
}
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|