Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 05-08-2004, 05:30 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Dach
For what you're doing, you don't need this. For something like that, it would help but still isn't necessary. What you're suggesting has a rather limited range of uses, of which, all can already be done.
Yes, but I rather enjoy having the essence of extra malleability. I don't think that this is too much to ask. It would just assist to be more organized if setshape was able to replace its default, (x,y)=(npcx,npcy), to (x,y)=(scriptdefinedx,scriptdefinedy).
Reply With Quote
  #17  
Old 05-08-2004, 10:08 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Since I'm being ignored, I'll just move things along:
NPC Code:

if (created) {
showcharacter;
setcharani dk_tree,2;
}


NPC Code:

GANI0001
SPRITE 0 dk_treeshadow2.png 0 0 144 64 shadow
SPRITE 1 dk_tree_trunk.png 0 0 64 64 trunk
SPRITE 2 dk_sum2_tree.png 0 0 192 192 Summer Tree
SPRITE 3 dk_fall2_tree.png 0 0 192 192 Fall Tree
SPRITE 4 dk_spring_tree.png 0 0 192 192 Spring Tree
SPRITE 5 dk_fall_tree.png 0 0 192 192 No Leaves

SINGLEDIRECTION
DEFAULTPARAM1 2
DEFAULTHEAD head19.png
DEFAULTBODY body.png

ANI
1 -8 -8, PARAM1 -66 -130
ANIEND


Let me explain. If the object you are using fits well into a 48x48 (3x3) frame then use showcharacter. This works great for a lot of things and automattically adjusts display priority for drawing over and under players/character NPCs. If its going to be larger than 48x48, then in the gani, set a base image and a top image. The base should be the width of the image (obviously) and the vertical space is up to you. For my castle walls, the height is always 48 pixels high (3 tiles). For drawing the overlaying image, I use a script within the gani. A good place for examples of this, other than what I post, would be the GK ganis for buildings. I've also found that putting the image in the gani at 0,0 makes it fit better with the tiles rather than taking a 32x32 sprite and trying to center it in the 48x48 pane...unless you want it to be centered. Putting it at 0,0 is good for making sure things like npc object walls align properly

NPC Code:

GANI0001
SPRITE 0 SPRITES 0 0 24 16 shadow
SPRITE 1 dk_castle_wall_96.png 0 176 96 48 Castle Wall - 96 Base
SPRITE 2 dk_castle_wall_96.png 0 0 96 200 Castle Wall - 96 Top

SINGLEDIRECTION
DEFAULTHEAD head19.png
DEFAULTBODY body.png

SCRIPT
if (playerenters) {
showimg 1,2,playerx-0/16,playery-176/16;
changeimgvis 1,2;
}
SCRIPTEND

ANI
1 0 0
ANIEND

__________________
Reply With Quote
  #18  
Old 05-08-2004, 11:23 PM
dlang dlang is offline
Yoshi!
dlang's Avatar
Join Date: Oct 2002
Location: Houston, Texas
Posts: 406
dlang is on a distinguished road
Send a message via AIM to dlang Send a message via MSN to dlang
I don't care if you can do it in the gani I want to be able to do it from the script, its not that hard. just have like:

setshape3 index,x,y,width,height;

I would also like to be able to make images out of tiles by using the tile coordinates in the tile selection window, not by pixel.
__________________
Where do I take this pain of mine?
I run but it stays right by my side.
So tear me open, pour me out,
there's things inside that scream and shout.
And the pain still hates me, so hold me until it sleeps.

---------------
Reply With Quote
  #19  
Old 05-09-2004, 02:29 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by dlang
I don't care if you can do it in the gani I want to be able to do it from the script, its not that hard. just have like:

setshape3 index,x,y,width,height;

I would also like to be able to make images out of tiles by using the tile coordinates in the tile selection window, not by pixel.
Well, the images out of tiles by using tile coords isn't going to happen, seeing that the conversion's so simple: (tilex*16,tiley*16) = (pixelsx,pixelsy).

EDIT: dont forget... for maximum utilization capabilities we'd want it to be "setshape3 index,x,y,width,height,type;"

Last edited by jake13jake; 05-09-2004 at 02:44 AM..
Reply With Quote
  #20  
Old 05-09-2004, 02:55 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally Posted by dlang
I don't care if you can do it in the gani I want to be able to do it from the script, its not that hard. just have like:

setshape3 index,x,y,width,height;

I would also like to be able to make images out of tiles by using the tile coordinates in the tile selection window, not by pixel.
So do it with script. You know you can put scripts in ganis, right?

