Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-09-2010, 08:09 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
SetShape2 Editor

I originally started this like 2 days ago because I wanted to use pics1 with terrain and couldn't figure out a way to do it so I decided to use GuiDrawingPanel and save the image that it rendered and just use that. That's when I found out what a hassle it was to do setshape2 for larger objects so I continued on making it and added support for any image size, I got a little carried away haha. I'm sure it could be scripted better but it was originally for personal use and it got the job done. Hopefully it will help people if for nothing more save time on creating setshape2 arrays. This is in no way done, I had a lot more things I was going to add to it but I just don't feel like putting anymore time into it because it pretty much has everything I could need.


This is how it works:
You can either put a Tile Array in the bottom left box and click load or goto file-> open and type an image on the server to open up.

If you plan on saving a setshape2 array that was created from a tile array you must first save the image however if you loaded the image you do not; all files are saved into "scriptfiles/servername/SetShapeEditor/imagename" so it doesn't get messy.

You can click the images on the right hand side of the gui to set the tiletype you want to set because I know how annoying it is to constantly go through a dropbox.


Thanks to dusty for his tile functions and to people who answered my questions in irc
Attached Thumbnails
Click image for larger version

Name:	SetShape2Editor-1.png
Views:	388
Size:	165.6 KB
ID:	50533   Click image for larger version

Name:	SetShape2Editor-2.png
Views:	379
Size:	169.4 KB
ID:	50534   Click image for larger version

Name:	SetShape2Editor-3.png
Views:	361
Size:	175.1 KB
ID:	50535   Click image for larger version

Name:	SetShape2Editor-4.png
Views:	360
Size:	176.3 KB
ID:	50536  
Attached Files
File Type: txt SetShape2Editor.txt (20.3 KB, 361 views)
Reply With Quote
  #2  
Old 03-09-2010, 09:31 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Not sure if you knew about Dusty's setshape2 generator? Could've probably saved you the hassle of making your own, but your version is a bit different so nice work anyway.
Reply With Quote
  #3  
Old 03-09-2010, 09:50 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
His was for tiles(i think?) mine was originally for creating images and creating a setshape2 for them.
Reply With Quote
  #4  
Old 03-09-2010, 10:33 AM
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
Mines was using tiles to generate it, but it churned out a script for using in an NPC.
Reply With Quote
  #5  
Old 03-20-2010, 02:02 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Hm. Just tried this out. It frequently froze Graal, at least on my laptop using Windows 7.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #6  
Old 03-20-2010, 05:05 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
yeah, I think it's because it's rendering the image clientside. It happens with bigger images. It beats copy and pasting tiles in paint though.
Reply With Quote
  #7  
Old 03-20-2010, 08:00 PM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by Cubical View Post
yeah, I think it's because it's rendering the image clientside. It happens with bigger images. It beats copy and pasting tiles in paint though.
Are you sure about that? I've seldom had problems loading even the largest of images in-game, but when the editor is opened and I load a large image, I experience most of the slowdown when I'm adding blocking tiles and other stuff. When I'm not adding anything, I can move the window around a bit with no slow response, but when the generated code is being updated, it goes very slowly.

I'm just wondering if the editor could be improved by simply having a 'generate code' button, instead of instant updates being shown in a small box, and if that would make any kind of difference.
Reply With Quote
  #8  
Old 03-20-2010, 10:22 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Well, it also depends on how fast you computer is when rendering the image. I have never had any lag when setting the shape of an image but I could add an option to automatically generate teh code and a button to. The main problem is rendering the image clientside when you are using a tile array. It's something with the GUIDrawingPanelCtrl. If someone could think of a way to render it clientside faster and would like to share that would be awesome because right now I'm clueless. I'd rather not have to render everything serverside because teh strain it would put on the server as well as not being able to save it clientside.
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 03:53 PM.


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