Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   loadimage or a way to get the images from scriptfiles? (https://forums.graalonline.com/forums/showthread.php?t=78856)

vigilant_death2 02-26-2008 11:42 PM

loadimage or a way to get the images from scriptfiles?
 
I am currently working on a mini map that is drawn based on the tiles in the level and have made use of the saveimage function to save the mini map file...
However, I cannot seem to find a way to load that image back...
Is this simply not possible or am I missing something?
any help would be appreciated thank you in advance :)

Chompy 02-26-2008 11:44 PM

By saveimage function, do you mean you save it as a image file? .png, .gif etc?
Or you save the minimap data for each level to files and it isn't loading those files? ;O

More info would be nice :o

vigilant_death2 02-26-2008 11:45 PM

I am using
NPC Code:

saveimage(filename.png);


to save a .png file and would like to reload that png file if it is there

DustyPorViva 02-26-2008 11:50 PM

saveimage('filename.png');

vigilant_death2 02-26-2008 11:51 PM

The problem is not saving the image I am doing that just fine.
If you need to see the exact code...
NPC Code:

GuiMiniMapDraw.saveimage("minimaps/minimap_"@player.level.substring(0,player.level.po s("."))@".png");


the previously shown was just to give an example of what I was doing...

Chompy 02-26-2008 11:53 PM

Substring player.level.name instead of player.level ^^

vigilant_death2 02-26-2008 11:57 PM

Well thank you for that correction however I still cannot load the image back o_O
Is there a function for loading .png files from the player?

Chompy 02-27-2008 12:04 AM

Quote:

Originally Posted by vigilant_death2 (Post 1376696)
Well thank you for that correction however I still cannot load the image back o_O
Is there a function for loading .png files from the player?

Well, I would try "/find minimap_*.png" in rc chat to see if it's there at all and/or downloadable.

And, from what I see it, you're doing this clientside, right?

cbk1994 02-27-2008 12:05 AM

Would it not be better to have a serverside script doing this, and updating an image file, which is just shown on clientside?

vigilant_death2 02-27-2008 12:06 AM

Quote:

Originally Posted by (npcserver)
Script help for 'saveimage':
Clientside:
GuiDrawingPanel.saveimage(str)
TDrawingPanel.saveimage(str)

It is saving 'str' to your scriptfiles o_O
So I am assuming there is no way to get the image back afterwards?

Admins 02-27-2008 12:13 AM

Hmmm it's bugged on windows I think, it's saving it but not adding it to the file list.
It should however work fine on Linux and Mac.

vigilant_death2 02-27-2008 12:15 AM

Well I may be misunderstanding you but it is adding the file to scriptfiles but I cannot find a way to access it or check to see if it is there so I can redisplay? :confused:

vigilant_death2 02-27-2008 12:17 AM

Quote:

Originally Posted by cbkbud (Post 1376698)
Would it not be better to have a serverside script doing this, and updating an image file, which is just shown on clientside?

The function is only available clientside =/
Quote:

Originally Posted by (npcserver)
Script help for 'saveimage':
Clientside:
GuiDrawingPanel.saveimage(str)
TDrawingPanel.saveimage(str)


Admins 02-27-2008 12:20 AM

I've checked it, it's not working correcty on Mac/Linux either, will fix it with the next Graal version.

vigilant_death2 02-27-2008 12:20 AM

Thanks a lot stefan I look forward to updating my mini map system :)

zokemon 02-27-2008 12:38 PM

Just use clearall() and drawimage() in the drawing panel.

Inverness 02-29-2008 01:22 AM

Stefan I would like it if you could make the adding to the file list an optional feature with a boolean parameter in saveimage().

This is because I wish to make a script for people to convert images from gif to png using the drawing panel.


All times are GMT +2. The time now is 10:22 AM.

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