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 07-21-2001, 11:53 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
setimgpart

alright, im working on this project and I need to know how to do this. I have been experimenting and its not working. I need to know how to take a gif such as the attachment included (not the one im actually using) and do it so if a player is facing left and weapon is fired it shows one part of the gif and if there right it shows another and so on. If you got any idea please help.

The gif included is a bomy and i just used this as an example.
Attached Thumbnails
Click image for larger version

Name:	bomy_nex3.png
Views:	234
Size:	9.8 KB
ID:	2427  
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #2  
Old 07-21-2001, 12:10 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
NPC Code:

if (playerdir==0) {
setgifpart 0,0,32,32;
}
if (playerdir==1) {
setgifpart 32,0,32,32;
}
if (playerdir==2) {
setgifpart 64,0,32,32;
}
if (playerdir==3) {
setgifpart 96,0,32,32;
}



that would be kidna how you would do it, i think.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #3  
Old 07-21-2001, 12:29 PM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
I think it is accept, how do i add the picture in so it knows what picture to take the part from?
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #4  
Old 07-21-2001, 12:39 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
ill check up on that, but im pretty sure i know how to do it
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #5  
Old 07-21-2001, 12:44 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
NPC Code:

setgif bomy_chamo3.png;
if (playerdir==0) {
setgifpart 0,0,32,32;
}
if (playerdir==1) {
setgifpart 32,0,32,32;
}
if (playerdir==2) {
setgifpart 64,0,32,32;
}
if (playerdir==3) {
setgifpart 96,0,32,32;
}



This would be the right code.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #6  
Old 07-21-2001, 01:34 PM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
wow thanks. I been experimenting with this alot and it works but its hard to figure out what coords to use for what part. Is there an easy way to do this rather than entering random coords?
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #7  
Old 07-21-2001, 02:33 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
If you have a nice image editor like Adobe or PSP, those programs give you the coords at which ur mouse is at. So its very easy to find coords.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #8  
Old 07-22-2001, 12:03 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
Oh thanks man. I got psp7 that i got from a website (warez) and I will go try and use that =D
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #9  
Old 07-22-2001, 12:17 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
Quote:
Originally posted by Cybnext_Design
NPC Code:

setgif bomy_chamo3.png;
if (playerdir==0) {
setgifpart 0,0,32,32;
}
if (playerdir==1) {
setgifpart 32,0,32,32;
}
if (playerdir==2) {
setgifpart 64,0,32,32;
}
if (playerdir==3) {
setgifpart 96,0,32,32;
}



This would be the right code.
where do you get the #'s in the setgifpart?
Reply With Quote
  #10  
Old 07-22-2001, 12:29 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
umm the first ones are x and y and the second are the width and height of it. so setimgpart example.png x,y,width,height
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #11  
Old 07-22-2001, 12:29 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
I just dont know because I got the coordinates on psp and i have them but i dont know if they go in x,y or width,height

__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #12  
Old 07-22-2001, 02:01 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
Its kind of hard to explain how to use psp to get the coords and stuff. But just play around with the selection tool and im sure u will figure it out.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #13  
Old 07-22-2001, 02:10 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
alright heres what i got. I see the coords in the bottom left of PSP. I get the coords of the top left of the part of the picture i want. I then drag the selection tool down over the picture so i have it completely in a box and more coords appear next to the first. I put the first coords in the x and y. and the second set in the width and height. For some reason it gets more than the picture though so im not sure =\
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #14  
Old 07-22-2001, 02:25 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
Here is how you would show the 4 directions of a bomy:

NPC Code:

setgif bomy_chamo3.gif;
if (playerdir==0) {
setgifpart 0,0,48,48;
}
if (playerdir==1) {
setgifpart 48,0,48,48;
}
if (playerdir==2) {
setgifpart 96,0,48,48;
}
if (playerdir==3) {
setgifpart 144,0,48,48;
}

__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #15  
Old 07-22-2001, 11:16 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
thats cool but i need to know how to find the numbers for the x,y,width,height part of it.
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #16  
Old 07-22-2001, 11:21 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
Look at the attachment, you might get the point of where to get the coords and width and height from it.
Attached Images
 
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #17  
Old 07-22-2001, 11:25 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
oh ok thanks. How do i get that? just drag that little selection square thing over the area that I want to appear??
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #18  
Old 07-22-2001, 01:36 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
yes, but dont release the selection.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #19  
Old 07-22-2001, 05:51 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Cybnext_Design
Here is how you would show the 4 directions of a bomy:

NPC Code:

setgif bomy_chamo3.gif;
if (playerdir==0) {
setgifpart 0,0,48,48;
}
if (playerdir==1) {
setgifpart 48,0,48,48;
}
if (playerdir==2) {
setgifpart 96,0,48,48;
}
if (playerdir==3) {
setgifpart 144,0,48,48;
}

Hi, using the following script would be better:
NPC Code:
setimg bomy_chamo3.png; //Yes it's PNG
setimgpart bomy_chamo3.png,dir*48,this.sprite*48,48,48;


And then you'd need to script the proper sprites for it to use.
__________________

Reply With Quote
  #20  
Old 07-23-2001, 04:29 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
Lady Midnight is so smart
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
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 08:23 PM.


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