Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   (Questions) if not allplayers.. (https://forums.graalonline.com/forums/showthread.php?t=134260189)

khortez 08-13-2010 07:18 PM

(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.

Soala 08-13-2010 07:27 PM

Why would you use allplayers to hit someone? Do you really want to hit ALL the players when you just hit one person?

Dnegel 08-13-2010 07:29 PM

Probably making a nuke weapon or so.

khortez 08-13-2010 07:40 PM

Quote:

Originally Posted by Soala (Post 1593564)
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.

Fulg0reSama 08-13-2010 07:46 PM

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.

Switch 08-13-2010 07:50 PM

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.

khortez 08-13-2010 08:07 PM

Quote:

Originally Posted by Switch (Post 1593576)
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

Jiroxys7 08-13-2010 08:52 PM

Quote:

Originally Posted by Switch (Post 1593576)
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.

dereklarue 08-15-2010 02:38 AM

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!

cbk1994 08-15-2010 03:04 AM

You need to have the onActionProjectile in a weapon script that every player has.

khortez 08-15-2010 03:14 AM

Yeah i didnt know that till now thanks

Loriel 08-15-2010 06:14 PM

If Not Allthetime, When? If not Allplayers, Who?


by which i mean **** your thread title


All times are GMT +2. The time now is 06:34 PM.

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