Data Structures Extension

Justin

  • *
  • Posts: 4716
Oh I already know this is the best extension I've ever made. Just waiting for other people to catch on. ;)

Thanks, Innes.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

irock

  • *
  • Posts: 2891
I will no longer use this extension until the creator apologizes for being so cocky.

irock

  • *
  • Posts: 2891
Is this still being developed?

Justin

  • *
  • Posts: 4716
Been working on this one a lot over the past month and a half. Rewrote a  lot of it and cleaned up memory leaks. I've finally got it back into a stable enough state that it's usable. I still have yet to add some basic functionality, but there are some additions over the previous version that make it worth it to update now anyway.

[Download]

Structure Definitions can be created and deleted in-editor now.

When editing a Structure Definition, shortcuts are available to speed the process up:
ctrl f: create field
ctrl h: create header
ctrl t: create tabset/tab
ctrl k: create condition

Default values can be specified for all the basic types.

Filters can be applied to structure fields.

Potentially slightly less ugly GUI and other stuff.

This extension is open source now and is hosted at github. [Project Page] [Todo]

« Last Edit: December 02, 2014, 10:07:39 pm by Justin »
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

XerosXIII

  • *
  • Posts: 97
Just found out through DialogExtension and mind was blown, looks really useful for any data heavy games like RPG or so on. However I'm in need of manual or explanation on how the whole structure work :/

Justin

  • *
  • Posts: 4716
Oh thank goodness. I was beginning to think that my ploy to raise extension awareness by bundling it with the dialog extension had failed.


I think it's pretty simple and you should be able to figure some things out by playing with it.

Start by creating a structure definition (the button at the top left opens a window where you can create new structure definitions). Add some fields to it, mess around with the fields properties and you can see what settings are available for the different field types.

Then close the definitions window and you can create structures with that definition. I totally forget what blocks are currently available for accessing your structures in Design Mode... but they're there. If not, it's similar to the screenshots in the first post.

That's just a really rough around the edges general pointer to get started that may or may not have actually answered anything... but feel free to ask if you have more questions!
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

XerosXIII

  • *
  • Posts: 97
hahaha, was exploring ways to make an turn based battle and came across this through dialog ext

I think I got some rough idea how the fields works, but not really sure how to implement it. I tried getting 'name' from a 'unit' with the blocks it came with it, but it draw "null".

mind give some explanation on how the blocks works?

Justin

  • *
  • Posts: 4716
There are two versions of the "get [ ] from [ ]" block. One of them takes a text attribute for the structure, another takes anything.

For the text one, the above screenshot should be correct.

For the anything one, you would need to use it with an attribute.

Create attribute (type: Anything).
set attribute to [get data with name: unit_knight]
get [name] from [attribute]

edit:
Oh, and make sure that when you use the name of a field in design mode (such as your "Name" field), you type what the field name is, not the label. You're using a lowercase n, so you're likely already doing this, but I thought I'd mention it.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

XerosXIII

  • *
  • Posts: 97
Quote
Unit:  Redefinition of variable name in subclass is not allowed
   line: 35
   columns: 8-24
got hit with this error either by text or anything block, any idea what is it?

Justin

  • *
  • Posts: 4716
Oh, name is actually already used internally. Whatever the name is in the tree to the left (in your case "unit_knight") will be a name variable in the generated class. You can still have your own name variable if you want (just don't use "name" as the field name), or you can use the structure tree to the left for naming and you can access that in the same way: [get [name] from [object]].
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

XerosXIII

  • *
  • Posts: 97
ah, that explains, got it working and manage to work after change "name" to "unit_name" :)

Derelikt

  • Posts: 92
Hi,

Got this crash today, running latest nightly build. (screenshot of the crash attached as well as logs)
Here's the error message:
Code: [Select]
Error in toolset extension Data Structures Extension on thread AWT-EventQueue-0: stencyl.sw.editors.snippet.designer.Definitions.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
stencyl.sw.app.ExtensionException: stencyl.sw.editors.snippet.designer.Definitions.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
at stencyl.sw.actions.Actions.gameOpened(Actions.java:838)
at stencyl.sw.app.tasks.OpenGameTask$3.run(OpenGameTask.java:221)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodError: stencyl.sw.editors.snippet.designer.Definitions.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
at stencyl.ext.polydes.datastruct.Blocks.addDesignModeBlocks(Blocks.java:48)
at stencyl.ext.polydes.datastruct.Main.onGameOpened(Main.java:221)
at stencyl.sw.actions.Actions.gameOpened(Actions.java:832)
... 15 more

Justin

  • *
  • Posts: 4716
Thanks. I had to rebuild the extension to pick up a changed method signature.

https://dl.dropboxusercontent.com/u/9458929/Extensions/DataStructuresExtension.jar

Dunno if this needs to be updated, but just to be safe:
https://dl.dropboxusercontent.com/u/9458929/Extensions/DialogExtension.jar
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

Derelikt

  • Posts: 92
Did a quick run, works great. Thanks, Justin!

stefan

  • *
  • Posts: 2263
Another great extensions =)