Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Alternate Img Display? (https://forums.graalonline.com/forums/showthread.php?t=134266497)

blackbeltben 05-22-2012 07:34 PM

Alternate Img Display?
 
I actually have two questions. I'll split them up!

Question 1
Is there any other way to show/draw images besides showImg()?
When I draw an image, my players can see it, but others can't.
(and the image index is less than 200)
Just need to know if there are any other ways to display images with the player.

Question 2
How would I go about changing a number of a head in a custom body system.
Just making a way to scroll through the different heads.

onKeyPressed(code, key)
{
if (key = "u")
{
player.attr[x] = servername_head_1.png <-- I want the '1' to go up to
'2'. '2' to '3'...and so on
every time you press "u"

callimuc 05-22-2012 08:41 PM

Quote:

Originally Posted by blackbeltben (Post 1695335)
Question 1
Is there any other way to show/draw images besides showImg()?
When I draw an image, my players can see it, but others can't.
(and the image index is less than 200)
Just need to know if there are any other ways to display images with the player.

Are you sure the file is uploaded? You could do something like:
PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/image") {
    
with (findimg(100)) {
      
image "block.png";
      
player.x;
      
player.y;
    }
  }


Quote:

Originally Posted by blackbeltben (Post 1695335)
Question 2
How would I go about changing a number of a head in a custom body system.
Just making a way to scroll through the different heads.

onKeyPressed(code, key)
{
if (key = "u")
{
player.attr[x] = servername_head_1.png <-- I want the '1' to go up to
'2'. '2' to '3'...and so on
every time you press "u"

Try something like
PHP Code:

//#CLIENTSIDE
function onKeyPressed(codekey) {
  if (
key == "u") {
    
temp.pressedcount ++;
    
player.attr[1] = "hat" temp.pressedcount ".png";
  }



blackbeltben 05-22-2012 09:25 PM

Quote:

Are you sure the file is uploaded? You could do something like:
The File IS uploaded. I am not sure why people can not see each other's images :/

cbk1994 05-22-2012 09:27 PM

Quote:

Originally Posted by blackbeltben (Post 1695351)
The File IS uploaded. I am not sure why people can not see each other's images :/

Images with indexes below 200 only show to all players if they're small. I don't recall the exact size.

Hezzy002 05-22-2012 09:33 PM

I've never trusted this mechanic of Graal for a variety of reasons including huge waste of bandwidth and unreliable behavior. You should look into alternatives or writing your own system.

Emera 05-22-2012 10:04 PM

Quote:

Originally Posted by cbk1994 (Post 1695352)
Images with indexes below 200 only show to all players if they're small. I don't recall the exact size.

I've tried displaying an image with index 100 with a zoom size of 2 before and it just cuts off.

Admins 05-22-2012 10:09 PM

A weapon needs to display a showimg with index between 1-200 and the size must be less or equal to 128x128 pixels. Alternatively you can also use ganis as player.attr[], although showimg should be fine as long as you don't want to display a lot.


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

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