Glitchster's Forum Posts

  • That would definitely the way to get groups to walk together.

    I was thinking of something closer to a php function like:

    function walkingFunction ($character, $x_coord, $y_coord){
    system find path
    $character on path found -> move along path
    $character on path arrived
    }
    
    **make any 1 character move**
    call walkingFunction(character15, 150, 300)
    [/code:f0xmzf9o]
    
    As far as I know right now, construct doesn't really have a way to do this.  Carrying parameters to do repeated actions for different sprites.
    
    It looks like families would be the closest thing to get me there.  I'll have to get it before I can get too much farther.
  • www -dot- cazualnoob -dot- com/web-games/ (second game file)

    So, I want to have about 15-20 controllable characters, but am I really going to have to make all the code for walking for every single one of them?

    I'm aware of functions and loops, but I don't know how I'd get them to help me in this case.

    I'm aware of families, but still don't have the paid version just yet. Not sure if this is the answer to my problem.

    Under the "movement" group, for example, there are 2 more characters that don't have pathfinding coded. I want to know if I can make all the characters share the same code for pathfinding (along with many other future things).

    Any ideas or suggestions would be appreciated.

  • Thanks for your advice, it worked like a charm. I'm starting to get a lot better idea of how construct 2 flows. If you want to see it in action, I uploaded the capx.

    In the sake of the forum and future searchers:

  • I marked 2 groups "Tree" and "Chop".

    First problem I can't figure out is why when you click a tree the second time it doesn't unmark it for chopping down. ... well now it doesn't change the tile to the tree with the x on it anymore...

    Second problem is I can't get him to chop down the tree that he's next to.

    I don't really want to limit how many he can cut down. I just want him to go to the closest one and stay there until it's down then find the next closest one that is marked.

    I uploaded the capx file to my server - same spot if anyone wants to check it out.

  • > www -dot- cazualnoob -dot- com/web-games/ (second game file)

    >

    > well... my little minion will only chop 3 or 4 trees then I can't make him do anymore - no idea why.

    >

    Long story short, I'm pretty sure it is the "trigger only once" on the chop=1 condition. So if you click two trees they will both have chop=1 and once one tree is chopped the event won't fire again.

    And just to note, this isn't me complaining but for your benefit on getting help in the future—your project is pretty messy. A lot of disabled events and events that do nothing. It is asking a lot to post your whole capx and ask for people to read through it all. Try putting events in groups, using comments, and using the bookmark on the events you want people to trouble shoot. Just saying it took a while for me to even find the part to trouble shoot and I almost said screw it. (but I didn't )

    Yea, it's a mess. I'm saving some code for later which is why it's disabled. I didn't think it would be a problem finding the section I was working on, but I'll figure out the bookmarking feature and use it from now on.

    Still have no idea what I'm doing, but I'm sure I'm going to have to change all those sprites into tilemaps and figure out a way to limit the ones marked. Then figure out a way to, like you said, take out the trigger once to make him find the closest marked tree, chop it down, then find the next marked closest tree.

    It's gunna take me a lot of time to figure it out.

  • www -dot- cazualnoob -dot- com/web-games/ (second game file)

    well... my little minion will only chop 3 or 4 trees then I can't make him do anymore - no idea why.

  • Wow, thanks. I was over-complicating that a lot.

    So, can characters effect and/or be affected by a background tilemap? Like slow down characters going through mud? Or would I need to make sprites for that?

  • Right, I should have specified on how it wasn't working. I ran it in chrome, IE, and firefox and all I see is a big gray empty box that does nothing even when I click.

    I even opted-in and downloaded the beta to open the newest one and it's the same.

  • Trying to get a minion to chop down a tree. Clicking on the tree marks it to be chopped down. The tree has 50 hp. The loop crashes the browser no matter what conditions I put in. No idea what I'm doing wrong.

    www -dot- cazualnoob -dot- com/web-games/ (second game file)

  • I did it. Thanks for the guidance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Old school example from the "https://www.scirra.com/forum/how-do-i-frequently-asked-questions_t63692 How do I FAQ"

    [quote:3bzrqz45]Do a contextual menu in events - scirra.com/forum/context-menus-in-game_topic45453.html LINK

    Yea, I saw that from my searching before hand, but I couldn't get it to work in my construct - I was just assuming the version wasn't compatible being 5 years old or me using the free version until I get farther in learning.

    You're creating the menu at gridx,grixy instead of mousex,mousey

    When you create at mousex,mousey you have an event that destroys on touch so you'll never see the menu. You should set up a boolean for opened/closed and trigger the pop up in that way.

    If by solid you mean 'has collision', they already do, unless you erase the tree tiles. It really depends what you mean by solid in this situation and what you want the trees to do.

    OK, thanks. I'll work on that angle for the menu.

    Solid meaning can't pass through (behavior - solid), right now the main char (arrow keys) can pass through the tree tiles. I suppose sprites are the only way to do that.

  • Trying to make an action menu pop up on click, but it's a little broken. I couldn't find any current posts on this type of menu - if there is, please point me to it.

    www -dot- cazualnoob -dot- com/web-games/ (second game file)

    I know the gridx and gridy are switched on create object menu1, but if they're "correct" the menu doesn't show. I'm at a loss.

    Looking for:

    Why the menu isn't popping up at the origin of the mouse.

    Why clicking the menu (to destroy) pops up another menu instantly.

    Best way to make trees solid. Not sure how to handle this in tilemapping (guessing just create an invisible solid sprite).

    Any advice or best practices for what I'm doing.

    Any help would be appreciated... still working on the learning curve.

  • I thought of a way for you to continue with multiple objects - you'll use on touch start or on tap gesture as your trigger, so there is only one event that triggers on touch, like so -

    I'm going to assume the best way is to still do the tile mapping. I'd rather do it the best way possible than to work around with what I have.

  • Yea, I was thinking there would be a better technique than what I was doing.

    And that else, although makes sense when you put it that way, it's not how other languages I know use it.

    I'll chalk that one up to learning and watch tutorials on tile mapping. Although the game isn't fully formed in my head just yet, I think the direction I'm going will turn into something fruitful.

    I'm sure I'll ask for more assistance in the future. Thanks.

    P.S. the total number of sprites in the grid was 1952, not 900... kinda funny.

  • I'm surprised and thankful you're still answering my silly questions. I'm slowly chipping away at this mountain and thank you for your patients.

    I've changed the creation of the sprite grid to include random(), but the 10 ways I tried don't seem to work even though it accepts it and it's completely logical. But that's not even my real problem.

    Don't bother looking at the gate commands, I haven't gotten around to that yet.

    I got the id's to work like a charm - I think...

    I had them kind of working better earlier, but they weren't getting there, so I tried a different approach. I think I'm closer, but I don't think my new way is going anywhere either.

    I can honestly say I have no idea what is happening with the random generator or the grid sprite swapping.

    my game file is here: www -dot- cazualnoob -dot- com/web-games/