Keketin's Recent Forum Activity

  • on layout change set float chaseDistance to distance(player.x,player.y,enemy.x.enemy.y)

    Every seconds if bool enemyNotSpawned = true subtract enemySpeed from chaseDistance

    if chaseDistance < 0 spawn Enemy

    This should work even with layout changes before the enemy spawned again.

    Or do you want to achive something like this:

    layoutA>layoutB>LayoutA Enemy is still in layoutA running to layoutB?

    I studied this example and was able to make the enemy's appearance latency more realistic.

    However, the problem of the enemy not staying in the same "room" when I exit and come back is still a headache. I guess I will look into arrays to see if I can find a solution for that. Thanks fedca for helping me out.

    If anyone has suggestions for my latter problem, it'd be greatly appreciated.

  • Here's a video demonstrating how the enemy is currently chasing me.

    drive.google.com/file/d/1UVwtwqOMdKeW40isB1eANupZmh6FAOUL/view

    And here is another problem; me going to another layout and coming back to that same layout in a second and the darn bunny's gone and already behind me.

    drive.google.com/file/d/1etGaqh_0hp2u4aFeTYwQsMNO-Qs8SB51/view

  • The latter is more to what I want to achieve,

    Forgot to mention this game is a puzzle adventure,

    hide and avoid enemy type of a game.

    My idea is that there would also be places to hide to avoid the enemy, and during the chase, the more layouts you are "further" from the enemy, the faster it will "forget" about you so you can lose it. Hence I need it to somehow remember the distance in "layouts".

    Once it's forgotten about you it will be invisible and it's AI and collision deactivated.

    It will appear again next time the system rolls a chance for it to appear.

    In case of you running in circles, yes you should be able to bump into it, seeing it still trying to run into the same direction. (From then on it could turn around if you get too close, but that's not the current problem.)

  • I have a variable that is storing the distance between player and enemy and use it to set a wait x seconds before appearing.

    And it worked okay in my project for a while, but I'm looking to upgrade it,

    because the problem with this is that since I used pixels between the enemy and the player to calculate latency, and the enemy is a global object, this calculation will get messed up the longer the chase is and the more player changes through multiple layouts.. It's difficult to explain like this, I'll try recording a video to demonstrate asap.

  • I have a global enemy that is set to chase the player upon being activated.

    I am struggling with adding some sort of latency to the enemy's re-appearance when player runs through multiple layouts.

    How should I efficiently go about this to make it seem like you are slowly losing the enemy behind? Make the AI smarter as to say.

    The player is able to use teleportation points in the layouts to teleport to somewhere even further, they could even run in "circles" so bumping into the enemy again at a realistic position/layout should be possible. like so;

    Map A > Map B > Map C > Back to Map A

    Due to the teleportation, the player doesn't always necessarily appear at the far ends of the layouts either.

    Could anyone share some examples that could possibly work with this idea of mine?

  • dop2000

    Thanks! It works perfect and I learnt new expressions :>

  • I have an enemy in my game that spawns randomly and upon spawning, it will chase the player for a random amount of time across multiple layouts before it disappears. Now what I want to do is that every time the player moves to another layout it will subtract from the said on-going timer a random amount, as to speed up the timer.

    I know the expression I can use is -random(a,b)

    But there's only start/Stop/pause/Resume options for the timer behaviour so I don't know where to put this expression...

    How should I go about this now? Thanks in advance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is the working example for anyone else that's struggling,

    I tested it and it works smooth like butter.

    The solution was so simple smh

  • I tried many similar things to what you described but wasn't able to make it work as the last line of dialogue just appears whenever trigger was pressed, overriding anything before it.

    However,

    I found my mistake was in the way I tried executing those instance variable triggered events as sub-events for literally the same key press event.

    The way it should work is to make an entirely different block of key press event.

    Conclusion: I have not gotten used to the way construct handles events yet.

    Thank you for repping!

  • I am a total newbie with construct and

    I'm trying to create a game where the player

    mostly just walks around collecting things,

    talking to NPCs and doing puzzles with key items.

    They should also be able to select and choose items to buy/equip/use.

    Now before anyone points me to existing tutorials,

    I already raided the entire forum and tutorials section,

    even youtube over the entire weekend,

    but I have not found a working solution for me yet

    and it's getting really frustrating.

    Either things are too basic to work for my game

    or too advanced for me to understand.

    I have ever only had experience with RPGMakerMV

    and I know next to nothing about programming languages

    so I want to ask for a visual scripting solution.

    Or something that involves as little coding as possible.

    So I want my player to be able to press a button, say spacebar,

    when they talk to an NPC to advance in the next part of the dialogue

    and also be able to use spacebar as a confirm button for menu selections etc,

    whenever they are not engaged in a conversation with an NPC.

    EXAMPLE:

    Player overlaps NPC > Spacebar > show text for dialogue1, line 1

    "Welcome to the shop!"

    Spacebar again > show text for dialogue1, line 2

    "What can I get you?"

    Spacebar again > show text for line 3, so on soforth

    Spacebar again > closes dialogue and reset this chain of actions so that next time the player overlaps this NPC and presses space bar again, this chain of actions can be re-initiated again.

    How can I event a keyboard key to trigger different actions ONE AFTER ANOTHER?

    I mean so that you press the trigger once, action 1 happens,

    and ONLY AFTER action 1 has happened and you press the trigger AGAIN would action 2 happen.

Keketin's avatar

Keketin

Member since 8 Oct, 2021

Twitter
Keketin has 1 followers

Trophy Case

  • 3-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies