Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-12-2001, 06:04 AM
psi psi is offline
Registered User
Join Date: Nov 2001
Location: Canada
Posts: 77
psi is on a distinguished road
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;
}
__________________
Psyche[Leader]{Natures Avengers}

Bomys Rock!
Reply With Quote
  #2  
Old 12-13-2001, 02:28 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
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...
__________________
No Webhost at the moment
Reply With Quote
  #3  
Old 12-13-2001, 02:30 AM
AlexH AlexH is offline
Have A Drink On Me
AlexH's Avatar
Join Date: Jun 2001
Location: Somewhere In Time
Posts: 7,442
AlexH is on a distinguished road
Send a message via AIM to AlexH Send a message via MSN to AlexH
playerdir=up
WRONG
numerical values 0,1,2 and 3
__________________
QUICK LOOK BUSY JESUS IS COMING!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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