![]() |
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. |
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 :] |
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.
|
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
|
Quote:
|
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. |
Quote:
Quote:
Quote:
|
Quote:
|
Quote:
|
Quote:
COLOREFFECT sprite r g b a and i forgot the ones for effectmode, probably EFFECTMODE sprite mode |
Quote:
|
Quote:
COLOREFFECT PARAM1 PARAM2 PARAM3 PARAM4 PARAM5 ? |
Quote:
|
Quote:
NPC Code: and then in the script NPC Code: Or something of that nature. Setspritecolor being a new command to edit sprite stuff. |
Quote:
I am liking that idea very much :] |
Quote:
|
Quote:
(how much longer till BETA for 3.0 is ready? I'm practically soiling myself waiting for it (not literally :p)). |
Quote:
|
Quote:
|
Quote:
|
I've wanted sprite-coloring for a loooong time....
|
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.
|
Quote:
|
Quote:
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? |
Quote:
Quote:
|
Quote:
Jus another way I want players to be unique. |
I want that too, for my server I don't have. ^_~
|
Quote:
|
Quote:
|
Quote:
You can parse them in your script to use as the value for variables (or variable offsets, or whatever you need). |
Quote:
|
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.