Help with combat system

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I am still getting my arms around Construct 2, so far with the help of this forum I have been able to create a tile based map where a hero can walk through the map and encounter monsters. I am now onto the combat phase of things, and need a bit of help.

    On my map I have (1) Hero and (3) monsters. When I collide with a monster I capture the UID of the monster I collided with in a global variable CurrentCombatant. I also set a global variable IsCombat to 1.

    The hero has the option of [A]ttack or [F]lee. If they flee, I allow movement again by setting IsCombat to 0. If they attack, I'd like them to roll to hit (random, easy enough), compare to the defense of the current monster (I only want damage applied to the CurrentCombatant), and if I hit, apply damage. With a sub-event I check to see if the monster is dead. For some reason, ALL instances of the monsters are destroyed, when it should be the specific instance.

    Then I want the monster to attack using the same combat mechanism as the hero.

    Where I am struggling is with the sequence of events ... I can get the hero to attack no problem, doing it all within the A key press event. I just can't seem to get the monster to attack.

    Is there a simple example that someone can point me to, would be much appreciated.

    https://www.dropbox.com/s/xshwtg2wb1mi2os/ForeverQuestGridMovementWithBoard.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Fixed the issue with the destruction of all monsters, just need to sub event on the Pick Instance with UID, now just need to figure out how to add the monster retaliation attack.

  • I think I have it figured out ... calculations look good, just not sure if the events are firing sequentially ... would appreciate another set of eyes to review the project in the original post.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)