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

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: DAME - a new map editor made using flixel!
« Reply #240 on: Fri, Nov 12, 2010 »
Question:

I am trying to set up a sprite of an enemy which needs the player passed in as one of the parameters. The player is instantiated in DAME. How can I take that instance of the player sprite and pass it into the enemy via the enemy's constructor text?

E.g. new Enemy(%xpos%, %ypos%, %thisplayer:Player%)

Also, is there a way to pass in map layers?
« Last Edit: Fri, Nov 12, 2010 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

Nejuf

  • Member
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #241 on: Fri, Nov 12, 2010 »
The latest version has been working great for me, except sometimes saving seems to quit working.  I've tried ctrl+s, save, and save-as, but the saving only works when I do save-as and save it as a new file (just doing save-as and saying it is okay to overwrite the current file doesn't work).  The reason I know it is not saving is because of the counter at the bottom and closing DAME and opening the file shows that the saving didn't happen.  It happens regardless of whether or not Flashdevelop is running.

*Doesn't seem to be an all-the-time thing.

I also found out that sometimes, the file error window while trying to export can be so big that I cannot close it.  I can't do anything in the editor while that error window is open, so I have to close the program.  :-\
« Last Edit: Sat, Nov 13, 2010 by Nejuf »

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #242 on: Sat, Nov 13, 2010 »
I'm having issues editing layer info in this latest patch.
When I make changes, they aren't saving.
I'll have the bug fix in the next update. Looks like it's the changes to tile width and height that aren't updating.

...sometimes, the file error window while trying to export can be so big that I cannot close it.  I can't do anything in the editor while that error window is open, so I have to close the program.  :-\
I'll add a limit to the size of error windows in the next version.

The latest version has been working great for me, except sometimes saving seems to quit working.  I've tried ctrl+s, save, and save-as, but the saving only works when I do save-as and save it as a new file (just doing save-as and saying it is okay to overwrite the current file doesn't work).
This is worrying... I'll PM you with some questions to track this one down.

Question:

I am trying to set up a sprite of an enemy which needs the player passed in as one of the parameters. The player is instantiated in DAME. How can I take that instance of the player sprite and pass it into the enemy via the enemy's constructor text?

E.g. new Enemy(%xpos%, %ypos%, %thisplayer:Player%)

Also, is there a way to pass in map layers?
To do anything this complex you would really need to write your own custom exporter. It could be simple enough to create a modified version of the existing exporter with extra functionality that is dependant on your setup. Otherwise, if you'd rather stick with the sample exporters, then I recommend your Enemies just ask the PlayState for the player and the map layers. You could also pass in the map layer name as a property, so if you add a string property called map then %prop:map% should output whatever you have for that sprite.
But I personally recommend creating a custom exporter in this instance.

NateTheGreatt

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
  • smell the sound
    • View Profile
    • n8bit
Re: DAME - a new map editor made using flixel!
« Reply #243 on: Sat, Nov 13, 2010 »
To do anything this complex you would really need to write your own custom exporter. It could be simple enough to create a modified version of the existing exporter with extra functionality that is dependant on your setup. Otherwise, if you'd rather stick with the sample exporters, then I recommend your Enemies just ask the PlayState for the player and the map layers. You could also pass in the map layer name as a property, so if you add a string property called map then %prop:map% should output whatever you have for that sprite.
But I personally recommend creating a custom exporter in this instance.

It makes me very sad that I just now found out that you could simply ask the playstate for the instantiations... On the bright side I learned something extremely valuable and now understand static variables!  :D

I have a couple more questions:

What are the Layer Properties for? Is it possible to use them to set a tilemap layer's collideBottom to false?

Also, can I pass a simple string into the necessary parameters of my enemy sprite via constructor text?
« Last Edit: Sat, Nov 13, 2010 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

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #244 on: Sat, Nov 13, 2010 »
Layer properties are for whatever you want :)

But yes, you could use them to set the collideBottom of the layer to false if you wish.

You should be able to pass a string into the params via constructor text. If your string is called str then you would just put "%prop:str%" into the constructor text.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #245 on: Sat, Nov 13, 2010 »
A new version is up:

  • Added bookmarks in View menu, to allow you to quickly move to specific locations.
  • Limited size of Error windows.
  • Fixed bug where it was impossible to change tile height and tile width in maps.

boogaga

  • Member
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
    • Fun Pixel Games
Re: DAME - a new map editor made using flixel!
« Reply #246 on: Sat, Nov 13, 2010 »
Your editor seems very interesting, but I encountered a problem: I downloaded flixel sample and then tried to export SimpleClaws level, but DAME did not generate code in level file, I've got only
Code: [Select]
public class Level_Level1 extends BaseLevel
{
//Embedded media...

//Tilemaps

//Sprites


public function Level_Level1(addToStage:Boolean = true, onAddSpritesCallback:Function = null)
{
// Generate maps.

//Add layers to the master group in correct order.


if ( addToStage )
{
FlxG.state.add(masterLayer);
}

mainLayer = layerLayer1;

boundsMinX = 9999999;
boundsMinY = 9999999;
boundsMaxX = -9999999;
boundsMaxY = -9999999;

}


}
Maybe I just did something wrong, but I don't know what it is.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #247 on: Sat, Nov 13, 2010 »
Hi Boogaga,

Please send me the full output log at the bottom of the export window so I can see what is wrong.
Thanks

