Fortress Forever

Go Back   Fortress Forever > Editing > Mapping

Reply
 
Thread Tools Display Modes
Old 10-04-2006, 11:26 AM   #41
o_steven_m64
 
Join Date: Feb 2005
Posts Rated Helpful 0 Times
Quote:
Originally Posted by Mulchman MM
Eh, what is trigger_entity?
trigger_entity = the entity that trigger's the ona_trigger
o_steven_m64 is offline   Reply With Quote


Old 10-04-2006, 01:21 PM   #42
trepid_jon
Ray Ray Johnson
Fortress Forever Staff
 
trepid_jon's Avatar
 
Join Date: Feb 2005
Location: Dallas, TX
Class/Position: D Civilian
Gametype: Rocket Jousting
Affiliations: EAFD
Posts Rated Helpful 78 Times
Send a message via ICQ to trepid_jon Send a message via AIM to trepid_jon
Quote:
Originally Posted by Nezumi
So, something like
Code:
if trigger_entity:HasItem("ona_party_rock") then
doesn't work?
Quote:
Originally Posted by Steven_m64
Quote:
Originally Posted by Mulchman MM
Eh, what is trigger_entity?
trigger_entity = the entity that trigger's the ona_trigger
Oh yeah, from this example...

Code:
function ona_trigger:OnTrigger( trigger_entity )
	if IsPlayer( trigger_entity ) then
		local player = CastToPlayer( trigger_entity )
		if player:HasItem("ona_party_rock") then
			BroadCastMessageToPlayer( player, "O&A PARTY ROCK!" )
		end
	end
end
You're right, Nezumi, your example line wouldn't work. That specific line would work if it was done like this, though...

Code:
trigger_entity = CastToPlayer( trigger_entity )
if trigger_entity:HasItem("ona_party_rock") then
But really, you'd probably want to leave trigger_entity alone and just make a new shit instead, which is what "player" is for...

Code:
local player = CastToPlayer( trigger_entity )
if player:HasItem("ona_party_rock") then
__________________
Support FF:
Trepid
steamcommunity.com/id/trepid_jon/
trepid_jon is offline   Reply With Quote


Old 10-05-2006, 10:13 AM   #43
o_nezumi
 
o_nezumi's Avatar
 
Join Date: Mar 2005
Location: The Peoples Republic of Harmfull Free Radicals
Posts Rated Helpful 0 Times
That makes sense.
o_nezumi is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Forum Jump


All times are GMT. The time now is 02:01 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.