Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Multiple Setshapes? (https://forums.graalonline.com/forums/showthread.php?t=52565)

jake13jake 05-04-2004 09:29 PM

Multiple Setshapes?
 
No, not a question, more of a suggestion... It would be nice if you could just add <<setshape# x,y,width,height,type>>.... so that way you could set a shape more easily around some showimgs... make it so you wouldn't be so tempted to put so many different NPCs for so many of the same purposes in one level, you know? especially with showimgs.

DIABLO2099 05-05-2004 03:37 AM

Hm, aren't showimgs normally used for display purposes rather than interacting with the player other than visually?

zokemon 05-05-2004 04:52 AM

No?
Look at a Menu GUI o_O

Dach 05-05-2004 01:46 PM

Quote:

Originally Posted by zokemon
No?
Look at a Menu GUI o_O

that has nothing to do with this suggestion

Give some examples of usage with this, I hate it when people dis an idea because they can't think of anything to do with it :\

billybob256 05-05-2004 06:39 PM

acctually, multiple setshapes is a great idea, because i make houses out of ganis, and have to use setshape for every one, and for castles i have to use about 5.

It would really reduce lag but how would you select the NPCs in the level editor?

jake13jake 05-05-2004 07:06 PM

Ex. I was working on Classic's boat NPC, some people told me that I should keep the boat's shape, but I wanted to make it so I only need one class, and I did everything but the actual tickettaker as a showimg. If I wanted to make it so nobody could swim under the boat, I would have to make a setshape.

Also, this would probably be the most practical use for it.. let's say you wanted to have an NPC so that the player could walk partially behind/under it... like the back of a tree, a sign, or a picnic table... you could do the setshape at x+1 instead of having it be at X. There could be a lot of uses for this.

Lance 05-05-2004 07:16 PM

Quote:

Originally Posted by billybob256
acctually, multiple setshapes is a great idea, because i make houses out of ganis, and have to use setshape for every one, and for castles i have to use about 5.

It would really reduce lag but how would you select the NPCs in the level editor?

Put the setshape in the gani...?

Quote:

Originally Posted by jake13jake
Ex. I was working on Classic's boat NPC, some people told me that I should keep the boat's shape, but I wanted to make it so I only need one class, and I did everything but the actual tickettaker as a showimg. If I wanted to make it so nobody could swim under the boat, I would have to make a setshape.

Attachplayertoobj + dontblock...?

Quote:

Also, this would probably be the most practical use for it.. let's say you wanted to have an NPC so that the player could walk partially behind/under it... like the back of a tree, a sign, or a picnic table...
setshape2...?

Dach 05-05-2004 07:27 PM

1 Attachment(s)
hmm, if it weren't for the obvious lag reducing capabilities, I'd say no for sure, but for multiple similar objects that are cross-level, showimgs would be much nicer than npcs (i.e. those blasted lights people keep making, even though that has nothing to do with setshape :mad: ). But just for having different layers of shapes on one object, put your setshape and block/dontblock in a timeout and change them as the player's interaction with the npc changes (see attachment). You don't need to layer showimgs to do such things.

jake13jake 05-05-2004 08:14 PM

Quote:

Originally Posted by Lance
Put the setshape in the gani...?



Attachplayertoobj + dontblock...?



setshape2...?

Have you ever even seen the classic boat system? What if you wanted to put more than one table in a level but have all the tables in one npc? What if you wanted a level in which all the walls were scripted in setshapes?

DIABLO2099 05-06-2004 12:15 AM

putnpc with a class script may do the trick, not sure =O.

Lance 05-06-2004 02:05 AM

Quote:

Originally Posted by jake13jake
Have you ever even seen the classic boat system?

No.

Quote:

What if you wanted to put more than one table in a level but have all the tables in one npc?
Why?

Quote:

What if you wanted a level in which all the walls were scripted in setshapes?
Why, again?

G_yoshi 05-06-2004 09:43 PM

Quote:

Originally Posted by billybob256
acctually, multiple setshapes is a great idea, because i make houses out of ganis, and have to use setshape for every one, and for castles i have to use about 5.

It would really reduce lag but how would you select the NPCs in the level editor?

~G_Yoshi's Slice of Advice (lol)~

You don't even need to use setshape for houses if you know how to do it right ;) Take a look at GK's buildings. The gani, in the editor, shows a 'base' which is the blocking zone of the house. Next, open the gani in wordpad and take a look at the script. That's what puts up the rest of the building without blocking the player. Its very useful and very efficient. Plus, when in the level editor, you see the entire thing, not just the base. I use this on Doragon Koden for anything that a player could possibly go under: Trees, houses, even my stone walls.

Setshape is more useful for smaller objects. Its purpose is for use with an NPC server, particularly non-clientside objects (i.e. script does not contain //#CLIENTSIDE; can still be used clientside, though). Setshape2 is pretty much the same except you get more control over how each 'tile' of the image behaves.

jake13jake 05-06-2004 10:17 PM

Quote:

Originally Posted by Lance
No.
Take a look before you judge.


Why?
More efficiency, easier to edit.


Why, again?
If you want to make something creative.

Did you see those crazy moving blocks on the race course in the graalympics? Bet this could've done a lot of good there.

Dach 05-08-2004 06:49 AM

Quote:

Originally Posted by jake13jake
Did you see those crazy moving blocks on the race course in the graalympics? Bet this could've done a lot of good there.

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.

dlang 05-08-2004 03:53 PM

This would be easier for certain npcs than useing multiple images.

jake13jake 05-08-2004 05:30 PM

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).

G_yoshi 05-08-2004 10:08 PM

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


dlang 05-08-2004 11:23 PM

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.

jake13jake 05-09-2004 02:29 AM

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;"

G_yoshi 05-09-2004 02:55 AM

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.

Lance 05-09-2004 10:27 PM

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.

jake13jake 05-10-2004 03:23 PM

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.

G_yoshi 05-10-2004 09:09 PM

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 :p 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 :p

jake13jake 05-11-2004 08:47 PM

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 :p 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 :p

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.

Dach 05-11-2004 10:34 PM

uh, the boat is clientside? why, exactly? its much easier to do serverside

G_yoshi 05-12-2004 01:12 AM

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 :/

jake13jake 05-12-2004 06:04 PM

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.

Dach 05-12-2004 08:51 PM

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 :\

dlang 05-14-2004 07:31 AM

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.

Lance 05-15-2004 11:42 AM

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.

jake13jake 05-16-2004 01:01 PM

Quote:

Originally Posted by Dach
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 :\

Actually... I don't think it would have been easy at all to map the movement of the boat from port to port. Classic's Map had like 1000+ levels.

Dach 05-16-2004 07:56 PM

Quote:

Originally Posted by jake13jake
Actually... I don't think it would have been easy at all to map the movement of the boat from port to port. Classic's Map had like 1000+ levels.


fine, use a shortcut, move it off of the port level, and warp to a scrolling water level (similar to the old system) then warp to the next port

I never even said to do it the same as GK... not to mention mapping nodes on a gmap isn't very hard, classic does have alot of ocean y'know

dlang 06-02-2004 08:24 AM

I hope this is added soon -.-, it would be very handy.


All times are GMT +2. The time now is 11:36 PM.

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