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 06-04-2012, 05:26 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Text Image color not changing?

I have a NPC that is created that joins a class. The script is suppose to draw a number but for some reason it comes out a light blue no matter what I set the color values to.

PHP Code:
function onCreated()
{
 
showText(1this.xthis.y-3$pref::graal::defaultfontname"c""" @(this.setnuber));
 
changeImgColors(110101010); //<-- I think the issue is here
   
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "0 0";
    
shadowcolors "1 1 1";
    
changeImgZoom(13);
 }

Reply With Quote
  #2  
Old 06-04-2012, 05:53 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
I'm amazed it's actually light blue and not white. You have 10 for red, green, blue and alpha. First off, all of the four values range between 0 and 1. And to get something that's not white/gray, you probably want to choose different values.
__________________
Reply With Quote
  #3  
Old 06-04-2012, 08:57 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Quote:
I'm amazed it's actually light blue and not white. You have 10 for red, green, blue and alpha. First off, all of the four values range between 0 and 1. And to get something that's not white/gray, you probably want to choose different values.
I redid the script. But the zoom and font dont seem to be changing?

PHP Code:
function onCreated(){ 
 
showText(1this.xthis.y-3$pref::graal::defaultfontname"c""" @(this.setnumber));
 
changeImgColors(11111);
  
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "-2 2";
    
shadowcolors "0 0 0";
    
font "showg";
    
style "b";
    
layer 12;
    
zoom 2;
 }

Reply With Quote
  #4  
Old 06-04-2012, 09:15 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by brokk View Post
I redid the script. But the zoom and font dont seem to be changing?

PHP Code:
function onCreated(){ 
 
showText(1this.xthis.y-3$pref::graal::defaultfontname"c""" @(this.setnumber));
 
changeImgColors(11111);
  
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "-2 2";
    
shadowcolors "0 0 0";
    
font "showg";
    
style "b";
    
layer 12;
    
zoom 2;
 }

PHP Code:
function onCreated(){ 
  
showText(1this.xthis.y-3$pref::graal::defaultfontname"c"this.setnumber);
  
changeImgColors(11111);
  
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "-2 2";
    
shadowcolors "0 0 0";
    
//font = "showg";
    
style "b";
    
layer 12;
    
zoom 2;
  }

You setted the font 2 times. Once in the showText() part ($pref::graal::defaultfontname) and once in the with(findimg(1)) part (font = "showg"). You have to choose which you want to use.

Also a small tip if you want to use RGB values for you colors: you can do divide the RGB value with 255 which will always make it <= 1. As example:
PHP Code:
changeImgColors(1255/255216/2550/255255/255);
changeImgColors(indexredgreenbluealpha); 
Which would make it yellow
__________________
MEEP!
Reply With Quote
  #5  
Old 06-04-2012, 09:45 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
OOOOH thank you. I got it now.

But I am still running into one issue. the layer=# is NOT working for some reason :[
Reply With Quote
  #6  
Old 06-04-2012, 10:17 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
You can do either
PHP Code:
changeImgVis(indexlayer);
changeImgVis(13); 
PHP Code:
findImg(index).layer layer;
findImg(1).layer 3;
//or
with (findImg(1)) {
  
layer 3;

__________________
MEEP!
Reply With Quote
  #7  
Old 06-04-2012, 10:26 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Use an image index >200 in this case.
Reply With Quote
  #8  
Old 06-04-2012, 10:35 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
Use an image index >200 in this case.
Oh jea since he wanted it > 3. Didnt check his one
__________________
MEEP!
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 07:30 PM.


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