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 06-28-2001, 11:39 AM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
Paintball Problems

NPC Code:

// NPC made by Cybnext

if (this.init!=1) {

this.maxcount=30;

this.life=5;

this.arrowspeed=2;

this.arrowdamage=2;

setarray this.arrowx,this.maxcount+1;
setarray this.arrowy,this.maxcount+1;
setarray this.arrowdir,this.maxcount+1;
setarray this.arrowtime,this.maxcount+1;
setarray this.arrowact,this.maxcount+1;
this.init=1;
}

if (playertouchsme) {

toweapons PaintBall Gun;

timeout=.05;
hide;
}

if(weaponfired&&playerdarts>0){
freezeplayer .4;
playersprite=33;
playerdarts--;

setani shoot,pbgun.gif;

sleep .3;
play arrow.wav;
if(playerdir==3){
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery+1.5;
}
if(playerdir==0){
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery-1;
}
if(playerdir==1){
this.arrowx[this.out]=playerx-1;
this.arrowy[this.out]=playery+1.5;
}
if(playerdir==2){
this.arrowx[this.out]=playerx+1.25;
this.arrowy[this.out]=playery+2;
}
this.arrowdir[this.out]=playerdir;
this.arrowact[this.out]=0;
this.out++;
timeout=.05;
}
if(timeout){
for(e=0;e<this.out;e++){
if(this.arrowact[e]==0){
if(this.arrowdir[e]==3){
this.arrowx[e]+=this.arrowspeed;


showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==0){
this.arrowy[e]-=this.arrowspeed;


showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==1){
this.arrowx[e]-=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==2){
this.arrowy[e]+=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];

}

this.arrowtime[e]++;
}else{
this.arrowtime[e]=this.life*20;
}
for (c=0; c<compuscount; c++) {
if (abs(this.arrowx[e]-compus[c].x)<=2 &&
abs(this.arrowy[e]-(compus[c].y-0.5))<=2 &&
compus[c].mode!=3&&
compus[c].mode!=5){


hitcompu c,1*this.arrowdamage,this.arrowx[e]+0.5,this.arrowy[e]+0.5;
this.arrowact[e]=1;
}
}
for (d=1; d<playerscount; d++) {
if (abs((this.arrowx[e]+0.7)-(players[d].x+2))<=1 &&
abs((this.arrowy[e]+0.5)-(players[d].y+2))<=1.5){
hitplayer d,this.arrowdamage,this.arrowx[e],this.arrowy[e];
this.arrowact[e]=1;
}
}
if (this.arrowtime[e] >= (this.life*20)) {
hideimg e;
for (b=e; b<=this.out && b<20; b++) {
this.arrowx[b] = this.arrowx[b+1];
this.arrowy[b] = this.arrowy[b+1];
this.arrowdir[b] = this.arrowdir[b+1];
this.arrowact[b] = this.arrowact[b+1];
this.arrowtime[b] = this.arrowtime[b+1] - 1;
}
this.arrowx[this.out] = -1;
this.arrowy[this.out] = -1;
this.arrowdir[this.out] = -1;
this.arrowtime[this.out] = -1;
this.arrowact[this.out] = -1;
this.out--;
a--;
hideimg this.out;
}
}
timeout=.05;
}



How can i get this paintball not to fly thro objects like trees and walls, etc.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #2  
Old 06-28-2001, 11:58 AM
Lion'el-Jonson Lion'el-Jonson is offline
Please Wait....
Lion'el-Jonson's Avatar
Join Date: Mar 2001
Location: I like to eat food samples at price club.
Posts: 1,663
Lion'el-Jonson will become famous soon enough
Send a message via AIM to Lion'el-Jonson Send a message via Yahoo to Lion'el-Jonson
Go watch and you'll get inspiration.
__________________


"My words are like weaponry on a record"
Reply With Quote
  #3  
Old 06-28-2001, 02:31 PM
Munkey Munkey is offline
Guest
Join Date: May 2001
Location: Outside Pittsburgh
Posts: 279
Munkey is on a distinguished road
Send a message via ICQ to Munkey Send a message via AIM to Munkey
Quote:
Originally posted by Lion'el-Jonson
Go watch and you'll get inspiration.
my favorite car from there is the charger *the black car...the old one*
Reply With Quote
  #4  
Old 06-29-2001, 12:41 PM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
Spamming?

Why do u people insist on spamming every thread?
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
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 04:03 PM.


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