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 09-09-2001, 03:12 AM
Petey84 Petey84 is offline
Registered User
Join Date: Sep 2001
Location: Johnstown PA, and Mobile AL
Posts: 308
Petey84 is on a distinguished road
Send a message via AIM to Petey84 Send a message via Yahoo to Petey84
Arrow ?????

Ok, I need to get my NPC to shoot out a leap.. but , i dont want to use sleep commands, as in, I want to only put 1 putleap command and have it shoot out.

I have tried this, but it wont do it right..

putleap 3,playerx,playery+=.5; that wont do it..

and i do know how to script, i just cant get this part, its for a weapon im making. I have the rest done, its just this one little part. Someone please post the answer. Thanx
__________________
-Pete aka Wilddude
-Nishoku as well ;D!

AIM
Pete: WildDude2002
Nishoku: Nishoku, SaikoAkumu
-----------------------------------------------
StarX480: bai
Reply With Quote
  #2  
Old 09-09-2001, 03:33 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~The Fool~

Hrm... well, since I'm guessing you want it to fly out from the player...

if (playertouchsme){
toweapons Leap Line;
}
if (weaponfired){
this.x=playerx;
this.y=playery;
this.dir=playerdir;
timeout=.05;
}
if (timeout && this.x in |0,64| && this.y in |0,64|){
this.x+=vecx(this.dir)/2;
this.y+=vecy(this.dir)/2;
putleaps 3,this.x,this.y;
timeout=.05;
}

It should work, but I'm only scripting this here without testing, so if it doesn't... blame AOL
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #3  
Old 09-09-2001, 03:41 AM
Petey84 Petey84 is offline
Registered User
Join Date: Sep 2001
Location: Johnstown PA, and Mobile AL
Posts: 308
Petey84 is on a distinguished road
Send a message via AIM to Petey84 Send a message via Yahoo to Petey84
Ok...

That did work.. but it all goes in one motion.. can you make it so it will put 1 of the leaps in each x and y.. but yet keeping going.. that one makes the leaps all in the same x and y.
__________________
-Pete aka Wilddude
-Nishoku as well ;D!

AIM
Pete: WildDude2002
Nishoku: Nishoku, SaikoAkumu
-----------------------------------------------
StarX480: bai
Reply With Quote
  #4  
Old 09-09-2001, 03:53 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Like this?
if (playertouchsme){
toweapons Leap Line2;
}
if (weaponfired){
this.x1=playerx;
this.y1=playery;
this.dir=playerdir;
this.out=0;
timeout=.05;
}
if (timeout && this.out<64){
this.out++;
setarray this.x,this.out;
setarray this.y,this.out;
this.x1+=vecx(this.dir)/2;
this.y1+=vecy(this.dir)/2;
this.x[this.out-1]=this.x1;
this.y[this.out-1]=this.y1;
for (i=0;i<this.out;i++){
putleaps 3,this.x[i],this.y[i];
}
timeout=.05;
}
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #5  
Old 09-09-2001, 04:17 AM
Petey84 Petey84 is offline
Registered User
Join Date: Sep 2001
Location: Johnstown PA, and Mobile AL
Posts: 308
Petey84 is on a distinguished road
Send a message via AIM to Petey84 Send a message via Yahoo to Petey84
ok..

Thats better, but still 1 more thing.. =P


make it so that once the leap has been there.. it dont repeat.. it would only be there once.. and continue on to the direction
__________________
-Pete aka Wilddude
-Nishoku as well ;D!

AIM
Pete: WildDude2002
Nishoku: Nishoku, SaikoAkumu
-----------------------------------------------
StarX480: bai
Reply With Quote
  #6  
Old 09-09-2001, 05:29 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
*sighs* You... ugh... that would be the FIRST script!!

if (playertouchsme){
toweapons Leap Line;
}
if (weaponfired){
this.x=playerx;
this.y=playery;
this.dir=playerdir;
timeout=.05;
}
if (timeout && this.x in |0,64| && this.y in |0,64|){
this.x+=vecx(this.dir)/2;
this.y+=vecy(this.dir)/2;
putleaps 3,this.x,this.y;
timeout=.05;
}


And it doesn't all stay at the same x/y... :grrr:
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #7  
Old 09-09-2001, 06:26 AM
Petey84 Petey84 is offline
Registered User
Join Date: Sep 2001
Location: Johnstown PA, and Mobile AL
Posts: 308
Petey84 is on a distinguished road
Send a message via AIM to Petey84 Send a message via Yahoo to Petey84
Uhh..

