Author Topic: DAME - a new map editor made using flixel!  (Read 219462 times)

Titch

  • Contributor
  • ****
  • Posts: 270
  • Karma: +0/-0
  • Thing with the guy in the place.
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #380 on: Wed, Mar 2, 2011 »
Well you could probably modify the export script so that it exports groups as separate levels. I did this for a project I'm working on so I could keep multi-part levels all grouped together in one .dam file, but my export script uses XML as it's output rather than the Flixel exporter.
Free cake whippings every day at #flixel on irc.freenode.net.

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: DAME - a new map editor made using flixel!
« Reply #381 on: Thu, Mar 3, 2011 »
Quick question: For different levels of my game, do I have to make a new .dam file? Or am I missing something that lets me make different levels in one DAME file, perhaps?

The game I'm working on at the moment has 60 levels all in one DAME file. I just use a new Map each time in dame, so my left-hand panel has lots of maps in. Actually they are grouped, 10 levels per group, but same end result :)
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: DAME - a new map editor made using flixel!
« Reply #382 on: Thu, Mar 3, 2011 »
Quick question: For different levels of my game, do I have to make a new .dam file? Or am I missing something that lets me make different levels in one DAME file, perhaps?

The game I'm working on at the moment has 60 levels all in one DAME file. I just use a new Map each time in dame, so my left-hand panel has lots of maps in. Actually they are grouped, 10 levels per group, but same end result :)

I tried doing that, but I realized that it exports information for every group in the level class. Doesn't that make your level class very cluttered? Or is that only preventable by doing what Titch said, and having the custom exporter take care of that?

I don't feel I'm experienced enough to have it do that xD
« Last Edit: Thu, Mar 3, 2011 by NateTheGreatt »
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
-Antoine de Saint-Exupery

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: DAME - a new map editor made using flixel!
« Reply #383 on: Thu, Mar 3, 2011 »
Sure, the lua scripts are really easy to use.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: DAME - a new map editor made using flixel!
« Reply #384 on: Thu, Mar 3, 2011 »
Sure, the lua scripts are really easy to use.

I've written my own exporter but only one with very simple modifications to the default one. I'll take up the challenge, though.

Is there a way to detect in the exporter LUA if a group is visible or not? That way the un-checked (not visible) groups will not be exported.
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
-Antoine de Saint-Exupery

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: DAME - a new map editor made using flixel!
« Reply #385 on: Thu, Mar 3, 2011 »
Groups can have "Export" set on them directly - just tick the box (or not!). I don't recall if setting the group itself to not export excludes its contents however. Should be quick enough for you to experiment and find out :)
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: DAME - a new map editor made using flixel!
« Reply #386 on: Thu, Mar 3, 2011 »
Groups can have "Export" set on them directly - just tick the box (or not!). I don't recall if setting the group itself to not export excludes its contents however. Should be quick enough for you to experiment and find out :)

I unchecked the groups, but they were still exported... D:
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
-Antoine de Saint-Exupery

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #387 on: Fri, Mar 4, 2011 »
I unchecked the groups, but they were still exported... D:

Can you confirm that you unchecked the correct box? I just looked at the code and tried it to be sure and the export does indeed ignore any groups if they are unchecked for export.

You need to uncheck the tick for Export (which is in the Group properties underneath the layers tab). I'm guessing that you might have actually just ticked the box next to the group itself, which controls group visibility.

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: DAME - a new map editor made using flixel!
« Reply #388 on: Sat, Mar 5, 2011 »
I unchecked the groups, but they were still exported... D:

Can you confirm that you unchecked the correct box? I just looked at the code and tried it to be sure and the export does indeed ignore any groups if they are unchecked for export.

You need to uncheck the tick for Export (which is in the Group properties underneath the layers tab). I'm guessing that you might have actually just ticked the box next to the group itself, which controls group visibility.

Oh, I'm an idiot.

Thank you.
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."
-Antoine de Saint-Exupery

Backward pieS

  • Active Member
  • ***
  • Posts: 110
  • Karma: +0/-0
    • View Profile
    • Backward pieS, LLC
Re: DAME - a new map editor made using flixel!
« Reply #389 on: Tue, Mar 8, 2011 »
I have a question about paths in DAME...

When I make a closed, curved spline and attach an object to it, I'm not getting any movement in my game. The code in the Platform class in Complex Claws works fine with linear paths, but looking at it I don't see anything in there to handle the tangents of curved paths(correct?).

DAME obviously is capable of keeping a sprite on a curved path since it does so perfectly when I drag an attached sprite in the editor - Xander, do you have a tangent-ready code block I can use to replace the original platform movement code?

Or if I missed something simple, that would be cool, too. :)

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #390 on: Tue, Mar 8, 2011 »
Hi Bonemonkey.

