Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-25-2009, 09:37 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Clientside TDrawingPanel

Well I decided I would experiment with it today but I just can't get it to work.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
temp.panel = new TDrawingPanel();
  
temp.panel.setsize(getimgwidth(player.head), getimgheight(player.head));
  
temp.panel.drawimage(00player.head);
  
temp.panel.saveimage("test.png");
  
temp.panel.destroy();

The error.

GraalScript: Couldn't create object: type TDrawingPanel is not existing in script of Weapon Jerret/Debugger

Edit: I was able to find success with GuiDrawingPanel but I'm still curious as to why the above doesn't work.
__________________
Quote:
Reply With Quote
  #2  
Old 08-25-2009, 09:48 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Pretty sure Graal doesn't want you to create a TDrawingPanel out of nowhere. GuiDrawingPanel inherits TDrawingPanel anyway, so that should do.
Reply With Quote
  #3  
Old 08-25-2009, 09:58 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
It is possible to create it on serverside like that. But Stefan has yet to port those changes to the client.
__________________
Reply With Quote
  #4  
Old 08-25-2009, 10:32 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Well I finished experimenting and ended up making this nifty drawing function on the serverside.

PHP Code:
// Coded for Classic Bodies
function drawCharacter(obj) {
  
// Get Player Variables
  
temp.headimg obj.head;
  
temp.bodyimg obj.body;
  
temp.hatimg  obj.attr[1];
  
// Draw Player
  
temp.panel = new TDrawingPanel();
  
temp.panel.setsize(4864);
  
// Draw Body
  
temp.panel.drawimagerectangle(816+16temp.bodyimg6403232);
  
// Draw Head
  
temp.panel.drawimagerectangle(82+16temp.headimg032*23232);
  
// Draw Hat
  
temp.panel.drawimagerectangle(00temp.hatimg9604848);
  
// Save Image
  
temp.panel.saveimage("cartridge/test.png");
  
// Destroy Panel
  
temp.panel.destroy();

Only issue is the whole body colors thing.
__________________
Quote:
Reply With Quote
  #5  
Old 08-25-2009, 10:52 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by fowlplay4 View Post
Well I finished experimenting and ended up making this nifty drawing function on the serverside.

PHP Code:
// Coded for Classic Bodies
function drawCharacter(obj) {
  
// Get Player Variables
  
temp.headimg obj.head;
  
temp.bodyimg obj.body;
  
temp.hatimg  obj.attr[1];
  
// Draw Player
  
temp.panel = new TDrawingPanel();
  
temp.panel.setsize(4864);
  
// Draw Body
  
temp.panel.drawimagerectangle(816+16temp.bodyimg6403232);
  
// Draw Head
  
temp.panel.drawimagerectangle(82+16temp.headimg032*23232);
  
// Draw Hat
  
temp.panel.drawimagerectangle(00temp.hatimg9604848);
  
// Save Image
  
temp.panel.saveimage("cartridge/test.png");
  
// Destroy Panel
  
temp.panel.destroy();

Only issue is the whole body colors thing.
Cool.

I remember that the body color swapping was one of the biggest CPU hogs on Graal, and it probably uses some internal function to do it, so I doubt it would be able to replicate it properly/efficiently.
Reply With Quote
  #6  
Old 08-25-2009, 11:21 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
It'd be easy to do if there was some sort of replace color function for TDrawingPanel.

Also noticed that Clientside DrawingPanels (Well on the Windows client) don't save transparency while Serverside ones do.
__________________
Quote:
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 02:12 PM.


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