This is what is irritating to me :/ What you want can already be done, you just choose to avoid doing it yourself. And what purpose would you have for making images out of tiles? Are you just going to dump an image in a tileset? Kind of stupid if you ask me when you have commands like showimg and even ganis to do a lot of things for you. It could potentially be more useful with your command suggestion, but I hope you are aware that there is an actual size limit to NPC scripts. A command like that used on my playerworld would be silly because I use lots of NPC objects even though they are reoccurring scripts.

One big NPC script takes longer to load versus lots of tiny scripts. I really try to avoid using setshape unless I'm defining something like a bridge or defining warps. <-this is the response to why you shouldn't use one NPC for all scripted objects in one level. Its not efficient to dump them all in one. It would be like trying to eat a meal all at once: very difficult and time consuming....and not efficient.
__________________
Reply With Quote
  #21  
Old 05-09-2004, 10:27 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
If you want to put tiles on your level, there are other commands which already do so.

Laziness is good, to an extent. You people are going far beyond its good extent.
Reply With Quote
  #22  
Old 05-10-2004, 03:23 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Lance
If you want to put tiles on your level, there are other commands which already do so.

Laziness is good, to an extent. You people are going far beyond its good extent.
Now that I have the time in my hands to post fully about the origins of this suggestion:

I'm not really going far beyond laziness to a good extent. For whoever it was... i did this script for the top part of a picnic table in my tileset, slightly modified to let it be used as an example.
NPC Code:

if (playerenters) {
for (i=x;i<=x+5;i++){
showimg i*y,ostileset.png,i,y;
changeimgpart i*y,43*16,25*16,16,16;
}
}


The actual script that I would have used this on is gone now, because of a managerial change and a new plan of what is going to happen. It read values off of the string:

setstring this.port,portnumber,x,y,dir,boatx,boaty,signx,sig ny;

To explain the string:

-Consider portnumber,signx,signy irrelevant.
-The x,y,dir was to actually place the tickettaker char that used showcharacter and charprops.
-The boatx,boaty was for placing a showimg of the boat on the given coordinates.

Before I go any further, I'll explain to you how the old boat system on Classic had worked. (and also, please understand the fact that I was converting it to work on an NPC server and that it had been using like 20 putnpc scripts beforehand)
-you sit at the dock until the boat arrives
-the boat, ticket taker appear at the end of the timer.
-you go talk to the ticket taker, he warps you to a separate boat level.
-you stay in the boat level until you get at the stop you want.
-you get off the boat, warp into a new level.

I wanted to be able to control all of this through a single class. The problem was that the tickettaker char took immediate control of the setshape and I couldn't use setshape anywhere else through the NPC because of that. I don't see it as a big deal, I wouldn't care about being able to swim under the boat graphic, but if it was something where it would make more sense to block, I would appreciate being able to use a feature that set a shape using x and y values.
Reply With Quote
  #23  
Old 05-10-2004, 09:09 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally Posted by jake13jake
Now that I have the time in my hands to post fully about the origins of this suggestion:

I'm not really going far beyond laziness to a good extent. For whoever it was... i did this script for the top part of a picnic table in my tileset, slightly modified to let it be used as an example.
NPC Code:

if (playerenters) {
for (i=x;i<=x+5;i++){
showimg i*y,ostileset.png,i,y;
changeimgpart i*y,43*16,25*16,16,16;
}
}


The actual script that I would have used this on is gone now, because of a managerial change and a new plan of what is going to happen. It read values off of the string:

setstring this.port,portnumber,x,y,dir,boatx,boaty,signx,sig ny;

To explain the string:

-Consider portnumber,signx,signy irrelevant.
-The x,y,dir was to actually place the tickettaker char that used showcharacter and charprops.
-The boatx,boaty was for placing a showimg of the boat on the given coordinates.

Before I go any further, I'll explain to you how the old boat system on Classic had worked. (and also, please understand the fact that I was converting it to work on an NPC server and that it had been using like 20 putnpc scripts beforehand)
-you sit at the dock until the boat arrives
-the boat, ticket taker appear at the end of the timer.
-you go talk to the ticket taker, he warps you to a separate boat level.
-you stay in the boat level until you get at the stop you want.
-you get off the boat, warp into a new level.

I wanted to be able to control all of this through a single class. The problem was that the tickettaker char took immediate control of the setshape and I couldn't use setshape anywhere else through the NPC because of that. I don't see it as a big deal, I wouldn't care about being able to swim under the boat graphic, but if it was something where it would make more sense to block, I would appreciate being able to use a feature that set a shape using x and y values.
The boat needs to be a serverside NPC since you said you're using an NPC server, correct? At that point you can control it with setshape2 Like I said a few posts before, one big script is a NO NO! It will take much more time to load versus small scripts. It sounds efficient to put it all in one, but its the exact opposite. If you want I have the script(s) for 2k1's old moveable pirate boat. You're much better off to do it that way because the boat should be on its own. Setshap isn't meant to be used with showimgs to begin with. :/ It won't kill you or the server to use a seperate NPC for the boat. Besides, doing it like that would allow you to actually move the boat between levels like on 2k1. It would give a better sense of realism rather than just magically teleporting to your destination
__________________
Reply With Quote
  #24  