boogaga

  • Member
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
    • Fun Pixel Games
Re: DAME - a new map editor made using flixel!
« Reply #248 on: Sat, Nov 13, 2010 »
Actually, I found additional problems: when I try to open early created file, I don't see layers, only file name and nothing else. I attached screenshot: http://i.imgur.com/C7Lw0.png
This project file contain only one layer with tiles and no sprites.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #249 on: Sat, Nov 13, 2010 »
I'm not at all sure what's going on there, Boogaga. I'd say the best solution is to PM me with a zip containing the .dam file and the sprites to see what's going wrong. It could be Mac specific or it could be something specific to the project setup.
Feel free to just give me low-res versions of the sprites if you're worried about giving them out. They can even be single colour images, as long as they're the correct dimensions and filename.

boogaga

  • Member
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
    • Fun Pixel Games
Re: DAME - a new map editor made using flixel!
« Reply #250 on: Sun, Nov 14, 2010 »
I've checked again: after opening file I added new layer with tiles, and managed to save it. So it seems that file just was not saved (but I checked the time of last changes in file and it was at the time I saved file).
Maybe I should have rebooted computer after installation of update, I don't know. I will also check exporting again and write if I get any problems.
Edit: checked the exporting and it seems that now everything works fine. I get wrong level files only if I export map to the empty directory or to the directory without SImpleClaws PlayState file. As I understand, this is predictable way of working, am I right?
Please check Recent files menu item, for me it does not show anything after restarting of DAME.
« Last Edit: Sun, Nov 14, 2010 by boogaga »

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #251 on: Sun, Nov 14, 2010 »
New version released with one critical bug fix.

  • Fix a critical bug with Undo when painting tiles.
  • Fix first tile not being saved in 1 column high tilemaps.

3WG

  • Active Member
  • ***
  • Posts: 110
  • Karma: +0/-0
    • View Profile
    • Jeux.MU
Re: DAME - a new map editor made using flixel!
« Reply #252 on: Mon, Nov 15, 2010 »
Quote
One other possibility - maybe the saved coordinates of the tiles window got screwed up. What values for x, y, width and height do you have in your settings file in the tileWindow node in C:\Users\<USERNAME>\AppData\Roaming\DAME.dambots\Local Store\settings.xml
Maybe change them to something reasonable or delete the settings file before you restart DAME to see if that fixes it?


It works for me . Thanks

Another question ...

How can i set the exporter to use LevelName as file structure for the CSV files actually based on the same template i need to export every level with the same Base Class, and just LevelClass that changes and CSV files named like the "LEVEL NAME"

Any solution ?
Flash games are FUN !
Jeux.MU

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #253 on: Mon, Nov 15, 2010 »
I would suggest using complexClaws sample as a template where each group is effectively a level, and using the flixelComplex exporter for that. There's still a base class, but each group will be exported as its own level class.
Either that or writing your own custom exporter :)

Sparkky

  • Member
  • **
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #254 on: Tue, Nov 16, 2010 »
Is there a way to create a new level and keep the Sprites from another level?
Would be really handy when making multiple levels when you have a large selection of sprites

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #255 on: Tue, Nov 16, 2010 »
I assume you mean having one sprite layer but sharing it for multiple levels all within the same DAM file?

For that you would definitely need to write your own custom exporter. But it is possible. The custom exporter system basically allows you to decide how to arrange your data and how to interpret it.

Sparkky

  • Member
  • **
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #256 on: Wed, Nov 17, 2010 »
No, but let me try to clarify.

In the game we're using the editor for, we end up with upwards of 15 layers and many groups to keep things organized.
In the sprite panel we also have about 80+ Sprites.

For each level we would have to re-import all the sprites to my understanding. Which is frustrating if there is many custom arguments.
What would be nice is the ability to create a new Set of layers or "level" without redoing all the imports.

Using multiple groups is annoying because we already use the multiple groups for organizational purposes on the maps.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #257 on: Wed, Nov 17, 2010 »
I'm not sure I fully understand the problem or what you're asking for here.

When you talk of creating a new level, do you mean in the same .dam file or a new one? (ie one level per file or many per file). It sounds like you are using one file per level.

If it's one file per level, then you have a main menu option. File->Import. That should import everything in one go that you need, depending on what options you select. If it's not then tell me what is needed.

If all levels are within the same file, this is easily done by just right clicking on the layer or group and selecting Duplicate or Duplicate Empty. You can then drag the layer around/reorginise it as usual and it should be a complete duplicate of the original layer.

If you are talking about having a sprite layer that is shared for multiple levels, then that is definitely something that is more for a custom exporter, as the concept of levels is not something that the editor understands, only the exporters.

Sparkky

  • Member
  • **
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #258 on: Wed, Nov 17, 2010 »
Didn't notice the import function.
That looks like it will do everything I need.
Thanks.

Placeable

  • Member
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #259 on: Sun, Nov 21, 2010 »
This editor is great and in my opinion the best one out there. I have tried quite a few editors but none that fit my liking until I came across DAME. 

I made my own LUA code for the exporter and can now create NPCs (with their own unique dialog, name etc), Transitions (linked to other areas and their transitions), Treasures (z0mg with random or fixed loot), Custom Events (this one got messy with spaghetti code :)) with the Editor!

Thanks a bunch creator I love you and then some.