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-13-2010, 07:18 PM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
(Questions) if not allplayers..

Then what else can I use/do to hurt other players when my projectile hits someone? Currently it only hits/hurts me. I've tried a couple of things that I thought might work, but it's not happenin. Also can someone explain

getangle();?

explain as best as you can please, and thanks to anyone that helps.
Reply With Quote
  #2  
Old 08-13-2010, 07:27 PM
Soala Soala is offline
Ideas on Fire
Soala's Avatar
Join Date: Jun 2007
Location: In my head
Posts: 3,208
Soala is a jewel in the roughSoala is a jewel in the rough
Why would you use allplayers to hit someone? Do you really want to hit ALL the players when you just hit one person?
Reply With Quote
  #3  
Old 08-13-2010, 07:29 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Probably making a nuke weapon or so.
Reply With Quote
  #4  
Old 08-13-2010, 07:40 PM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Quote:
Originally Posted by Soala View Post
Why would you use allplayers to hit someone? Do you really want to hit ALL the players when you just hit one person?
Honestly, I wasn't exactly sure what to use. It was as close as i could get to hitting anything besides just me. Still it failed anyway. Just hurts me still.
Reply With Quote
  #5  
Old 08-13-2010, 07:46 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
I think setting shoot params would do better for a projectile. I don't know how to do it but I'm sure someone here can help ya. Now if you want a projectile not to set a hurt gani then your out of luck.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #6  
Old 08-13-2010, 07:50 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
testplayer(x, y)
Or you could use the built-in shoot() or my custom projectile system.

getangle(vecx, vecy) gets the angle from the vecx and vecy in radian form. You can use radtodeg(angle) to get it to degree form.
By the way, 90 (deg) is pi*0.5 (rad), 180 is pi, 270 is pi*1.5, 360 is pi*2 which is also 0.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #7  
Old 08-13-2010, 08:07 PM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Quote:
Originally Posted by Switch View Post
testplayer(x, y)
Or you could use the built-in shoot() or my custom projectile system.

getangle(vecx, vecy) gets the angle from the vecx and vecy in radian form. You can use radtodeg(angle) to get it to degree form.
By the way, 90 (deg) is pi*0.5 (rad), 180 is pi, 270 is pi*1.5, 360 is pi*2 which is also 0.
Thanks, ill give it a shot and see what happens,

also I'm already using shoot() but i didnt know i could make it to hurt a player once it reaches a object. I am trying setshootparams() though
Reply With Quote
  #8  
Old 08-13-2010, 08:52 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by Switch View Post
testplayer(x, y)
Or you could use the built-in shoot() or my custom projectile system.

getangle(vecx, vecy) gets the angle from the vecx and vecy in radian form. You can use radtodeg(angle) to get it to degree form.
By the way, 90 (deg) is pi*0.5 (rad), 180 is pi, 270 is pi*1.5, 360 is pi*2 which is also 0.
I never could get that to work.. No matter what I tried, the projectiles flew to the southeast about 2 tiles and 'dropped' like a stone.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #9  
Old 08-15-2010, 02:38 AM
dereklarue dereklarue is offline
PurplePeopleEater
Join Date: Aug 2007
Location: Mi
Posts: 32
dereklarue is on a distinguished road
Send a message via AIM to dereklarue Send a message via Yahoo to dereklarue
I talked to you online about your problem. You already have shoot() down it looks like, so here is what you need to do.
To make shoot() hurt other players, the player your shooting at has to have onActionProjectile() in a weapon.
Basic idea using this would be:
PHP Code:
function onActionProjectile()
{
  if (
player.ani != "hurt"// the player.ani is not hurt
  
{
  
player.hearts -= 0.5// take .5 hearts
  
setani("hurt",null); // sets the ani to hurt
  
}

Hope this helps!
Reply With Quote
  #10  
Old 08-15-2010, 03:04 AM
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
You need to have the onActionProjectile in a weapon script that every player has.
__________________
Reply With Quote
  #11  
Old 08-15-2010, 03:14 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Yeah i didnt know that till now thanks
Reply With Quote
  #12  
Old 08-15-2010, 06:14 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
If Not Allthetime, When? If not Allplayers, Who?


by which i mean **** your thread title
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 07:48 AM.


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