Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-16-2007, 09:01 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Ganis

Well, I don't really know where this should go... so I decided in my favourite forum!

Well, my idea is to create a lamp, but edit the light effects. You'll see from the script[s].

The gani:

HTML Code:
GANI0001
SPRITE    0 v_object-lamp.png    0    0   32   64 Lamp
SPRITE    1           ATTR1    0    0  130  130 Light

SINGLEDIRECTION
DEFAULTATTR1 light4.png
DEFAULTATTR2 0.5, 0.5, 0.5, 0.5
DEFAULTHEAD head19.png
DEFAULTBODY body.png

ANI
   0   8 -26,    1 -39 -81
ANIEND
As you can see, it's setting a Light image, which works. What I am wanting to do is edit the colors to this sprite [1], but I don't want to use a gani script. I'd use it, if it were the only way though I suppose...

He's my lamp script:

HTML Code:
function onCreated()
{
  this.showCharacter();
  this.ani = "v_lamp";
  
  if (this.alignLamp)
  {
    this.x -= 0.5;
    this.y += 0.5;
  }
  this.attr[1] = this.lightImage;
  this.attr[2] = this.lightColors;
}
The ATTR2 shall contain the lights effects {r,g,b,a}. Any suggestions? thanks!
Reply With Quote
  #2  
Old 04-16-2007, 09:14 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
SETCOLOREFFECT SPRITE R G B

i think
Reply With Quote
  #3  
Old 04-16-2007, 09:17 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Rapidwolve View Post
SETCOLOREFFECT SPRITE R G B

i think
How would I add that using attrs?
That's the problem
Reply With Quote
  #4  
Old 04-17-2007, 02:43 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Have a changeimgcolors(index, r, g, b, a); and use it in a script in the gani :o
and attr[2] could be like
PHP Code:
attr[2] = "1 1 1 0.75"
PHP Code:
red green blue alpha "";
colors "red green blue alpha";
0;
for(
attr[2].tokenize()) {
  
makevar(colors.tokenize()[i]) = j;
  
++;
}
changeimgcolors(1redgreenbluealpha); 
dunno if that would work, but something like that in the gani
__________________
Reply With Quote
  #5  
Old 04-17-2007, 04:03 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
The script to change the sprite's colors has to be a gani script. There is no other way.
__________________
Reply With Quote
  #6  
Old 04-17-2007, 06:37 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
I thought so too! I'll have to make it display the light with showimg
Thanks
Reply With Quote
  #7  
Old 04-17-2007, 09:08 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
That isn't true you guys...He could always make a million sprites each with different color settings ^_^
__________________
Do it with a DON!
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 10:03 PM.


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