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
  #16  
Old 05-06-2003, 01:40 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




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

subliminal message: 1+1=3
Reply With Quote
  #17  
Old 05-07-2003, 01:55 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 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 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 )).
__________________
Reply With Quote
  #18  
Old 05-07-2003, 01:59 AM
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
Quote:
Originally posted by G_yoshi


Uploaded?
Blah, I meant put in. I was half-asleep when I made that post.
__________________
BEING AWAY FROM THE FORUMS RULES

http://www.livejournal.com/users/karsheth/
Reply With Quote
  #19  
Old 05-07-2003, 03:01 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 Dude6252000

Blah, I meant put in. I was half-asleep when I made that post.
lol...or were you?
__________________
Reply With Quote
  #20  
Old 05-07-2003, 03:25 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
Quote:
Originally posted by G_yoshi


lol...or were you?
I was when I made that post, too. :O I'm always tired.
__________________
BEING AWAY FROM THE FORUMS RULES

http://www.livejournal.com/users/karsheth/
Reply With Quote
  #21  
Old 05-08-2003, 12:25 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
I've wanted sprite-coloring for a loooong time....
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #22  
Old 05-09-2003, 12:11 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
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.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #23  
Old 05-09-2003, 12:17 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 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.
__________________

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

Well, then...uhm...COOL

But, uh, thats only in a gani script. I'm looking to be able to control it without gani script Unless there is a way to change the values with an external NPC?
__________________
Reply With Quote
  #25  
Old 05-10-2003, 08:22 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
But, uh, thats only in a gani script. I'm looking to be able to control it without gani script
Why?

Quote:
Unless there is a way to change the values with an external NPC?
Probably not, no.
__________________
Reply With Quote
  #26  
Old 05-10-2003, 04:28 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 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.
__________________
Reply With Quote
  #27  
Old 05-10-2003, 06:28 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
I want that too, for my server I don't have. ^_~
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #28  
Old 05-11-2003, 04:26 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
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?
__________________
Reply With Quote
  #29  
Old 05-11-2003, 04:33 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


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.
__________________
Reply With Quote
  #30  
Old 05-11-2003, 05:26 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


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

subliminal message: 1+1=3
Reply With Quote
  #31  
Old 05-11-2003, 05:46 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

use Attributes

You can parse them in your script to use as the value for variables (or variable offsets, or whatever you need).
Thanks!
__________________
Reply With Quote
  #32  
Old 05-22-2003, 09:42 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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?
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 11:25 PM.


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