Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Shoot(); problems (https://forums.graalonline.com/forums/showthread.php?t=75157)

Angel_Light 07-07-2007 04:00 AM

Shoot(); problems
 
Alright messing around with shoot for the first time in awhile and I get it to display but the gani disappears after one sec it seems. OnActionProjectile is never called.

PHP Code:

//#CLIENTSIDE
function onWeaponFired() 
{
  
freezeplayer0.45);
  
setShootParamsthis.xthis.y);

  
temp.angle getanglevecxplayer.dir), vecyplayer.dir));

  
shoot(player.xplayer.yplayer.ztemp.angledegtoRad22.5), random0.5,0.8), "omega_ol_tomahawk"NULL);

  
setAni"kick"NULL);
  
sleep0.45);
  
setAni"idle"NULL);
}

function 
onActionProjectile() 
  
putLeaps4params0], params1]); 


DustyPorViva 07-07-2007 04:29 AM

Hmm, check if the ani has multiple frames? I believe shoot changes the ani's frame depending on how far along the projectile is finished its trajectory.

But after messing with what you gave, I think it has a lot to do with the power and zangle you provided. Maybe try changing those?

Angel_Light 07-07-2007 04:31 AM

the ani does have multiple frames and is looped, I tried messing with the zangle and power but I had had no luck.

DustyPorViva 07-07-2007 04:32 AM

Well try setting it to a gani that has only a single frame to see if that's the issue. I'm not sure if projectiles will loop the gani.

Angel_Light 07-07-2007 04:48 AM

nope

DustyPorViva 07-07-2007 04:50 AM

Then it's definitely the zangle and power. Raise those both up.

Angel_Light 07-07-2007 04:53 AM

k, but when I do the particle usually goes flying way off the level, any good estimated ranges I should put those?

DustyPorViva 07-07-2007 05:01 AM

It all depends on what kind of trajectory you're trying to accomplish.
For the zangle, remember it's the initial angle it's 'thrown' at. pi/2 is being thrown straight up, while 0 is basically nothing(only works with 'classic-type' projectiles). As for the power... try starting with 1 and working your way around that.

Angel_Light 07-07-2007 05:04 AM

ok it looks like it falls and hits the ground but onActionProjectile is not called.

DustyPorViva 07-07-2007 05:37 AM

Should use {}'s for the function, also, why are you passing the NPC's x/y in the params?

Angel_Light 07-07-2007 05:48 AM

I think it detects where the shoot projectile landed, also if there is just one command after the function you dont need the {}'s

Admins 07-07-2007 01:10 PM

On clientside you only get onactionprojectile2 i think, not sure

killerogue 07-07-2007 04:09 PM

Use continuous in the gani.

Angel_Light 07-07-2007 09:49 PM

Quote:

Originally Posted by Stefan (Post 1326467)
On clientside you only get onactionprojectile2 i think, not sure

It recieves the onactionprojectile only when I fire it straight up then lands.

EDIT: Setting it to continuous made it work and add ing onactionprojectile2 made it work aswell thanks guys. :D


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

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