Tokinsom's Forum Posts

  • Interesting concept. Sounds really confusing though!

    Actually I've already figured out tiles/collision tiles/triggers, and the like. I've got it set up so you can change their angles and size and everything. That was pretty easy. The problem I'm having here is with sprite objects and their private variables. I don't think your method would work for what I'm trying to do. One example is an enemy spawner; I need to be able to type the name of the enemy the spawner will create, or atleast choose it from a list. The data would have to be stored in a private variable. Another example is destructible tiles/objects. I need to tell that tile/object which particles to create when it's destroyed, what item(s) to drop, how many hits it takes to destroy, what sound to play when hit, etc.

    I REALLY don't feel like basing that stuff on things like the object's angle or animation frame or something, although it is possible.

  • Ok so this is something I've been trying to break down to a science for a while now, but I'm having some trouble.

    How would you guys go about managing objects in a custom level editor?

    I've come up with a couple ways of doing this, but man, it gets complicated and sloppy really fast.

    My ideal..system..of object management in a custom level editor would be very similar to how it's done in Construct's built-in layout editor.

    There would be a listbox with small icons and names which represent each object. When you click on one of these icons, another list to the right would show the selected object's PVs. You would then be able to adjust these values, set the object's properties (angle and such, which I've already figured out) and place it on the map.

    Sounds incredibly simple, no? Well it's not.

    I'll explain how I did this in my past level editors, and see what you guys think. Keep in mind none of these methods were very good, but if you have any suggestions on how to improve them or know some completely different and better way of doing this, I'd love to hear!

    1.

    -Objects were placed on a "table" in the layout editor, on a separate layer you can hide or reveal.

    -Each object was in the family "E_Objects", and had only 2 PVs: Name, and Value. I made the value "Name" because you can't retrieve an object's name yet, so this value was set to it.

    -There's a separate object called "ObjectValues" which stores an object's data when selected. It goes something like this: (I will refer to "ObjectValues" object as OV)

    -"E_Object" is selected from the table: Set "OV" value 'Name' to "E_Object's" value 'Name'

    -Now you can use a single edit box on the left to type in something for the Object's value called 'Value'

    -Now you can place the object like so..

    Left clicked on grid: Create object by name OV.value('Name')

    Set E_Object's value 'Value' to editbox.text

    So. That method is actually pretty simple, but since you can't retrieve an object's PV's, I could only find a way to edit ONE value before the object was placed. Also, the editbox caused a lot of problems. Once you click it, all of my hotkeys would be entered into the editbox, and using it's action 'unfocus' would lock up all keyboard/mouse input and pretty much ruin everything.

    2.

    Trying to explain this would make little sense, which probably means it was a terrible method to begin with. But on a glossy surface level, it worked like this:

    There's a list box which, when created, would list all of the object's names. You can click on a name, and a list object to the right brings up it's PVs which were added via the event editor. You can click on one of the PVs names, and type in it's value via an edit box. Upon pressing enter, the PV name would have the editbox text appended to it, delimited by a comma. I then used the text manipulator object to turn these into substrings, which can then be individually retrieved to set the object's values when placed.

    Actually that sounds pretty good. Problem is I haven't gotten it to work yet. I might in the future, but I'm already having some problems with it and I'm not so confident it'll work out in the end.

    To top it off I'm using an array to save the level data. Each cell has multiple values (object properties) which are essentially substrings retrieved by the text manipulator object. It just makes things so much more complicated.

    Anyhow. If anyone has gotten something like this to work, or has any ideas, please let me know!

    Thanks.

  • I made a topic on this a little while ago:

    R0jo uploaded a very nice example near the end. Maybe it can help!

  • The list BOX object doesn't have multi-line, but the list object does

    Anyway, the horizontal scroll bar is there, but it doesn't show up until an item on the list is longer than the width of the box. Also, the vertical bar doesn't show up until there are so many items in the box that they no longer fit.

  • Text objects change size in the layout editor when you zoom in or out. Maybe that's what's happening here? It's been fixed in C2, btw.

  • I'm using the following expression to get a 16x16 cursor to follow my mouse in a snap-to fashion...

    cursor.x= int(mousex/16)*16

    cursor.y= int(mousey/16)*16

    It works fine and all, but the cursor tends to 'drag' behind a good bit when quickly moving the mouse. Is there any way to fix that?

  • Probably. I always do this to 'turn off' effects as a lot of them glitch up get pasted into the bg or something, which gets really annoying.

    And yeah, that's Psy-Crow. He IS from earthworm jim

  • All you need to do is close every layout, then re-open them. All effects will then be 'turned off' in the layout editor.

  • Just use *

    e.g.

    object.value('my_val') * 1.5[/code:190wisyh]
    
    You can set the value or add to the value however you want.
  • Input system plugin, yo. It's magical.

  • Ok so it is the solid thing that is the problem. Can you not leave the enemies with the solid attribute on the whole time?

    The enemies and the player both use the platform behavior, so if I make them solids when they aren't frozen/deactivated, they will push the player around.

    Also, I'm making them solid when frozen so 1. They can be used as solid platforms and 2. so they don't hurt you.

    > Thought about that, but then it would also hurt any other enemies (namely ones that don't interact with solids) overlapping that solid object.

    >

    How about that: instead overlapping use x,y comparsion, e.g.

    -enemy is frozen -> create solid at enemy's XY, disable collision mask for enemy

    -solid recieves damage

    -enemy's XY equal solid's XY -> substract enemy's HP

    Worked pretty well when I tried it earlier, but it brought up another problem. My player is using a melee weapon, so if the solid is created over the enemy while the player is still attacking, it's instantly destroyed (along with the enemy). I tried implementing a sort of limit, so the solid could only be hit a short time after it was created, but it was kinda buggy.

    Thanks for the help so far. Time for more experimenting.

  • Thought about that, but then it would also hurt any other enemies (namely ones that don't interact with solids) overlapping that solid object. I could work around that by giving the solid object a value and setting it to the frozen enemy's UID, then comparing it so it only affects that enemy. Or I could use the object pairer..maybe even containers. Still..It just seems tacky. Guess I don't have a choice o.o

    edit: Yeah that's not working out so well.

  • I'm trying to add the ability to freeze enemies, deactivating all of their movements and turning them into solids, but add/remove attribute is all buggy and I'm having a hard time doing this.

    Instead of using add/remove attribute, I tried creating a solid object over the frozen enemy and changing it's size to that of the enemy's. Problem is, most of the enemies use the platform behavior and end up being 'pushed out' of the solid object even though it's platform behavior is deactivated (bug?). Setting the enemy's collision mode to 'none' will fix this, but you need to be able to attack it when it's frozen, so I can't do that.

    I thought of some other workarounds, but they don't seem like they would be very..stable.

    Any ideas?

  • I included an e-mail in the Minitroid Demo's readme for people to send bug reports. Seems a lot of people are getting the exact same crash/error, but I have no idea what's causing it.

    Runtime error

    (X) Failed to load plugin

    C:\Users\blah\AppData\Local\Temp\capD141.tmp\11.csx (126)

    It's funny because I tested it on like 8 different computers and it was fine. The *only* thing I'm aware of that would cause a crash is removing the controlconfig.cfg file that the input system plugin uses. I asked a few people and they said they hadn't touched any of the files, and controlconfig.cfg was right there.

    People have reported the same error with the control config I made, which is a separate application. I also find that strange, as the config doesn't load controlconfig.cfg, it only writes data in it.

    I have a feeling the input system plugin itself is causing the crashes. If I recall correctly it's not finished, so.

    Anyway, what do you think?

    Also, for some reason the music isn't playing for a very small number of people. It's loaded externally, simple as:

    +Start Of Layout

    -Create Xaudio2

    +Global('Song') = "Song1"

    +Trigger Once

    -Play Music From File: Apppath & "Music\Song1.mp3"

    Any idea what that's about?

    Thanks for any help.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You have 4 health bars and 4 rocket bars, right?

    Yeah, including the ones you start with. I was going to add a '% of items collected', as well as completion time, but I got kinda lazy near the end there