No it wouldnt be.. =) Like the last one.. but i dont want them to stay there ... like.. I want it so they shoot out like an arrow would.. but to not stay in the same position.. it has to proceed outwards.. just like when you shoot an arrow.. got meh?
__________________
-Pete aka Wilddude
-Nishoku as well ;D!

AIM
Pete: WildDude2002
Nishoku: Nishoku, SaikoAkumu
-----------------------------------------------
StarX480: bai
Reply With Quote
  #8  
Old 09-09-2001, 07:21 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
Grah that is like an arrow script =/

Ok, let's say player is facing -> that way... X marking the player, this is the way the leaps "y" would go...

Xyyyyyyyyyyyyyyyyyyyyyyyyyyy


Ok? And that's the same as an arrow.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #9  
Old 09-09-2001, 07:55 AM
Petey84 Petey84 is offline
Registered User
Join Date: Sep 2001
Location: Johnstown PA, and Mobile AL
Posts: 308
Petey84 is on a distinguished road
Send a message via AIM to Petey84 Send a message via Yahoo to Petey84
Ok..

Same thing you said.. well.. same index.. like this..

Step 1... //The fire!

X Y

Step 2...

X Y

Step 3..

X y

and so on.. like..

X y
just keeps going..
but i dont want it like this..

Xyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

just 1 at a time.. but fast.. like 1 motion.. like an arrow..
__________________
-Pete aka Wilddude
-Nishoku as well ;D!

AIM
Pete: WildDude2002
Nishoku: Nishoku, SaikoAkumu
-----------------------------------------------
StarX480: bai
Reply With Quote
  #10  
Old 09-10-2001, 04:21 AM
Vinvect Vinvect is offline
Registered User
Join Date: Aug 2001
Location: U.S.A,California,Milpitas,In A House,In Room,On A Seat,On a Computer
Posts: 157
Vinvect is on a distinguished road
Send a message via ICQ to Vinvect Send a message via Yahoo to Vinvect
if (playerenters) {
drawunderplayer;
timeout=0;
}

if (playertouchsme) {
hide;
toweapons Rock Stream;
}

if (weaponfired) {
if (playerdir==0) {
this.oldx=playerx+0.5;
this.oldy=playery-3;
this.way=1;
this.expo=0;
putleaps 2,playerx+0.5,playery-3;
}
if (playerdir==1) {
this.oldx=playerx-3;
this.oldy=playery+0.75;
this.way=2;
this.expo=0;
putleaps 2,playerx-3,playery+0.75;
}
if (playerdir==2) {
this.oldx=playerx+0.5;
this.oldy=playery+4.5;
this.way=3;
this.expo=0;
putleaps 2,playerx+0.5,playery+4.5;
}
if (playerdir==3) {
this.oldx=playerx+4;
this.oldy=playery+0.75;
this.way=4;
this.expo=0;
putleaps 2,playerx+4,playery+0.75;
}
freezeplayer 0.65;
playersprite=33;
timeout=.05;
playermp-=10
}

if (timeout) {
if (playerx<this.oldx&& !onwall(this.oldx+2,this.oldy+1)&&
this.way==4) {
this.oldx+=1;
}
if (playery<this.oldy&& !onwall(this.oldx+1,this.oldy+2)&&
this.way==3) {
this.oldy+=1;
}
if (playerx>this.oldx&& !onwall(this.oldx,this.oldy+1)&&
this.way==2) {
this.oldx-=1;
}
if (playery>this.oldy&& !onwall(this.oldx+1,this.oldy)&&
this.way==1) {
this.oldy-=1;
}
this.expo+=1;
timeout=.05;
}

if (this.oldx>64 ||
this.oldx<0 ||
this.oldy>64 ||
this.oldy<0 ||
onwall(this.oldx,this.oldy) ||
onwall(this.oldx+2,this.oldy) ||
onwall(this.oldx,this.oldy+2) ||
onwall(this.oldx+2,this.oldy+2) ||
onwall(this.oldx+2,this.oldy+1) ||
onwall(this.oldx+1,this.oldy+2) ||
onwall(this.oldx,this.oldy+1) ||
onwall(this.oldx+1,this.oldy)) {
timeout=0;
this.expo=0;
}