Old 05-11-2004, 08:47 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by G_yoshi
The boat needs to be a serverside NPC since you said you're using an NPC server, correct? At that point you can control it with setshape2 Like I said a few posts before, one big script is a NO NO! It will take much more time to load versus small scripts. It sounds efficient to put it all in one, but its the exact opposite. If you want I have the script(s) for 2k1's old moveable pirate boat. You're much better off to do it that way because the boat should be on its own. Setshap isn't meant to be used with showimgs to begin with. :/ It won't kill you or the server to use a seperate NPC for the boat. Besides, doing it like that would allow you to actually move the boat between levels like on 2k1. It would give a better sense of realism rather than just magically teleporting to your destination
Pfft... it is CLASSIC after all... we'd go nuts if we didn't get teleported everywhere as if by magic. In addition, you're wrong about the script being serverside. The script was 99.9% clientside save the triggeraction warp. I don't believe two showimgs and a showchar using hide and show would very much affect somebody's lag significantly, and I even think it could have worked better with lag so that you could see the timer as it hit 0 instead of it forwarding straight to the boat. It's much easier to keep track of two NPCs than it is to keep track of six.
Reply With Quote
  #25  
Old 05-11-2004, 10:34 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
uh, the boat is clientside? why, exactly? its much easier to do serverside
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #26  
Old 05-12-2004, 01:12 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally Posted by jake13jake
Pfft... it is CLASSIC after all... we'd go nuts if we didn't get teleported everywhere as if by magic. In addition, you're wrong about the script being serverside. The script was 99.9% clientside save the triggeraction warp. I don't believe two showimgs and a showchar using hide and show would very much affect somebody's lag significantly, and I even think it could have worked better with lag so that you could see the timer as it hit 0 instead of it forwarding straight to the boat. It's much easier to keep track of two NPCs than it is to keep track of six.
And you failed to listen to what I said. I just told you it would only require approximately two NPCs if that. Why the hell would even need six?! No wonder why it sucked :/
__________________
Reply With Quote
  #27  
Old 05-12-2004, 06:04 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by G_yoshi
And you failed to listen to what I said. I just told you it would only require approximately two NPCs if that. Why the hell would even need six?! No wonder why it sucked :/
Okay, how it used to be in one specific level:
three- sign for red boat, red boat, ticket taker for red boat.
three- sign for blue boat, blue boat, ticket taker for blue boat.
Quote:
Originally Posted by Dach
uh, the boat is clientside? why, exactly? its much easier to do serverside
It wasn't easier to do it serverside in this situation because of the hide/show stuff on the tickettaker, and a few other conditions that needed to be checked clientside that I honestly forget. It didn't lag, and I was trying to do it as close to the old way as possible... give or take eventually making the image move upto the dock itself. The person inside the boat (separate from the class) that lets you get on the dock was done serverside, because he was easier to do serverside... but for some reason the actual class was easier for me clientside.
Reply With Quote
  #28  
Old 05-12-2004, 08:51 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
meh, its easier if you don't limit yourself to making it work the same as it did before, but I guess you're more worried about being hack-resilient than improving script/system quality
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #29  
Old 05-14-2004, 07:31 AM
dlang dlang is offline
Yoshi!
dlang's Avatar
Join Date: Oct 2002
Location: Houston, Texas
Posts: 406
dlang is on a distinguished road
Send a message via AIM to dlang Send a message via MSN to dlang
Quote:
Originally Posted by Lance
If you want to put tiles on your level, there are other commands which already do so.

Laziness is good, to an extent. You people are going far beyond its good extent.
I'm not being lazy (Probably not true XD!)
But I just want a simple solution to it, rather than having to modify ganis or create long scripts when the same could be done in a simple command.
__________________
Where do I take this pain of mine?
I run but it stays right by my side.
So tear me open, pour me out,
there's things inside that scream and shout.
And the pain still hates me, so hold me until it sleeps.

---------------
Reply With Quote
  #30  
Old 05-15-2004, 11:42 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by dlang
I'm not being lazy (Probably not true XD!)
But I just want a simple solution to it, rather than having to modify ganis or create long scripts when the same could be done in a simple command.
Or with a simple NPC.
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:10 PM.


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