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
  #1  
Old 05-04-2003, 08:26 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #2  
Old 05-04-2003, 03:38 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
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 :]
__________________
Reply With Quote
  #3  
Old 05-04-2003, 03:49 PM
Falados Falados is offline
Cucumber NPC
Falados's Avatar
Join Date: Jan 2003
Posts: 141
Falados is on a distinguished road
Send a message via ICQ to Falados Send a message via AIM to Falados
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.
__________________

subliminal message: 1+1=3
Reply With Quote
  #4  
Old 05-04-2003, 04:05 PM
Dude6252000 Dude6252000 is offline
More often known as Karsh
Dude6252000's Avatar
Join Date: May 2002
Location: USA.
Posts: 2,603
Dude6252000 is on a distinguished road
Send a message via AIM to 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
__________________
BEING AWAY FROM THE FORUMS RULES

http://www.livejournal.com/users/karsheth/
Reply With Quote
  #5  
Old 05-04-2003, 05:45 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 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...
Uploaded?
__________________
Reply With Quote
  #6  
Old 05-04-2003, 07:13 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #7  
Old 05-05-2003, 12:33 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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?
__________________
Reply With Quote
  #8  
Old 05-05-2003, 12:49 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 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
__________________
Reply With Quote
  #9  
Old 05-05-2003, 01:05 AM
Falados Falados is offline
Cucumber NPC
Falados's Avatar
Join Date: Jan 2003
Posts: 141
Falados is on a distinguished road
Send a message via ICQ to Falados Send a message via AIM to Falados
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.
__________________

subliminal message: 1+1=3
Reply With Quote
  #10  
Old 05-05-2003, 01:33 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
Reply With Quote
  #11  
Old 05-05-2003, 01:44 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #12  
Old 05-05-2003, 04:20 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
?
Reply With Quote
  #13  
Old 05-05-2003, 04:34 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Python523

i figured so...would it be possible to do
COLOREFFECT PARAM1 PARAM2 PARAM3 PARAM4 PARAM5
?
Very unlikely.
__________________
Reply With Quote
  #14  
Old 05-05-2003, 04:36 AM
Falados Falados is offline
Cucumber NPC
Falados's Avatar
Join Date: Jan 2003
Posts: 141
Falados is on a distinguished road
Send a message via ICQ to Falados Send a message via AIM to Falados
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.
__________________

subliminal message: 1+1=3
Reply With Quote
  #15  
Old 05-05-2003, 10:58 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 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.


I am liking that idea very much :]
__________________
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 06:29 AM.


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