if (this.expo==2) {
putleaps 2,this.oldx,this.oldy;
this.expo-=2;
}
__________________
==========================
I Script Really Good
&
Looking For A NAT Job
==========================
Quote:
That's like a big lugee!
-Evolution The Movie
Quote:
Ha Ha Ha Give It Up!
-Cyrus From Bomberman
I'm not a Bomy anymore.
I'm a MUTATED BROCLI MONSTER!
(or SIGN MONSTER)
If you make me angry,
I'LL EAT YOU WHOLE!
ME, MUTATED BROCLI MONSTER MASTER
(or SIGN MONSTER)
WILL EAT YOU ALL UP!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Quest Valley Owner
Looking For Staff
Pm Me
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
O.o Still Have My Braen Damaegd o.O


Thanks To Esiah, He Made This For Me!
Thanks Esiah!
Reply With Quote
  #11  
Old 09-10-2001, 10:14 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

Vinvect... much too long, mon ami. My first one could do the same thing as your LONG LONG one, with the insert of && !onwall(this.x+vecx(this.dir),this.y+vecy(this.dir )) for the onwall

And, by the by... what do you have timeout=0; for? Drawunderplayer seems a bit pointless as well since it will get hiden anyway when the player touchs it...
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #12  
Old 09-10-2001, 12:16 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
ok..

// NPC made by Josey Hunt
if (playerenters){toweapons Leaps test;}
if(weaponfired){
if(playerdir=3){
this.x1=playerx+.5;
this.x2=playerx+.5;
this.y1=playery-5;
this.y2=playery+7;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=3;
this.dirx2=3;
this.diry1=2;
this.diry2=0;
this.firedir=3;
}
if(playerdir=2){
this.x1=playerx+7;
this.x2=playerx-6;
this.y1=playery+.5;
this.y2=playery+.5;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=1;
this.dirx2=3;
this.diry1=2;
this.diry2=2;
this.firedir=2;
}
if(playerdir=1){
this.x1=playerx+.5;
this.x2=playerx+.5;
this.y1=playery-5;
this.y2=playery+7;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=1;
this.dirx2=1;
this.diry1=2;
this.diry2=0;
this.firedir=1;
}
if(playerdir=0){
this.x1=playerx+7;
this.x2=playerx-6;
this.y1=playery+.5;
this.y2=playery+.5;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=1;
this.dirx2=3;
this.diry1=0;
this.diry2=0;
this.firedir=0;
}
timeout=.1;
playersprite=24;
this.firing=1;
}
if(timeout&&this.firing==1){
putleaps 3,this.x1,this.y1;
putleaps 3,this.x2,this.y2;
if(this.dirx1==1){this.x1--}
if(this.dirx2==1){this.x2--}
if(this.dirx1==3){this.x1++}
if(this.dirx2==3){this.x2++}
if(this.diry1==0){this.y1--}
if(this.diry2==0){this.y2--}
if(this.diry1==2){this.y1++}
if(this.diry2==2){this.y2++}
if(this.firedir==3||this.firedir==1){
if(this.diry1=0&&this.y1<=this.originaly-5){this.diry1=2}
if(this.diry1=2&&this.y1>=this.originaly+7){this.d iry1=0}
if(this.diry2=0&&this.y2<=this.originaly-5){this.diry2=2}
if(this.diry2=2&&this.y2>=this.originaly+7){this.d iry2=0}
}
if(this.firedir==0||this.firedir==2){
if(this.dirx1=1&&this.x1<=this.originalx-6){this.dirx1=3}
if(this.dirx1=3&&this.x1>=this.originalx+7){this.d irx1=1}
if(this.dirx2=1&&this.x2<=this.originalx-6){this.dirx2=3}
if(this.dirx2=3&&this.x2>=this.originalx+7){this.d irx2=1}
}
timeout=.1;
}
if(this.x1>=64||this.x1<=0){this.firing=0}
if(this.x2>=64||this.x2<=0){this.firing=0}
if(this.y1>=64||this.y1<=0){this.firing=0}
if(this.y2>=64||this.y2<=0){this.firing=0}

but you'll still have to put in the hurt compu and hurtplayer commands in this. it isnt a straight line, but it can be easily modified. =P
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #13  
Old 09-11-2001, 12:41 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

Ok, let me give you people a little pointer...


MAKE YOUR SCRIPTS SHORTER!

Honestly, the same thing can be accomplished that your scripts do in about 3/4 less lines. I'd hate to have 20 of those in my weapons, the loading lag would be a pain in the neck.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
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 06:04 AM.


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