One of the reasons I don't include any bezier movement code with the sample exporters is because curve movement is a lot more open to interpretation than linear movement, for example should it accelerate based on slope; should it move at a constant speed or constantly through each segment...

But I can provide you with the very basic code that you can find anywhere on the internet, and this is the code I use, that returns the position on a curve given a t value (0-1) for that segment and the anchors and tangents for that segment:

Code: [Select]
public function GetPositionOnBezierSegment(t:Number, Anchor1:FlxPoint, Control1:FlxPoint, Control2:FlxPoint, Anchor2:FlxPoint, Out:FlxPoint = null):FlxPoint
{
var square:Number = t * t;
var cube:Number = t*t*t;
var inv:Number = 1 - t;
var inverseSquare:Number = inv * inv;
var inverseCube:Number = inv * inv * inv;

Out.x = (inverseCube* Anchor1.x) + (3 * t * inverseSquare* Control1.x) + (3 * square * inv * Control2.x) + (cube * Anchor2.x);
Out.y = (inverseCube* Anchor1.y) + (3 * t * inverseSquare* Control1.y) + (3 * square * inv * Control2.y) + (cube * Anchor2.y);
return Out;
}

With that, then all you need to do is provide the right t value and track which segment you're on.

klembot

  • Member
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #391 on: Tue, Mar 8, 2011 »
It'd be nifty if there could be a preview of the game screen -- i.e. I edit in a fullscreen DAME window, but my game is in a 640x480 window. It'd be handy to be able to tell what will be visible to the player from a given point in a level. I think I could fake it by resizing the window carefully and toggling to maximized, but it's a little fiddly to do so.

I'm thinking something similar to how Photoshop darkens the area around a crop, only it would move with the cursor.
I will never reveal the twofold secret.

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: DAME - a new map editor made using flixel!
« Reply #392 on: Wed, Mar 9, 2011 »
klembot - it can do this (I asked for it several versions ago!) - look for the game size in the colour settings or somewhere, but it's in there!
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

Backward pieS

  • Active Member
  • ***
  • Posts: 110
  • Karma: +0/-0
    • View Profile
    • Backward pieS, LLC
Re: DAME - a new map editor made using flixel!
« Reply #393 on: Wed, Mar 9, 2011 »
Thanks for the curve movement code block, Xander. It isn't quite as intimidating as I'd feared it would be (he foolishly says before trying to implement it!).

Venks

  • Member
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #394 on: Sat, Mar 12, 2011 »
Anyone else having this problem? I can't save. Using save or save as seems to work. Save as will even prompt me asking if I'm sure I want to overwrite the project that already exists. I'll say yes, but when I go to close DAME it asks if I want to save my changes. If I say yes, nothing happens. It only closes if I choose no.
I can't even save something by naming it something new.

Edit: Even tried uninstalling/reinstalling, but same problem.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #395 on: Sat, Mar 12, 2011 »
Anyone else having this problem? I can't save. Using save or save as seems to work. Save as will even prompt me asking if I'm sure I want to overwrite the project that already exists. I'll say yes, but when I go to close DAME it asks if I want to save my changes. If I say yes, nothing happens. It only closes if I choose no.
I can't even save something by naming it something new.

Edit: Even tried uninstalling/reinstalling, but same problem.
Hmmm... does this happen if you start a new project? If it doesn't then there's probably something corrupt in that file. Perhaps if you restore your last project backup file (just remove the .bak - also perhaps name it something else for good measure) and try from there? Also make sure the file hasn't been somehow changed to read only.

Venks

  • Member
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #396 on: Sat, Mar 12, 2011 »
Hmmm... does this happen if you start a new project? If it doesn't then there's probably something corrupt in that file. Perhaps if you restore your last project backup file (just remove the .bak - also perhaps name it something else for good measure) and try from there? Also make sure the file hasn't been somehow changed to read only.

Seems I can start new projects just fine. Can save and seem to have no errors. The three projects I'm currently using for my game are apparently all corrupt and so are the backup files. ^^;
I have no idea how that happened. Well I'm gonna look at the old projects because I can still see everything fine and just completely re-tile them one by one into new projects. Hopefully those don't get corrupt. ><

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #397 on: Sun, Mar 13, 2011 »
If you can send me any of the corrupt files I can look into it.

Venks

  • Member
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #398 on: Sun, Mar 13, 2011 »
Your email is hidden from me on your profile so I just uploaded it:
http://www.mediafire.com/?35sbxucd652fizs

I can't edit the sprite map locations and include it so you can see them, due to that whole not being able to save thing. But yeah if you try to add anything you should get the same error of not being able to save.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #399 on: Mon, Mar 14, 2011 »
Thanks. I looked into it and I can provide a fix in the next version, later in the week.

It looked like it was caused by some sprites that were somehow associated to a missing sprite entry. I don't know what caused that but I can make sure that it will let you save correctly in that case.