Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 04-05-2012, 12:34 PM   #1
spbooger
 
Join Date: May 2007
Reputation: 0
Posts: 45
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?
spbooger is offline  
Reply With Quote
Old 04-05-2012, 01:25 PM   #2
spbooger
 
Join Date: May 2007
Reputation: 0
Posts: 45
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_*");
}
spbooger is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 01:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.