Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Gani-specific variables and gani sets (https://forums.graalonline.com/forums/showthread.php?t=44702)

Kaimetsu 05-04-2003 08:26 AM

Gani-specific variables and gani sets
 
Gani sets

Usually a single monster etc needs a few ganis to operate. A hurt gani, an idle gani, a moving gani etc. But having multiple separate files to represent a single creature's representation seems... messy. I propose a feature whereby ganis can be grouped together in sets. Then instead of the gani directory looking like this:

ghost_walk.gani
ghost_hurt.gani
ghost_idle.gani
ghost_attack.gani
snake_walk.gani
snake_hurt.gani
snake_idle.gani
snake_attack.gani

it would look like this:

ghost.gani
snake.gani

choosing which subgani to use would probably involve some kind of reserved character (example: 'setani ghost.walk,;' or 'setani ghost::walk,;'). The implementation would surely be fairly simple? Ganis are just text files, so the different sprite definitions etc could all be held in a single file with an index of sorts at the beginning. Or heck, they could just be bundled into something akin to a zip file.

Gani variables

Today I was thinking about how I would script a ghost whose opacity varied randomly. The obvious problem with the task is that ganis would not mesh together easily. I could code a script gani that drew the ghost and varied the opacity pretty easily, but each script would have its own set of variables - if the ghost changed from ghost_walk (or ghost::walk ;)) to ghost_idle then the variable holding its current transparency value would be lost and there'd be a visible change in opacity. Not very nice.

And there are other examples. What about a monster that is on fire? Maybe a fire elemental? If its flames are particle effects controlled by a gani script then they will reset themselves every time the gani is changed. In this case we could try using a complimentary gani to get around the problem, but it's not exactly an elegant solution.

I propose a set of variables that are only accessible to ganis (gani.vars would seem like the intuitive option). These variables would be accessible to every gani that runs, and would be preserved between gani changes. Then I can store the ghost's current opacity in gani.ghostOpacity and any of the ghost's ganis can access it, meaning that the transparency will stay smooth and convincing.

G_yoshi 05-04-2003 03:38 PM

That sounds like a good idea to me :)

Would these gani variables be able to be changed from an NPC or are they local to ganis only? If it could be added that you can changed variables (such as coloreffect) from outside ganis then I could do something really neat :]

Falados 05-04-2003 03:49 PM

Neeto :grin:, I ran into that sort of problem once, don't remember when exactly, I actually think it was a particle effect, and I ended up just omitting it altogether. This would help a lot. If I may make a suggestion though, Maybe there could also be gani.strings? I know it is entirely possible to use params or attributes to send strings, and most people do, but there is a great possibility you could wipe out attribute information another NPC has set if you aren't meticulously careful :\, ganis, after-all, can't set their own attributes, so if you ever needed to set strings inside a gani, it would be impossible.

Dude6252000 05-04-2003 04:05 PM

Kai. That would make my job of making ganis for random servers SO much easier. If this doesn't get uploaded, Stefan's going to be kicked, by a certain SOMEONE... :D

G_yoshi 05-04-2003 05:45 PM

Quote:

Originally posted by Dude6252000
Kai. That would make my job of making ganis for random servers SO much easier. If this doesn't get uploaded, Stefan's going to be kicked, by a certain SOMEONE... :D
Uploaded? :confused:

adam 05-04-2003 07:13 PM

Would there be one gani script for the whole gani set.

Or would each part of the set still have it's own script.

If it had just one script. We might need a variable to say which part of the gani is active.

Kaimetsu 05-05-2003 12:33 AM

Quote:

Originally posted by G_yoshi
Would these gani variables be able to be changed from an NPC or are they local to ganis only?
I guess there would be no harm in making them accessible to weapons etc. It would just be graphical things, so there wouldn't be any real security problems. Of course, the scripter would have to remember that gani.vars are clientside only, and thus that changes made to them would not affect the way others see the NPCs!

Quote:

Originally posted by adam
Would there be one gani script for the whole gani set.
Ah, yes, this is the part of the plan that I didn't mention. Indeed you would be able to specify a script for the entire set (or possibly Graal could even use gani classes stored locally in text files).

Quote:

If it had just one script. We might need a variable to say which part of the gani is active.
...like #m?

