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-19-2001, 01:46 PM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
Sprite Spacing

Ok alot of u may already know im makin some gun weapons. There are 2 more things i need 2 do.
1 is that i dont know how to put one long image as three seperate sprites in gani editor. They always come up as the same sprite!
2 is that for the particular level im working on i need 2 change the fireball gifs into my own gifs.
Can some1 help?
Reply With Quote
  #2  
Old 09-19-2001, 02:45 PM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
[ Delph Inc. ]
I've made a laser weapon for Galactica...it shoots out the laser images...at quite a fast speed and also makes the laser noise.

I'll stop with the: <[ Delph Inc. ]> </[ Delph Inc. ]> stuff...It gets quite annoying.
So for now on just look for the [ Delph Inc. ] at the top.
__________________
Xerphier Dintch
Featuring
Reply With Quote
  #3  
Old 09-20-2001, 11:22 PM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
um... help me out here knight of frost. I actually posted askin' to do it. U obviousley know that. Can u help me?
Reply With Quote
  #4  
Old 09-21-2001, 01:42 AM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
well can any1 help me?

Last edited by Death_Link; 09-21-2001 at 02:22 AM..
Reply With Quote
  #5  
Old 09-21-2001, 02:32 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
figure out how to use setimgpart, once you know that, then setting specific sprites in a gani should be understandable.
Reply With Quote
  #6  
Old 09-21-2001, 03:32 AM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
kay i figured out how to do the gani's with the sprites, all i need 2 know now is how to replace the fireball images with my own bullet images for the guns only and how to stop the fireball making a sound. any1 help?

Last edited by Death_Link; 09-21-2001 at 05:00 AM..
Reply With Quote
  #7  
Old 09-21-2001, 01:11 PM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
any1?
Reply With Quote
  #8  
Old 09-21-2001, 11:33 PM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
It's advised you just start from scratch and make a whole new NPC, using hitobjects and stuff...
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #9  
Old 09-22-2001, 02:01 AM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
well ur gunna have to help me out then. OK?
Reply With Quote
  #10  
Old 09-22-2001, 02:29 PM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
[ Delph Inc. ]
Yes...you need to start from scratch to change the arrow images.
Now...just because I feel in a bit of a good mood I'll post the image part for you:
NPC Code:

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,laser.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,1,2,29,5;
}
if(this.arrowdir[e]==0){
this.arrowy[e]-=this.arrowspeed;
showimg e,laser.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,13,20,5,29;
}
if(this.arrowdir[e]==1){
this.arrowx[e]-=this.arrowspeed;
showimg e,laser.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,0,12,29,5;
}
if(this.arrowdir[e]==2){
this.arrowy[e]+=this.arrowspeed;
showimg e,laser.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,3,21,5,29;
}
this.arrowtime[e]++;
}else{
this.arrowtime[e]=this.life*20;
}
}
}
}



I just closed the timeout command off...but just to let you know there's about another 80 lines of code in the script.
You'll also have to call the variables, make it so it can hit and hurt players + baddies. The player direction. Make the arrow disappear after a while.
Most of it is mainly using arrays.
__________________
Xerphier Dintch
Featuring
Reply With Quote
  #11  
Old 09-22-2001, 03:27 PM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
I aint got much on arrays but ill give it a shot and ill post if i need help.
Reply With Quote
  #12  
Old 09-22-2001, 03:36 PM
Death_Link Death_Link is offline
Registered User
Join Date: Aug 2001
Posts: 51
Death_Link is on a distinguished road
hey guys i changed the if (timeout) to if (weaponfired) and put my own images in instead of the lazer images and i fired the weapon and nothing. Here is what the code looks like now:

if(weaponfired){
for(e=0;e<this.out;e++){
if(this.arrowact[e]==0){
if(this.arrowdir[e]==3){
this.arrowx[e]+=this.arrowspeed;
showimg e,bullet.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,1,2,29,5;
}
if(this.arrowdir[e]==0){
this.arrowy[e]-=this.arrowspeed;
showimg e,bullet.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,13,20,5,29;
}
if(this.arrowdir[e]==1){
this.arrowx[e]-=this.arrowspeed;
showimg e,bullet.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,0,12,29,5;
}
if(this.arrowdir[e]==2){
this.arrowy[e]+=this.arrowspeed;
showimg e,bullet.gif,this.arrowx[e],this.arrowy[e];
changeimgpart e,3,21,5,29;
}
this.arrowtime[e]++;
}else{
this.arrowtime[e]=this.life*20;
}
}
}
}

Last edited by Death_Link; 09-22-2001 at 03:43 PM..
Reply With Quote
  #13  
Old 09-22-2001, 04:12 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
should be elementary now =)

now in the putimg parts put almost the same thing except replace putimg with hurtplayer (powerhere), then the array, same with hurtbaddy
should all be simple now, dont see why youd need 80 more lines of code...
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #14  
Old 09-22-2001, 05:58 PM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
[ Delph Inc. ]
First of all you havent set the arrows speed, the arrows x pos, and the arrows y pos.
The timeout should be there because that's the animation...if there is no timeout it would just place an image in one spot if scripted correctly.
I'll now post the variables:
NPC Code:

this.maxcount=30;
this.life=5;
this.arrowspeed=1;
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;



That's all I really want to post because I know there's people out there who just keep aimlessly wandering these boards looking for whole scripts to take.
__________________
Xerphier Dintch
Featuring
Reply With Quote
  #15  
Old 09-22-2001, 06:45 PM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
[ Delph Inc. ]
Now...you have to test the players direction and say what you want the NPC to do when the player is facing that way.
e.g.
if (playerdir=3) {
this.arrowx[this.out]=playerx+1;
}

Now 'this.out' we'll talk about later because it counts how many arrows you have fired and adds each one to a specific number to be called separately.
playerdir=3 is just when the player is facing right
0=up
1=left
2=down
3=right
and playerx+1 is where the arrow will appear once fired.
You'll also need to add the arrows y position so:
if (playerdir=3) {
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery+1.8;
}

Now all you have to do is add the position of the arrow for
playerdir:
0, 1, and 2.

After that...say which direction you want the arrow to be going:

this.arrowdir[this.out]=playerdir;
and also make it so that it adds another 1 to this.out everytime you fire the weapon.

so before all of the the direction and positioning stuff add:
if (isweapon) {
if (weaponfired&&playerdarts>0) {
freezeplayer 0.2;
player Laser.wav; //You can change this or delete it to have no sound.
playersprite=33;
playerdarts--;

Now you have most of what you need...all you need is the player/baddy hurting...and the pickup item code which is simple.
__________________
Xerphier Dintch
Featuring
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 09:24 PM.


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