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 02-26-2008, 11:42 PM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
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
__________________
-Neo
Reply With Quote
  #2  
Old 02-26-2008, 11:44 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
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
__________________
Reply With Quote
  #3  
Old 02-26-2008, 11:45 PM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
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
__________________
-Neo
Reply With Quote
  #4  
Old 02-26-2008, 11:50 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
saveimage('filename.png');
Reply With Quote
  #5  
Old 02-26-2008, 11:51 PM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
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...
__________________
-Neo

Last edited by vigilant_death2; 02-26-2008 at 11:53 PM.. Reason: typo
Reply With Quote
  #6  
Old 02-26-2008, 11:53 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Substring player.level.name instead of player.level
__________________
Reply With Quote
  #7  
Old 02-26-2008, 11:57 PM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
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?
__________________
-Neo
Reply With Quote
  #8  
Old 02-27-2008, 12:04 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by vigilant_death2 View Post
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?
__________________
Reply With Quote
  #9  
Old 02-27-2008, 12:05 AM
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
Would it not be better to have a serverside script doing this, and updating an image file, which is just shown on clientside?
__________________
Reply With Quote
  #10  
Old 02-27-2008, 12:06 AM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
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?
__________________
-Neo
Reply With Quote
  #11  
Old 02-27-2008, 12:13 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #12  
Old 02-27-2008, 12:15 AM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
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?
__________________
-Neo
Reply With Quote
  #13  
Old 02-27-2008, 12:17 AM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
Quote:
Originally Posted by cbkbud View Post
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)
__________________
-Neo
Reply With Quote
  #14  
Old 02-27-2008, 12:20 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I've checked it, it's not working correcty on Mac/Linux either, will fix it with the next Graal version.
Reply With Quote
  #15  
Old 02-27-2008, 12:20 AM
vigilant_death2 vigilant_death2 is offline
Registered User
Join Date: Sep 2003
Location: n/a
Posts: 25
vigilant_death2 is on a distinguished road
Send a message via AIM to vigilant_death2 Send a message via Yahoo to vigilant_death2
Thanks a lot stefan I look forward to updating my mini map system
__________________
-Neo
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 06:31 AM.


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