DrewMelton's Recent Forum Activity

  • Thanks guys. I'll look at your examples first thing tomorrow. It's getting late. I'm going to get to the bottom of this yet! I've come too far to be slowed down by something so small.

  • codah or Arima or megatronx or anyone!

    I am still having trouble getting it to set my instance variables right. I just need each enemy to reach 3 turns after walking 200 pixels. But it will not let me do it no matter what I do.

    I either get one enemy with 3 and the others with 0, or 1 enemy with several hundred and the others with zero, or some weird combination of whatever the game can think of.

    No matter how many combinations I try, no matter where I move the conditions or events, I get the same results of one of the above.

    I can get the enemy box to calculate the proper distance, and they will set their boolean variables as well usually. So, I guess that's a start, but I'm running out of ideas.

    I have tried using just the enemy box since it is the one doing the pathfinding. I gave it boolean variables and instance variables, and still it will not calculate them properly. It evens ignores my trigger once events and does it infinite times or no times at all sometimes.

    I just don't know what it wants. I don't know why it is so picky.

    Here is a screenshot of my latest attempt of many. Like I said, I have tried many combinations even with different objects.

  • Thanks guys. I'll look at it again when this beer dies down.

  • codah Thanks. I'm going to play with this some more and see what happens. My code is pretty big. I have 3 main characters. There are also 150 events or so just for this one enemy. So, I may copy the enemy folder and simplify it while I play with this. I'll post again when it works or when I get stuck.

  • I've been banging my head against the monitor for 2 days now. Maybe 3. All I want is to have multiple enemies of the same type in a turn-based game.

    Each enemy can move a max of 200 pixels per turn. It is supposed to take off a "move" at 10, 100, and 200 so it adds up to 3 turns. I gave each enemy a box that pathfinds, then it adds the distance to monitor sprite.

    No matter what I try, it will not let me do it with more than one enemy. I got code working fine for just one character (Not pictured), but my attempts at making code for 2 or more enemies of the same type have all failed.

    Either each box gets 3 when one gets 3, or one gets 3 and the rest get zero, or one gets 500 and the other get zero. No matter what I do, it's wrong. Each one is supposed to get 3 turns added once it reaches 200. That's it.

    So, it should work like this:

    enemy: distance travelled is 200, enemyMonitorTurn=3 (when the enemy walks 200 pixels, he uses all his turns (3).

    Here is a picture

    It's kind of a mess because I've moved things to every possible location. I've put in "for each", I've put in a enemy monitor sprite with tied to a enemy.UID, I've tried everything. I've moved stuff around. I've removed or added things. I just don't know what it wants.

    I finally got them to track the distance separately, but they won't add their turns up separately. I'm getting a headache....

  • With as complicated as my HUD is, the only choice I have is to create a template layout and then duplicate it. That way the HUD and layers will be intact in each new layout. My HUD is for a RPG, so there's no way I'd feel like recreating it from scratch each level. Of course, if I wanted to make any changes to the HUD, I'd still have to do it in each layout.

  • LittleStain Hmm, that's an interesting idea. I'll play with it when I get a chance.

  • PigFiend Yeah, I had one test sprite set up to hold the weapon animations, but I started running into trouble with getting the game to sort the z-order correctly. All the characters are sorted based on their Y value, and their origin point is right at their feet. The lower characters on screen are moved to the front. So if the weapon has a higher Y value, it is moved towards the back when it should be in front of the character. Of course, it also needs to be behind any characters that walk in front of this character.

    Ideally, I would have placed the weapon sprite's origin at where it would hit the hand of the character, but that won't give me the correct z-order sorting. I could make the hitbox for the weapon bigger, and place the origin below the character so it's in front. But then, doing that makes it hard to get it lined up properly and at the same time make sure the weapon appears behind anyone walking in front.

    And yeah, there will be different animations depending on if it's a dagger, bow, sword, whatever. So, I have to do this for each type.

    Remember this is an isometric game, so characters will be moving up and down the screen as well as overlapping. This is where the trouble lies.

    It just seems not worth the trouble. I could make separate animations and the sorting would be fine since I would be using the character's origin point for the sorting, and I already have it working properly, but I would not feel like coding in dozens of animations for each hero.

  • Well, I guess I'll have to do without visual upgrades to weapons. Maybe I'll either make upgrades just stat based or maybe I'll make a few worthwhile upgrades and keep the number low.

    Since I haven't heard from anyone, I'm guessing that this issue is difficult to solve. Like I said, the main problem was maintaining z-order sorting in an isometric game. Since the sorting is based off the Y value which is tied to the image point I believe, then weapons will always be a little off since they need to be placed high on the character.

  • I'm getting ready to start on my character animations. I've just been using placeholders for now while I worked on general gameplay mechanics and the HUD.

    The character is going to have 2 or 3 weapons, and I wanted there to be the ability to upgrade them visually (different color, appearance, whatever).

    This is an isometric game (like Baldur's Gate or Age of Empires II), so everything is sorted by a family with z-order sorting. This is what makes it tricky. If I just add in new animations, I don't have to worry about the z-order not working since I have already set the characters up. However, if I create a weapon as a separate sprite and then pin it or position it and have it trigger accordingly, I still need to make sure it sorts in the proper z-order.

    This picture of Golden Axe on the Genesis will give you an idea of the types of animations I have.

    There will be forwards and backwards walking animations. There will be an attack animation. And probably an idle animation of some sort.

    Now, normally when pinning a weapon sprite, it would probably be on the handle of the weapon and pinned to the character's hand. However, this would put it higher on the z-order sorting since the "lower" object is put in front. The character's origin is at his feet, and the weapon origin point would be up at his hand.

    The z-order would have to stay consistent when he is walking or when other characters get in front of him. I tried making the weapon sprite box the same size as the character, but it starts to get a bit confusing as to where to put the origin point and making sure it stays consistent with the character's animations, so I don't know if that's optimal.

    Now, I can avoid this by simply making new animations for the character with each new weapon, but this will start to add up quickly. I could also make the weapon invisible during the walk animation and have a few less animations to worry about, though it would look a bit silly it would still work.

    Anyway, I'm trying to figure out the best approach.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • jobel Well, I think I got it sorted. I rewrote the code a bit to this:

    I used two separate conditions. Rather than pick by evaluate, I used pick random and system compare two values. I had to put the trigger once event first or it would go crazy and make tons of them. I was also able to increase the number higher than 200.

    By the way, heroes was a family with 3 people in it. Anyway, I think that wraps this up for now. I need to do more testing and see if this is what I want vs another method to spawn things.

    Honestly, I just don't understand how the logic works sometimes...

  • jobel Ground is a floor tile that is created during the map generation. The other tiles are wall tiles.

    So basically, I just want to spawn something on a ground tile at random. Like I said, it will work if I set it to less than 200, but greater than 200 will never work. There is plenty of room and plenty of tiles. I just don't understand it.

    I tried moving trigger once to after the condition, but it didn't seem to matter. I may have already tried that. I don't really remember. Since it worked like that for the less than 200 event, I thought it would work for both.

    The goal with this was just to keep stuff from spawning too close to the player.

DrewMelton's avatar

DrewMelton

Member since 18 Oct, 2013

None one is following DrewMelton yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies