Jump to content


Photo
- - - - -

Easy, Fast, Advanced Level Editor - Fixed


  • Please log in to reply
57 replies to this topic

#1 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 14 March 2009 - 06:08 AM

  • Title: Easy, Fast, Advanced Level Editor (2D)
  • Description: Adding a level editor is now made easy
  • GM Version: Game Maker 7
  • Registered: Yes, needs Pro
  • File Type: .Zip (contains 2 files, an example and the scripts)
  • File Size: Approx 129KB
  • File Link: Download (Host-a-net)
  • Check out my latest project: GameDev Studio
Additional Info
This has taken me some time to make, and all the scripts have a description of what they do at the top. If you have any questions or comments please post them. There are only a few scripts that are needed, and lots of other ones that can just help. Includes...


--ALL BUGS HAVE BEEN FIXED (AND CHECKED)--
The level editor contains the main following scripts
Grid:
-Changing color
-Changing Space in between (X and Y)
-Set grid visible/invisible
-Align to gird

Objects
-Place and Remove objects with the mouse (no limit)
-Clear all objects from the level
-Set a limit to the amount of objects allowed (1 player etc) AND change how it deals with it if there are too many
-Change an objects direction
-Allow objects to be overlapped/not overlapped
-Make a map only savable IF there is a certain amount of objects
-Randomly place X amount of objects in the room
-Border the room with objects
-Variable support! Objects can have variables such as hp, and they can be changed in the editor (they are saved too)
-Add code to objects (program it in the editor!) - gets saved and actually works! DOES NOT USE EXECUTE STRING, it uses object_event_add()

Tiles
-Place and remove tiles
-Depth Support
-Clear the room of tiles
-Set tile overlap
-Set a tiles Alpha
-Clear all tiles on a depth layer
-Change the background (make visible or not)
-Set the background speed (X and Y)

Saving and Loading
-Save the map you have made
-Load the map you have made into the editor
-Load the map you have made into the game



Screenshot:
Posted Image <--- Click to Enlarge


Hope some people learn from this (that's what it is here for!) - Enjoy
~~Brett14;

PS - I have been requested to just let users know that this uses both execute_file(), and object_event_add(). There is no need to worry though, because execute_file() is only called once to load the main map data, and from there on it uses object_event_add(), which is a much faster function.

Edited by brett14, 14 March 2012 - 03:58 AM.

  • 0

#2 Dylijn

Dylijn

    GMC Member

  • New Member
  • 553 posts

Posted 25 March 2009 - 04:13 PM

Really nice features you have there, I cant try it out now but I surelly will :)
  • 0

#3 artingames

artingames

    GMC Member

  • New Member
  • 16 posts

Posted 25 March 2009 - 06:55 PM

It's really good:10/10 as it is a very good example. You can do a great deal with it.
  • 0

#4 nick1965

nick1965

    GMC Member

  • New Member
  • 88 posts

Posted 26 March 2009 - 12:02 AM

Hey, nice map editor, I built a similar one with less features before, and have one now that does code in the level too. Some problems with this are (and I have these problems too, maybe we can work together to fix them): (a) for triggers/code, you have to use execute_string in the step event, lets say to check if the player has 100 gold. Many people think this is laggy, and it probably is. However, using it in the create event to place objects is very smart, thats how mine was built, this does not lag because it is only used once. I am thinking maybe have some create event arrays that are used to run scripts already in the game, to fix this possible lag problem. (B) encryption. this needs to be encrypted, mine was but not very strongly, it could have been broken in 1 minute. you should use a 10-bit + encryption script from the scripts forum, as that takes one computer something like 1 billion hours to crack. © menus for picking stuff. I noticed how the menu comes up when u click the obj select, etc. My old engine did that too, and I couldn't find a better way, there has got to be a way, maybe use a folder tree with objects in it, idk.

Btw, excellent engine, very good otherwise.

Cya,
~Nick~
  • 0

#5 daman123125

daman123125

    AZN Game Programmer

  • GMC Member
  • 1955 posts
  • Version:GM8

Posted 26 March 2009 - 01:20 AM

Darn, it's hosted on Host-A, and my internet browsers can't download files from Host-A(just shows a blank html page when I click download).
Oh well. I really wanted to see what this was like.
  • 0

#6 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 27 March 2009 - 04:42 AM

Nick,

Yes, I could have encrypted it... But it does what it is supposed to do. Security can be the users making... Maybe ultracrypt or whatever. It uses execute string ONCE in the create event (then never again)... Dont know wat ur talking about in the step event...
  • 0

#7 nick1965

nick1965

    GMC Member

  • New Member
  • 88 posts

Posted 28 March 2009 - 01:08 AM

You said that you can add code to objects right? That requires that each time an event happens with that object, that execute_string is used to run the code (or whatever the equivalent). If there is some code added to the step event, then this could cause some lag.

~Nick
  • 0

#8 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 28 March 2009 - 05:07 AM

You said that you can add code to objects right? That requires that each time an event happens with that object, that execute_string is used to run the code (or whatever the equivalent). If there is some code added to the step event, then this could cause some lag.

~Nick

Nope, no execute string or anything, in fact it is the equivalent to typing it in the code box. I used
object_event_add("CODE")
Which DOES NOT require any execute string, and is much faster. It is no slower than the normal code that you would type.

If you have never heard of that function, you should look it up in the manual... It's helpful for level editors :( - And any external code editor...
~~Brett14;
  • 0

#9 nick1965

nick1965

    GMC Member

  • New Member
  • 88 posts

Posted 28 March 2009 - 07:48 PM

I knew about that function, but I thought that it was the equivalent of execute_string. That's really good, cause I thought of this function, but wasn't sure. Tyvm lol. I needed this! XD

~Nick
  • 0

#10 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 29 March 2009 - 12:33 AM

Np, That is why its in the tutorial section :whistle: --- Any other questions?
  • 0

#11 Craig Davidson

Craig Davidson

    GMC Member

  • GMC Member
  • 121 posts

Posted 31 March 2009 - 04:34 AM

How can you modify it to use external backgrounds and objects, or INI files? I need help with this for my projects.
  • 0

#12 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 31 March 2009 - 04:52 AM

External backgrounds, you would use them the same way as normal backgrounds... I'll probably have to re-post an updated link with this b/c It is harder than it sounds. External objects - what do you mean by that? Saving their X/Y cords or the code inside of them?

or INI files?

Give me an example of what you are using it for and I'll tell you how. There are too many uses to answer the question with what you have given me...
  • 0

#13 Craig Davidson

Craig Davidson

    GMC Member

  • GMC Member
  • 121 posts

Posted 01 April 2009 - 12:02 AM

What I mean is Backgrounds in the form of bmp files, and objects read from data in INI files.
  • 0

#14 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 01 April 2009 - 02:07 AM

What I mean is Backgrounds in the form of bmp files, and objects read from data in INI files.

Backgrounds do this.
At the start of the game add them, and when you use them in the level editor use them the same way as normal and draw them the same way as normal.

External objects ARE NOT supported...
seriously though what is the point (I don't see why you would need them...) they load instantly (almost) in your game, and i bet 100 objects would load faster than one 512x512 background. Just use a normal object and use the engine like that. IF YOU WERE TO USE THEM the whole thing would need to be re-programmed, sorry. :)
  • 0

#15 Craig Davidson

Craig Davidson

    GMC Member

  • GMC Member
  • 121 posts

Posted 01 April 2009 - 04:46 AM

Can somebody tell me which code and actions to use to get external backgrounds into the game, based on your instructions? :)
  • 0

#16 Craig Davidson

Craig Davidson

    GMC Member

  • GMC Member
  • 121 posts

Posted 02 April 2009 - 11:49 PM

I am able to put in external backgrounds into the Editor section of the game, but am having terrible luck trying to get it read into the playable area of the game itself. I need help with the reading of the backgrounds into the playable area of the game. Please can somebody help me?
  • 0

#17 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 03 April 2009 - 05:13 AM

I'll add an example of this later, I don't have any time ATM, i gtg to bed.
  • 0

#18 mortalpico

mortalpico

    GMC Member

  • New Member
  • 556 posts

Posted 05 April 2009 - 01:38 AM

Very Nice man , this will be helpful for beginers(Not me , see my signature...)Keep it up!

~The Dark P.R.O
mortalpico
  • 0

#19 Craig Davidson

Craig Davidson

    GMC Member

  • GMC Member
  • 121 posts

Posted 06 April 2009 - 04:17 AM

Can someone tell me when said example from Brett14 is coming? (or at least will be ready?)
  • 0

#20 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 08 April 2009 - 04:03 AM

Sometime this weekend... I'm all busy with school and sports ATM.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users