G_yoshi 05-05-2003 12:49 AM

Quote:

Originally posted by Kaimetsu


I guess there would be no harm in making them accessible to weapons etc. It would just be graphical things, so there wouldn't be any real security problems. Of course, the scripter would have to remember that gani.vars are clientside only, and thus that changes made to them would not affect the way others see the NPCs!

The only reason that I want to be able to control coloreffects in ganis from external NPCs is so I can basically make grey scaled clothing/hair for character sprites and then let players have their own customized colors without having to make a seperate sprite table for each color. Just one table, let the NPCs and players do the rest ;)

Falados 05-05-2003 01:05 AM

Quote:

Originally posted by G_yoshi


The only reason that I want to be able to control coloreffects in ganis from external NPCs is so I can basically make grey scaled clothing/hair for character sprites and then let players have their own customized colors without having to make a separate sprite table for each color. Just one table, let the NPCs and players do the rest ;)

that would be impossible anyway, unless your clothes are showimgs in a gani script, you'd need the ability to edit the sprites in gani scripts, which would be a really good addition.

Python523 05-05-2003 01:33 AM

Quote:

Originally posted by Falados


that would be impossible anyway, unless your clothes are showimgs in a gani script, you'd need the ability to edit the sprites in gani scripts, which would be a really good addition.

...open ganis with wordpad
COLOREFFECT sprite r g b a

and i forgot the ones for effectmode, probably
EFFECTMODE sprite mode

Kaimetsu 05-05-2003 01:44 AM

Quote:

Originally posted by Python523

...open ganis with wordpad
COLOREFFECT sprite r g b a

and i forgot the ones for effectmode, probably
EFFECTMODE sprite mode

He's talking about dynamically changing them.

Python523 05-05-2003 04:20 AM

Quote:

Originally posted by Kaimetsu


He's talking about dynamically changing them.

i figured so...would it be possible to do
COLOREFFECT PARAM1 PARAM2 PARAM3 PARAM4 PARAM5
?

Kaimetsu 05-05-2003 04:34 AM

Quote:

Originally posted by Python523

i figured so...would it be possible to do
COLOREFFECT PARAM1 PARAM2 PARAM3 PARAM4 PARAM5
?

Very unlikely.

Falados 05-05-2003 04:36 AM

Quote:

Originally posted by Python523

i figured so...would it be possible to do
COLOREFFECT PARAM1 PARAM2 PARAM3 PARAM4 PARAM5
?

Maybe, I'd check, but who would want to waste their params on 1 thing? X_X, especially if its a character, you have to be conservative. It would be a lot nicer to edit the image and pass something via an attribute like...

NPC Code:

setplayerprop #P3,r g b;



and then in the script

NPC Code:

tokenize #P3;
setspritecolor 0,strtofloat(#t(0)),strtofloat(#t(1)),strtofloat(# t(2)),1;



Or something of that nature.

Setspritecolor being a new command to edit sprite stuff.

G_yoshi 05-05-2003 10:58 PM

Quote:

Originally posted by Falados


Maybe, I'd check, but who would want to waste their params on 1 thing? X_X, especially if its a character, you have to be conservative. It would be a lot nicer to edit the image and pass something via an attribute like...

NPC Code:

setplayerprop #P3,r g b;



and then in the script

NPC Code:

tokenize #P3;
setspritecolor 0,strtofloat(#t(0)),strtofloat(#t(1)),strtofloat(# t(2)),1;



Or something of that nature.

Setspritecolor being a new command to edit sprite stuff.

:eek:

I am liking that idea very much :]

Falados 05-06-2003 01:40 AM

Quote:

Originally posted by G_yoshi


:eek:

I am liking that idea very much :]

I did the same thing in the 2k1 torch, but that was showimg, wich makes it posible, so is the 2k2 torch wich uses the same method I believe. But for colored sprites, a new command must be added =\, it kindof stinks.

G_yoshi 05-07-2003 01:55 AM

Quote:

Originally posted by Falados

I did the same thing in the 2k1 torch, but that was showimg, wich makes it posible, so is the 2k2 torch wich uses the same method I believe. But for colored sprites, a new command must be added =\, it kindof stinks.

