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 09-12-2007, 02:43 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Question function onTouchThePlayer(){

When i was making a dart that shoots across the level, when ever you where running into the dart it would hurt you
(using hurt(); )

But when you stood still and the dart hit you it would keep going with nothing triggering in the script!

So is there a way to trigger something when the NPC touches you, like being shot by a bullet??
__________________
**FLIP OUT**
Reply With Quote
  #2  
Old 09-12-2007, 02:48 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
No built-in way. Ways of projectiles hurting via playertouchesme is very, very outdated(Stefan used to have the Ice arrows do that in old Graal :P).
Either use projectiles(shoot) and use onActionprojectile(or the other varieties, and I recommend this method) or use a loop of the players and check if the player is in 'touching' the NPC by calculating its distance... or triggeraction.
Reply With Quote
  #3  
Old 09-12-2007, 02:52 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by DustyPorViva View Post
No built-in way. Ways of projectiles hurting via playertouchesme is very, very outdated(Stefan used to have the Ice arrows do that in old Graal :P).
Either use projectiles(shoot) and use onActionprojectile(or the other varieties, and I recommend this method) or use a loop of the players and check if the player is in 'touching' the NPC by calculating its distance... or triggeraction.
umkay, how would you use onActionprojectile in a script??

function onWeaponfired(){
shoot(projectile);
}
function onActionProjectile(){
i have no idea;
}
__________________
**FLIP OUT**
Reply With Quote
  #4  
Old 09-12-2007, 03:22 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally Posted by theHAWKER View Post
umkay, how would you use onActionprojectile in a script??
First, you have to use setshootparams() before shoot() to send the damage and some way to identify the projectile.

i.e.

setshootparams("hurtfulprojectile", 3);

Then have the following code in a weapon every player carries...

PHP Code:
function onActionProjectile(){
  if (
params[0] = "hurtfulprojectile") {
    
hurt(params[1]);
  }

Plus you'll probably want other checks to make sure the player is in a PK zone and stuff.
__________________
Reply With Quote
  #5  
Old 09-12-2007, 04:39 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
wtf ever happened to playertouchsme anyways. That was never made into a function like onPlayerTouchsMe and it makes me sad D:
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 09-12-2007, 05:11 AM
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
Quote:
Originally Posted by coreys View Post
wtf ever happened to playertouchsme anyways. That was never made into a function like onPlayerTouchsMe and it makes me sad D:
It's still there... I'm pretty sure onPlayerTouchsMe still works...
__________________
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
  #7  
Old 09-13-2007, 12:11 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I wish projectiles could have scripts and have classes be joined to them. (WHY ARE THEY READ-ONLY SERVERSIDE?!)

I want to be able to make projectiles that can pass through players while still hitting them
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 09-13-2007, 12:14 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Ditto. For something with so much potential like projectiles, I wish there were more options for them.
Allowing them to go through walls while being 'classic' is one, or having them not go through walls while in the air and so on. I agree with joining classes to them... though I dunno if it's possible.
Reply With Quote
  #9  
Old 09-13-2007, 01:15 AM
RyDaze RyDaze is offline
Graal682686
RyDaze's Avatar
Join Date: Sep 2007
Location: Utopia
Posts: 43
RyDaze is an unknown quantity at this point
Send a message via AIM to RyDaze Send a message via MSN to RyDaze
Ya that would be awesome!
__________________

Support Center | Forum Rules | Graal Staff Contacts

A little knowledge is dangerous. So is a lot.



Reply With Quote
  #10  
Old 09-13-2007, 01:52 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I've never ever used shoot() :P: I've always just made my own projectiles using putnpc2 and join() :P

Mostly since all my projectiles can have limited homing abilities and other effects.
Reply With Quote
  #11  
Old 09-13-2007, 05:32 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Twinny View Post
I've never ever used shoot() :P: I've always just made my own projectiles using putnpc2 and join() :P

Mostly since all my projectiles can have limited homing abilities and other effects.
Using projectiles to do that would save from TONS of lag though.
__________________
Do it with a DON!
Reply With Quote
  #12  
Old 09-13-2007, 06:41 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by zokemon View Post
Using projectiles to do that would save from TONS of lag though.
Would it? I thought the major part of shoot() is that it's an inbuilt function and thus more efficient that what we can script ourselves. If you were to make it join a class though, it would have to be interpreted anyways.
Reply With Quote
  #13  
Old 09-13-2007, 11:32 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Twinny View Post
Would it? I thought the major part of shoot() is that it's an inbuilt function and thus more efficient that what we can script ourselves. If you were to make it join a class though, it would have to be interpreted anyways.
Not really. The class you join it to still wouldn't have to use a timeout nor would it need to check for "hits".
__________________
Do it with a DON!
Reply With Quote
  #14  
Old 09-13-2007, 09:28 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally Posted by zokemon View Post
I want to be able to make projectiles that can pass through players while still hitting them
So have the player "re-shoot" the projectile when hit by it?
__________________
Reply With Quote
  #15  
Old 09-15-2007, 04:45 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
I Believe I Left The Projectile Hurt System Weapon In -System/Health or something like that on Graal Legacy...
__________________
Trying to be nice now...
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 11:54 AM.


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