Thread: Damage Blocks
View Single Post
  #3  
Old 04-29-2013, 07:42 PM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
You can do it that way using a distance formula I guess, but that's probably a bit inefficient. Why not just trigger from a specific location?
PHP Code:
// in front of the player
temp.locations = { player.+ ( vecxplayer.dir ) * ) + 1.1player.+ ( vecyplayer.dir ) * ) + 1.1 };
// trigger in front of the player to an action in NPCs/players
triggerActiontemp.locations], temp.locations], "action to hit the player/npc"parameters ); 
Something similar could be done for NPC -> NPC interaction as well I suppose.
Reply With Quote