Graal Forums

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

blackbeltben 08-28-2011 07:18 PM

Image Issue
 
I have this script that holds an image over the player, but i noticed that other players can't see the image. How do i make it so other players can see the image??

PHP Code:

//#CLIENTSIDE
function onCreated()
{
showImg(200"block.png", (player.x), (player.y));
setTimer(0.05);
}

function 
onTimeOut()
{
showImg(200"block.png", (player.x), (player.y));
setTimer(0.05);



cbk1994 08-28-2011 07:26 PM

The index (200 in your example) needs to be less than 200 for it to be shown to all players.

Emera 08-28-2011 07:46 PM

Couple more issues.
You don't need to start showing the image when it is created. Just show it once in the timeout. And also your styling should be styled with this.

Here is what you need.
PHP Code:

//#CLIENTSIDE 

function onCreated() {
  
//Start the timer
  
setTimer(0.05);
}

function 
onTimeOut() {
  
//Show the image.
  
showImg(1,"block.png",player.x,player.y);
  
//Keep looping 
  
setTimer(0.05);


Hope that helped!

blackbeltben 08-28-2011 07:55 PM

ahh, ok thank you. One more thing, how do i make it draw UNDER the player??

cbk1994 08-28-2011 08:07 PM

Quote:

Originally Posted by blackbeltben (Post 1665865)
ahh, ok thank you. One more thing, how do i make it draw UNDER the player??

Set the layer to zero.

Either

PHP Code:

findImg(index).layer 0

or

PHP Code:

changeImgVis(index0); 

The first is preferred.

Emera 08-28-2011 08:14 PM

Either do...
PHP Code:

findImg(index).layer 0

Or use findimg...
PHP Code:

//#CLIENTSIDE
function onCreated() {
  
setTimer(0.05);
}

function 
onTimeout() {
  
with(findimg(1)) {
    
image "block.png";
    
player.x;
    
player.y;
    
layer 0;
  }
  
setTimer(0.05);


It would be better if you used findimg. You can do a whole load of stuff with findimg that you can't do with showimg and it is easier to add effects like spin, alpha, layer and the RGB of the image. You can also make it show text aswell!

blackbeltben 08-28-2011 08:30 PM

THANKS CBK. i just have one FINAL problem! Along with the image, i am makeing a custom nickname that shows under the player. It works fine on your screen, but when another player sees your nick, its so faded its barely readable and i dont know where the problem is...

PHP Code:

function onTimeOut()
{
showText(3player.xplayer.y$pref::graal::defaultfontname"c""" @(player.nick));
changeImgColors(3102022);
showImg(2player.attr[20], (player.x+0.5), (player.y-2.7));
setTimer(0.05);

  
with (findImg(3)) {
    
textshadow true;
    
shadowoffset "-2 2";
    
shadowcolors "0 0 0";
  
changeImgZoom(31);



Emera 08-28-2011 08:33 PM

Emmy doesn't get a thanks too :cry:

blackbeltben 08-28-2011 08:44 PM

Quote:

Originally Posted by Emera (Post 1665883)
Emmy doesn't get a thanks too :cry:

what you told me didnt work lol.


All times are GMT +2. The time now is 11:35 AM.

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