Farmrush's Recent Forum Activity

  • Else doesn't work 100% correctly yet (at least I don't think so, haven't tested it in the latest build), so I would avoid using it. Also, I wouldn't use 3 ORs in a single condition, there could be problems with it.

    Instead of using those ORs, just seperate each condition into there respective sub-event, and copy the action into each one. I know OR adds that ounce of neatness to the code, but I think there could be something wrong with using it like that, especially with the else condition at the end. Just program your own else condition with a variable as a workaround for now.

    But... but... my neatness...

    Edit: Hmm, I'm not sure what I did now.. but that doesn't seem to work either. I get the same result. Here is the .cap if anyone wants to look at it.

    http://pub.gamingw.net/39880/ProcGen.zip

  • I'm having trouble understanding exactly how the OR and ELSE features work in the event sheet editor. I've played around with them, but I'm apparently missing something and there is no wiki page I could find for it.

    I currently have: <img src="http://pub.gamingw.net/39880/orelse.jpg">

    As a quick rundown what this does is test whether the CurrentX or CurrentY is in the first column, first row, last column, or last row. I want to check to see if any of those conditions are met, and if so then perform [A] ELSE .

    Currently, however, it seems to just ignore that completely and only triggers the ELSE statement.

  • At least to me, using the Array object would make things clearer. Arrays have the For Each element condition you can use to cycle through them and do whatever you like. You can check the values with the Array.CurrentX and CurrentY expressions.

    So to make your map filled with walls, you'd use something like this:

    > For Each element -> Array: Set index (Array.CurrentX, Array.CurrentY) to 1
    [/code:13p4ykug]
    
    And to draw your tiles:
    [code:13p4ykug]
    For Each element
     -> Value at (Array.CurrentX, Array.CurrentY) equal to 1
     -> -> Create Wall at (Array.CurrentX * 32, Array.CurrentY * 32)
    
    [/code:13p4ykug]
    
    Note that Arrays range from 1 to whatever you specify in their properties.
    So there's no element [0,0] etc.
    
    Edit: Made a lil' example: [url]http://files.getdropbox.com/u/1496418/MapArray.cap[/url]
    

    I've actually already gone ahead and done that, although I've run into a problem. I seem to have a memory leak or infinite loop because it starts using up 500+mb of ram fairly quickly. Does the For Each event continue to run over and over?

    Also I tried looking at your example, but it said that it was made using a newer version (despite the fact I have the newest stable release).

    Edit: Using the Run Once condition for the For Each element condition seems to have stopped the memory usage from climbing leading me to believe my speculation about it continually running is correct. However I still notice that, despite the program isn't doing anything particular, CPU usage is 40% (E8200, 2.66Ghz Core2Duo) and it is using about 130mb of RAM (this is steady now that I have fixed the previous issue). These numbers seem very high considering it is idling.

    Edit2: *image removed, I changed the Sampling from Linear to Point and this dropped CPU usage to 5-6% and only 13mb of ram. When I change it back to Linear is uses a constant 40-50% CPU and 130mb of ram, again, despite the program not doing anything? This seems very odd. GPU is an 8800GT.

  • Does the LoopIndex start at 0 or 1? Thanks for the help, though, this did work.

    EDIT: I'm still playing around. I've set up a variable to be either 0 or 1 and I'd like to create either a Tile1 or Tile2 object depending, how do I do this within the loop?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alright, so I have some experience with procedural dungeon generators and I figured this would make an excellent starting point for a Construct project. My problem is I'm still learning the interface and I don't know a lot of the built-in variables. I'll update this thread with questions as they arise instead of making new ones, but for now let's handle it one at a time.

    I have two 32x32 tiles (to signify a wall and a floor) and I'm trying to fill the room with wall tiles to start. In the Event Sheet Editor I set a CurX and CurY variable, then I'm attempting to loop a number of times equal to the width and height of the room divided by 32. I can't figure out how to get the loop to run according to the size of the room. I've tried "Width / 32" as a parameter, but that didn't work.

    After I determine the width and height of the room, I will increase CurX or CurY accordingly and place a tile at CurX * 32, CurY * 32 for each iteration.

    EDIT: ehh, I made some progress using 'layoutwidth' and 'layoutheight' as the parameters for the number of iterations. I'm not sure if those are correct, though. I also cannot figure out how to nest the loops for the life of me.

  • Thanks. I'm still going over the logic. It is certainly a... bizarre solution... perhaps an idea for future updates, haha.

  • [quote:1qee0mpu]EDIT: Nevermind, I solved this while randomly clicking around.

    I hope you solved it by discovering that you could add the Mouse & Keyboard object, and using it's On Mouse Button Clicked condition.

    If not, that's how you do it

    Yes, I did. But! But! I have another question. How can I stop the click from 'piercing' objects. In my game I am randomly spawning asteroids and if I click while one is ontop of the other it destroys both, whereas I'd prefer these to require separate clicks.

  • Hello. First post (obviously). I've been using GameMaker for some time and am now learning Construct because I like the flexibility with things such as particles, image distortion, etc. I also have some background in Python already, so it seemed like a logical extension. However, I've run into a rather simple problem. In the event editor I cannot seem to find any 'On Left Click' events. My goal in my test game is to destroy an object when I left click it. Fairly simple.. only I just can't seem to find where the event is at all.

    Thanks.

    EDIT: Nevermind, I solved this while randomly clicking around.

Farmrush's avatar

Farmrush

Member since 15 Jun, 2009

None one is following Farmrush yet!

Trophy Case

  • 15-Year Club

Progress

15/44
How to earn trophies