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 11-06-2008, 10:37 PM
Understood Understood is offline
Registered User
Join Date: Jun 2006
Location: Orlando, FL
Posts: 120
Understood is on a distinguished road
projectile detection problem

Hi
I made a tank, and would like it to have its own HP. The problem is that I can't seem to figure out how to detect when a projectile hits the tank, and not the player. I've tried a few things but have had no luck so far.

Basically, I think I need onActionProjectile() to be called whenever a projectile hits a shape surrounding the player...not the player himself
Reply With Quote
  #2  
Old 11-06-2008, 10:50 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Have an onActionProjectile() function in the tank NPC's script, simple as that. I think it's clientsided only, so you'll have to trigger data from client to server whenever it's hit.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #3  
Old 11-06-2008, 11:45 PM
Understood Understood is offline
Registered User
Join Date: Jun 2006
Location: Orlando, FL
Posts: 120
Understood is on a distinguished road
Well, the tank is set up like this:

Weapon NPC which handles rotation/movement and sets four player.attr[]'s: the tank's turret gani, the tank's body gani, the rotation angle of the turret, and the rotation angle of the body.

Then, in the gani scripts of the body and turret, the gani rotation is set according to the player.attr[]

Sooo....a setshape via the weaponscript and an onActionProjectile() doesn't work...unless I'm doing something wrong.
Reply With Quote
  #4  
Old 11-06-2008, 11:51 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
I don't think there's any way using shoot() you're going to be able to achieve that.
__________________
Reply With Quote
  #5  
Old 11-07-2008, 01:58 AM
Understood Understood is offline
Registered User
Join Date: Jun 2006
Location: Orlando, FL
Posts: 120
Understood is on a distinguished road
Quote:
Originally Posted by cbk1994 View Post
I don't think there's any way using shoot() you're going to be able to achieve that.
There has to be a way =[
Reply With Quote
  #6  
Old 11-07-2008, 02:12 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
What should happen is there should be a method of changing the player's shape.
Reply With Quote
  #7  
Old 11-07-2008, 03:23 AM
DarkReaper0 DarkReaper0 is offline
No.
DarkReaper0's Avatar
Join Date: May 2005
Location: Texas,USA
Posts: 344
DarkReaper0 will become famous soon enough
Send a message via MSN to DarkReaper0
That would also fix an interesting problem whenever you use player.zoom.
Reply With Quote
  #8  
Old 11-08-2008, 04:46 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
The only way I can think of doing it is putting an NPC when the weapon is fired, and do all projectile detection in that. However, I do agree that being able to set the player's shape would be much better.

Last edited by Codein; 11-08-2008 at 07:42 PM..
Reply With Quote
  #9  
Old 11-08-2008, 10:23 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
I don't think there's a good way to do it with the current projectile system.

I guess you could try looping through the 'projectiles' array and check to see if any projectile is within a certain boundary.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
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 03:46 AM.


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