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 08-28-2011, 07:18 PM
blackbeltben blackbeltben is offline
Registered User
Join Date: Aug 2011
Posts: 83
blackbeltben is on a distinguished road
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);

Reply With Quote
  #2  
Old 08-28-2011, 07:26 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
The index (200 in your example) needs to be less than 200 for it to be shown to all players.
__________________
Reply With Quote
  #3  
Old 08-28-2011, 07:46 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
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!
__________________
Reply With Quote
  #4  
Old 08-28-2011, 07:55 PM
blackbeltben blackbeltben is offline
Registered User
Join Date: Aug 2011
Posts: 83
blackbeltben is on a distinguished road
ahh, ok thank you. One more thing, how do i make it draw UNDER the player??
Reply With Quote
  #5  
Old 08-28-2011, 08:07 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by blackbeltben View Post
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.
__________________
Reply With Quote
  #6  
Old 08-28-2011, 08:14 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
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!
__________________
Reply With Quote
  #7  
Old 08-28-2011, 08:30 PM
blackbeltben blackbeltben is offline
Registered User
Join Date: Aug 2011
Posts: 83
blackbeltben is on a distinguished road
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);

Reply With Quote
  #8  
Old 08-28-2011, 08:33 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Emmy doesn't get a thanks too
__________________
Reply With Quote
  #9  
Old 08-28-2011, 08:44 PM
blackbeltben blackbeltben is offline
Registered User
Join Date: Aug 2011
Posts: 83
blackbeltben is on a distinguished road
Quote:
Originally Posted by Emera View Post
Emmy doesn't get a thanks too
what you told me didnt work lol.
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:23 AM.


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