Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Why? (https://forums.graalonline.com/forums/showthread.php?t=18758)

psi 12-12-2001 06:04 AM

Why?
 
why will this not work to give me a flame going up if player faces that way or down if player faces that way?

if (weaponfired&&playermp>9&&playerdir=up){playermp-=10;
xAxisPos = 4;
while (xAxisPos < 20) {
blast1();
if (xAxisPos != 19) {
sleep 0.05;
}
xAxisPos++
}
}

function blast1() {
putexplosion2 2,1,playerx+0.7,playery-xAxisPos;
}

if (weaponfired&&playermp>9&&playerdir=right){playerm p-=10;
xAxisPos = 4;
while (xAxisPos < 20) {
blast2();
if (xAxisPos != 19) {
sleep 0.05;
}
xAxisPos++
}
}

function blast2() {
putexplosion2 2,1,playerx-xAxisPos,playery;
}

TDO2000 12-13-2001 02:28 AM

NPC Code:

if(weaponfired && playermp >=10){
if(playerdir==0 || playerdir==2){
playermp-=10;
this.dir=playerdir;
this.distance=0;
this.startxy={playerx+vecx(this.dir)*2,playery+vec y(this.dir)*2};
timeout=.05;
}
}

if(timeout){
if(this.distance < 20){
this.distance++;
putexplosion2 2,1,this.startxy[0],this.startxy[1];
this.startxy[0]+=vecx(this.dir);
this.startxy[1]+=vecy(this.dir);
timeout=.05;
}
}




not tested, but it should work...

AlexH 12-13-2001 02:30 AM

playerdir=up
WRONG
numerical values 0,1,2 and 3


All times are GMT +2. The time now is 04:51 PM.

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