Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Ganis (https://forums.graalonline.com/forums/showthread.php?t=73522)

Chandler 04-16-2007 09:01 PM

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!

Rapidwolve 04-16-2007 09:14 PM

SETCOLOREFFECT SPRITE R G B

i think

Chandler 04-16-2007 09:17 PM

Quote:

Originally Posted by Rapidwolve (Post 1300474)
SETCOLOREFFECT SPRITE R G B

i think

How would I add that using attrs?
That's the problem :p

Chompy 04-17-2007 02:43 PM

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

Kristi 04-17-2007 04:03 PM

The script to change the sprite's colors has to be a gani script. There is no other way.

Chandler 04-17-2007 06:37 PM

I thought so too! I'll have to make it display the light with showimg :(
Thanks

zokemon 04-17-2007 09:08 PM

That isn't true you guys...He could always make a million sprites each with different color settings ^_^


All times are GMT +2. The time now is 12:12 PM.

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