heh, I knew how it was done in the torch :p But, yes, a new command would be needed. Greatly needed indeed.

(how much longer till BETA for 3.0 is ready? I'm practically soiling myself waiting for it (not literally :p)).

Dude6252000 05-07-2003 01:59 AM

Quote:

Originally posted by G_yoshi


Uploaded? :confused:

Blah, I meant put in. I was half-asleep when I made that post.

G_yoshi 05-07-2003 03:01 AM

Quote:

Originally posted by Dude6252000

Blah, I meant put in. I was half-asleep when I made that post.

lol...or were you? :D

Dude6252000 05-07-2003 03:25 PM

Quote:

Originally posted by G_yoshi


lol...or were you? :D

I was when I made that post, too. :O I'm always tired.

Tyhm 05-08-2003 12:25 AM

I've wanted sprite-coloring for a loooong time....

Tyhm 05-09-2003 12:11 AM

Stefan says this has been possible since summer '02: just changeimgcolors spritenumber,r,g,b,a; in a ganiscript. If there's no showimage with the same index, it'll recolor the sprite.

Falados 05-09-2003 12:17 AM

Quote:

Originally posted by Tyhm
Stefan says this has been possible since summer '02: just changeimgcolors spritenumber,r,g,b,a; in a ganiscript. If there's no showimage with the same index, it'll recolor the sprite.
Really? I wish this was mentioned somewhere.

G_yoshi 05-10-2003 07:53 AM

Quote:

Originally posted by Tyhm
Stefan says this has been possible since summer '02: just changeimgcolors spritenumber,r,g,b,a; in a ganiscript. If there's no showimage with the same index, it'll recolor the sprite.
:eek:!

Well, then...uhm...COOL :D

But, uh, thats only in a gani script. I'm looking to be able to control it without gani script :p Unless there is a way to change the values with an external NPC?

Kaimetsu 05-10-2003 08:22 AM

Quote:

Originally posted by G_yoshi
But, uh, thats only in a gani script. I'm looking to be able to control it without gani script :p
Why?

Quote:

Unless there is a way to change the values with an external NPC?
Probably not, no.

G_yoshi 05-10-2003 04:28 PM

Quote:

Originally posted by Kaimetsu


Why?



Probably not, no.

I thought I already said why? If not, I'll say it again: I want to allow players to literally customize thier hair and clothing color. Then all I would need are simple grey-scale hair and certain clothing sprites making for less images needed :)

Jus another way I want players to be unique.

Tyhm 05-10-2003 06:28 PM

I want that too, for my server I don't have. ^_~

Kaimetsu 05-11-2003 04:26 AM

Quote:

Originally posted by G_yoshi
I thought I already said why? If not, I'll say it again: I want to allow players to literally customize thier hair and clothing color.
That's an answer to a completely different question. Why don't you want to use gani script?

G_yoshi 05-11-2003 04:33 AM

Quote:

Originally posted by Kaimetsu


That's an answer to a completely different question. Why don't you want to use gani script?

As far as I understand I can't really edit variables used in gani scripts from the outside. It doesn't matter to me how to go about accomplishing this just so long as I get the result I am looking for.

Falados 05-11-2003 05:26 AM

Quote:

Originally posted by G_yoshi


As far as I understand I can't really edit variables used in gani scripts from the outside. It doesn't matter to me how to go about accomplishing this just so long as I get the result I am looking for.

use Attributes

You can parse them in your script to use as the value for variables (or variable offsets, or whatever you need).

G_yoshi 05-11-2003 05:46 PM

Quote:

Originally posted by Falados

use Attributes

You can parse them in your script to use as the value for variables (or variable offsets, or whatever you need).

Thanks! :)

Admins 05-22-2003 09:42 PM

Ah I should check this forum more often

The changeimgcolors and changeimgmode commands only work when you have a COLOREFFECT line thing for the sprite, so Graal knows that the sprite needs to be colored when the gani is loaded. The problem with this is that people without 3D card dont see this, so it's probably better to wait until v3 replaces the old Graal (or make it so that some playerworlds can only be played with v3).

The this. variables and this. strings are normally not deleted when the gani switches, has anyone tried to use those?


All times are GMT +2. The time now is 02:58 PM.

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