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 08-28-2011, 06:38 PM
Maelstrom002 Maelstrom002 is offline
Registered User
Join Date: Aug 2011
Location: Canada, MB
Posts: 5
Maelstrom002 is on a distinguished road
Online showpoly() Creator

Hi everyone,

I got tired of grabbing x&y information off of editor to create some of the
more complex showpolys() I was making, and decided to toy around
and make something that could do it for me.

The script displays a single tile sized poly where your mouse is, and upon left click will place a poly representing the node you've created. As you continue placing nodes the showpoly that it will eventually print out will be displayed as you make it so you can see what the final product will result in.
When placing nodes it will also determine if the form is of an corner and adjust to the proper x&y coords, which is why I used two sets of values & arrays.

Once you right click it will end your ability to place nodes, and print out the array in the F2 Logs.

( The one thing I was unable to fix is that to finish off the poly nicely,
you'll need to place a node on the same spot as your first node, otherwise
it wont correct the corner because not enough nodes have been placed
for it to determine its an inside corner, however depending on the shape of the poly, you may not even run into this issue.

I also suggest starting from the top-left corner of your poly shape. )

Any feedback is appreciated!
Attached Thumbnails
Click image for larger version

Name:	polycreator_1.png
Views:	334
Size:	108.3 KB
ID:	53582   Click image for larger version

Name:	polycreator_2.png
Views:	276
Size:	62.5 KB
ID:	53583  
Attached Files
File Type: txt PolyCreator.txt (8.2 KB, 254 views)
Reply With Quote
  #2  
Old 08-28-2011, 06:40 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
rep+++
When I can of course.
__________________
Reply With Quote
  #3  
Old 08-28-2011, 06:45 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 does what it sets out to do but it's specific position. Might be beneficial to generate a showpoly based on your first coordinate (see example), support for pixels might also help too, and a way to set the rotationcenter wouldn't hurt.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
with (findimg(200)) {
    
30// Changing these would change the location of your polygon
    
30// while maintaining the same shape.
    
polygon = {
      
xy33// and so on...
    
}; 
  }

__________________
Quote:
Reply With Quote
  #4  
Old 08-28-2011, 06:48 PM
Maelstrom002 Maelstrom002 is offline
Registered User
Join Date: Aug 2011
Location: Canada, MB
Posts: 5
Maelstrom002 is on a distinguished road
Ah yea, I didn't even think of that. I was using it for specific locations to put the showpoly over vs. just generating generic showpolys.

I'll play around with that idea and perhaps update what I've put out!
Reply With Quote
  #5  
Old 08-28-2011, 07:16 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
How often do you use showpoly =o
__________________
Reply With Quote
  #6  
Old 08-28-2011, 07:47 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by xAndrewx View Post
How often do you use showpoly =o
It bloody helped me that's for sure.
__________________
Reply With Quote
  #7  
Old 08-28-2011, 08:01 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
What do you use it for- i've not had to use it yet =[
__________________
Reply With Quote
  #8  
Old 08-28-2011, 08:07 PM
Maelstrom002 Maelstrom002 is offline
Registered User
Join Date: Aug 2011
Location: Canada, MB
Posts: 5
Maelstrom002 is on a distinguished road
I've been using showpoly as roof tiles, vs creating images for each roof.
Reply With Quote
  #9  
Old 08-28-2011, 08:32 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
http://forums.graalonline.com/forums...tshape2+editor easy way to make images if you're concerned about it taking forever to make a bunch of different images with tiles.
Reply With Quote
  #10  
Old 09-09-2011, 12:37 AM
furry_mougle furry_mougle is offline
big heart
furry_mougle's Avatar
Join Date: Aug 2011
Posts: 42
furry_mougle is an unknown quantity at this point
why do people always use the term node in the wrong context

EDIT: nvm, I guess it was used somewhat correctly
__________________
Quote:
Originally Posted by ffcmike View Post
But make sure to change beer.png to Orange Juice.
pay bills to play graal

Last edited by furry_mougle; 09-09-2011 at 03:00 AM..
Reply With Quote
  #11  
Old 09-09-2011, 12:42 AM
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
Quote:
Originally Posted by furry_mougle View Post
why do people always use the term node in the wrong context
They always do?
__________________
Reply With Quote
  #12  
Old 09-09-2011, 12:45 AM
furry_mougle furry_mougle is offline
big heart
furry_mougle's Avatar
Join Date: Aug 2011
Posts: 42
furry_mougle is an unknown quantity at this point
Quote:
Originally Posted by Crow View Post
They always do?
generalization, but it's just a little pet peeve of mine

"1. A point at which lines or pathways intersect or branch; a central or connecting point.
2. A piece of equipment, such as a PC or peripheral, attached to a network."

i can't find the definition that states a node is a packet of information
__________________
Quote:
Originally Posted by ffcmike View Post
But make sure to change beer.png to Orange Juice.
pay bills to play graal
Reply With Quote
  #13  
Old 09-09-2011, 12:59 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
Quote:
Originally Posted by furry_mougle View Post
i can't find the definition that states a node is a packet of information
The script above vaguely fits the definition you post. It's a point of data in a large connected set... though it's not a tree so it doesn't fit it perfectly. It fits it better than your labeling it as simply a "packet of information."

I'll also go ahead and say I saw your post before you edited in which you posted "What's a node?" Given that you posted the definition from a dictionary and now accusing people of using the term wrongly I'll go ahead and say you're not really in the position to argue it.
Reply With Quote
  #14  
Old 09-09-2011, 02:57 AM
furry_mougle furry_mougle is offline
big heart
furry_mougle's Avatar
Join Date: Aug 2011
Posts: 42
furry_mougle is an unknown quantity at this point
Quote:
Originally Posted by DustyPorViva View Post
The script above vaguely fits the definition you post. It's a point of data in a large connected set... though it's not a tree so it doesn't fit it perfectly. It fits it better than your labeling it as simply a "packet of information."

I'll also go ahead and say I saw your post before you edited in which you posted "What's a node?" Given that you posted the definition from a dictionary and now accusing people of using the term wrongly I'll go ahead and say you're not really in the position to argue it.
Cool, thanks! you learn something everyday!
__________________
Quote:
Originally Posted by ffcmike View Post
But make sure to change beer.png to Orange Juice.
pay bills to play graal
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 12:00 PM.


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