Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-14-2013, 06:30 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Bullet collision

I am making a new shooting system.
How can I trigger an action of my baddie when it collides with the temp.npc("Bullet")
--(trigger "onHurt")

With that, how do I check if a player is within the x,y of the bullet for player collision?

(onPlayerTouchsMe) will only work when player runs into bullet. Not vise-versa.
Reply With Quote
  #2  
Old 08-14-2013, 06:47 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
If you really want your projectiles to be NPCs, you probably want to check for players and NPCs in a timeout. You can probably reduce the work a little by checking if you're on a wall first which is probably cheaper than checking every player/NPC to see if there is an overlap. Even if you use move this won't be a very efficient or responsive method of creating projectiles.

A much better approach is to either use the default shooting mechanism (if you can deal with the limits it has) or re-create projectiles clientside using the showimg features (Sales and I did this for Era, although it was never used).
__________________
Reply With Quote
Reply


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 +2. The time now is 09:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.