Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   NPCServer bug: Projectiles? (https://forums.graalonline.com/forums/showthread.php?t=51545)

Riot 03-07-2004 12:21 PM

NPCServer bug: Projectiles?
 
I have noticed that on a few servers projectiles don't seem to work right.

I PMed Stefan about the problem on one PW when it occured, but I never heard back.

Heres the problem:
Serversided actionprojectile/actionsprojectile seem to call before a projectile actually hits something. Now randomly it WILL work but usually it doesn't.

I have found that if you add a "zangle" and "power" to the projectile it work fine, otherwise it doesn't.

Scripts used for testing:
weapon: Projectile/Test-1
NPC Code:
//#CLIENTSIDE
if (weaponfired) {
setshootparams test;
shoot playerx,playery,playerz,
getangle(vecx(playerdir),vecy(playerdir)),
0,0,
gralats,1;
}


This one seems to call before it hits, shortly after its fired.

weapon: Projectile/Test-2
NPC Code:
//#CLIENTSIDE
if (weaponfired) {
setshootparams test;
shoot playerx,playery,playerz,
getangle(vecx(playerdir),vecy(playerdir)),
0.7,1.5,
gralats,1;
}


This one calls when it lands like it's supposed to.

DB-NPC: Control-NPC
NPC Code:
if (actionprojectile || actionsprojectile) {
if (strequals(#p(2),test)) {
this.x = strtofloat(#p(0));
this.y = strtofloat(#p(1));
setplayerprop #c,Projectile: (#v(this.x),#v(this.y)) Player pos: (#v(playerx),#v(playery))
}
}


Dach 03-12-2004 07:05 AM

works fine for me
try this in a weapon
NPC Code:

//#CLIENTSIDE
if (created) {
timeout = .05;
}
if (timeout) {
if (onwall(mousex,mousey)) {
setplayerprop #c,WALL!!!;
}else{setplayerprop #c,clear;}
timeout = .05;
}


that's all I can think of right now

Riot 03-12-2004 09:59 PM

Well after further testing i found it to be only bugging in some levels, however looking at the levels nothing is wrong...

Edit: Also only the serverside actionprojectile is messing up, thats why i said "NPCServer bug?"

Riot 03-14-2004 11:07 PM

Problem solved, you can close this if needed.

newtilesets=true was inside server options when it shouldn't have been.

Although i thought the NPCServer only applied that to the levels or levelstart inside the newtilesetlevels= option. apparently it doesn't.


All times are GMT +2. The time now is 03:28 PM.

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