Laurent's Forum Posts

  • Perfect ! Thank you !

    Does the layout event sheet can have an influence on the global layer ? (change text, etc..)

  • Oh ! I guess this is what i saw. Would you have an example ?

  • I remember something where a layer is given the name of a layout so this layout can be part of another layout.

  • It's all in the title : I'd like to have a layout embed in my current layout.

    I know it's possible, I did find a way here back in the day but can't lay may hands on it again.

    Tagged:

  • You do not have permission to view this post

  • You're a genius !!!!

    I added a Trigger once condition and everything is fine now !

    Thank you !!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    I tried your approach with the onTap code in a group being enabled when necessary. And it is still the same.

    I dont't understand why every action is working (destroy, variable changes value) but only layer visibility is not. Is there something special with this action that causes this ??

  • Your first 2 requirements get met state and isMoving and then you tell the system to wait 1 second. After 1 second did you touch the button as well as overlap an enemy as well as hex overlap player.

    Yes, every conditions are ok.

    The thing is that after "Touch button", every event occur (meaning Pick and Overlapping are also met) : Destroy enemy & Set occupied to 1. Only Set layer 2 invisible doesn't work.

  • Thnaks both of you, and thanks winstreak for taking the time for the clear video !

    I understand what's going on here. By the way, exemple here was not very well chosen because my real problem doesn't involve the possibility to use the Else statement.

    I can't post the all code but here is the segment that poses problems :

    In here, everything works well when the highlighted line is not present (wait 1 sec) : Layer 2 is shown on screen (Red button and Fight text are on this layer) and when button is clicked, layer 2 is set to invisible and State is changed to its correct value.

    But when action "System > wait 1 sec" is added, everything works the same but "system > set layer 2 invisible" is not triggered.

    What happens here ??? I really don't get it.

  • I came across a strange behaviour here. In this little code where everything looks fine, clicking the green button doesn't switch layer 0 where Red square is, as it should. Button is active because because it triggers correctly Flash behaviour.

    Did I miss something ??

    https://www.dropbox.com/s/nf1lm16l1e5w3ah/SetLayerInvisible.c3p?dl=0

  • Hi R0J0hound

    I think you'l be proud of me.

    I managed to set up an Attack routine that looks pretty well.

    Here's how it runs :

    - When Player and an enemy are in the same hex (ie that hex occupied = 2), game state is set to "attack"

    - a layer is displayed. So far, it is just a button but it is meant to have a battle routine with action choice for Player (use weapon, use spell). Here, when button is clicked, Enemy is destroyed, ie Player wins.

    - Then two things can happen :

    1. Player still has move points left, game resumes to map where reachable hexes are displayed ("show moves" state) --
    2. Player has no move points left (meaning has attacker in the last hex it has been able to reach OR attack has occurred after an Enemy move) then game resumes to Enemies actions ("move enemy" state).

    Since you can't read C3 files, here's a screencap of the commented code :

    Still a lot to do but all this is on the right tracks.

  • Thanks !

    I'll have a look

  • Looks nice. How do you use it ? I could find no example file or tutorial

  • Hi R0J0hound

    Thank you so much for this.

    Going through your code is the best way to learn a lot of Construct subtilities.

    Everything looks as I wanted to. I'll have to adapt the attack part to my gameplay with attacking occuring as soon as Player and Enemy are in the same hex. Then two things can happen : 1) player is killed -> game over 2) Enemy is killed -> enemy destroyed and game goes on.

    I thing I'll try a simple collision test between Player sprite and Enemy's to trigger Attack routine function and not trigger Attack when Occupied =2 (that I'll keep to allow player and enemy to be both in a same hex). And btw, it's more Battle function than Attack function, since it doesn't matter who attack who, Battle function acts the same when two adversaries are in contact.

    I'll let you what I come up with.

    Thank you again !

  • Yes, I was thinking moving one at the time could also be great for the game atmosphere. So, when an enemy moves, Player hexagon have to be considered as non occupied/obstacles so it could be entered and then trigger the Attack routine (this routine in my game would be a complete module with choice for weapon). When attack is resolved, 1) Player is killed, game ends, 2) Enemy is defeated, game goes back to next enemy moves and Attack routine may occur again if it enters Players' hex.

    To let Player enter Enemy hex, Enemies' hex have to be considered non occupied/obstacles. When Players enters, Attack routine is triggered as above and if Player wins, he is allowed to move using his remaining points to move and why not attack another enemy if in range.

    And I want to thank you again for your attention ;)