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


All times are GMT +2. The time now is 05:15 AM.

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