Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   "shoot" questions (https://forums.graalonline.com/forums/showthread.php?t=65286)

wild8900 04-10-2006 03:58 AM

"shoot" questions
 
What flags would I use to hurt the player? How do I track the x and y position of the bullet?

Yen 04-10-2006 04:06 AM

When a projectile hits, it calls actionprojectile on the player/NPC.

You can set it's parameters with 'setshootparams' before the projectile is shot.

wild8900 04-10-2006 04:29 AM

How do I use setshootparams?
and do I use actionprojectile only on serverside?

EDIT:
ok, I can get actionprojectile to work with ncs but how do I use it for players?

Raeiphon 04-10-2006 01:59 PM

Simple.

Make a -System npc and have actionprojectile trigger an event in -System (e.g serverside) and have that do the rest.

E.G -
//System NPC
if (actionprojectile) {
// use your params here, so:
//I dont know the syntax for hurt :O
hurt playerx,playery,#p(0)*2;
}

Omini 04-10-2006 02:19 PM

I seem to have small problems with shoot, it fires alright but the bullets/projectiles dont hurt the player.

Quote:

Originally Posted by Shoot
setshootparams #w,#v(this.gunpow);

shoot this.dx,this.dy,playerz,this.angle+random(this.max angle*-
1,this.maxangle),0,0,millenium_bullet,;

Then after a lot more script...

Quote:

Originally Posted by actionprojectile
if(actionprojectile){
if(strequals(#p(0),#w)){
playerhearts-=strtofloat(#p(this.pow));
}
}

Unless that has to be a serverside action?

ApothiX 04-11-2006 02:36 PM

playerhearts can only be modified serverside, I believe.


All times are GMT +2. The time now is 05:01 AM.

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