smumpy's Recent Forum Activity

  • cool project, good job that's cool

  • could you clarify your specific question?

  • dang, thank you for your answer i appreciate it... that's even more confusing why this isn't working lol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • took a look at ur project, sorry i wasn't specific enough,

    if you are looking to use the simulate movement logic try setting it so that (the numbers here are just examples to start with, tinker for what you want);

    every 8 seconds simulate left

    then separate event

    every 12 seconds simulate up

    then separate event

    every 18 seconds simulate down

    then separate event

    every 21 seconds simulate right

    the reason it isn't working is that it is saying every 1 second to simulate movement left, right, up and down whereas you want it to switch between all four at different points

    if you want to do pathfinding to player you will need to decide the condition that determines what decides if they are moving towards the plater (for instance it might have to do with what size the player is, if the player has BIG = true then have enemies target player and move towards them(BIG would be either a global/instance variable, then just decide the condition that determines what toggles the BIG true/false) if BIG is false then disable pathfinding (which is as simple as setting stop pathfinding i'm pretty sure), you could also use line of sight behavior functionality if that floats your boat, though i haven't used line of sight very much so i recommend looking up any tutorials for it you can find, however;

    first add pathfinding behavior to your enemies

    once you decide your condition then the pathfinding logic looks like this;

    is pathfinding condition met (BIG =true/false, or maybe LOS to player =true/false, etc...)

    then

    on condition met -- enemy find path to (player.x, player.y)

    on pathfinding failed to find path -- find path to (player.x, player.y)

    on pathfinding path arrived -- find path to (player.x, player.y)

    then you want to have;

    on path found -- move along path

    this will not only have your enemy move along the path when the condition(s) is/are met, but will have them continue to track the player whether they arrive at the player's position or if they get stuck and fail to find a path

    personally i used both simulate movement(s) (up/down/left/right) and pathfinding in my project so that even when pathfinding is not active the enemies move around the map

    but you can do what you want, you know?

    you may also try referencing this:

    scirra.com/manual/154/pathfinding

    helped me quite a bit in understanding how pathfinding works

  • i can't find the answer online just wondering if anyone knows, if you use trigger once function does it mean trigger once during the layout, or does it mean trigger once every time the conditions are met and then reset and then met once more?

  • Finally figured out how to break it up, added is notslotted false condition to the reset position toggle, and had to add a reset trigger to notslotted (setting back to true) once it resets position, this correlates to the SlotCounter function [SlotCounter is a number instance variable on each of the slots].

    the logic looks like this;

    is power up overlapping slot?

    is SlotCounter > 0

    Slot1/2/3 text = powerup.text

    is not slotted false

    then

    set powerup position back to original x,y

    set SlotCounter to 0 on Slot1/2/3

    set NotSlotted to true on powerup

    edit:

    seems to work initially with all powerups on each slot individually, however, if you attempt to equip 2 or more at one time they begin stacking again, will update when i understand why

  • i haven't look into your code but did you also create logic to simulate the movement? or are you, the player, controlling the enemies with the keyboard or some other kind of input (keyboard/touch)? there needs to be something that actually tells it to move in a set direction.

    you could do; every x seconds [for x enemy] simulate movement up/down/left/right

    or also; on left arrow key hit [for x enemy] move left

    etc...

  • that seems counter productive, (shutting down this post i mean) i feel like this topic could help others trying to implement something similar once it is fixed, if nothing else everything discussed has led to two pretty solid solutions;

    either use drag and drop method if timescale is set to 1 (and thus you can have an "every x seconds" change to _____ position; based on consequent conditions)

    or

    use your suggestion of animation frame changes with touch controls to accomplish the same thing

    either way thank you for your help through this, and Moderators if you do intend to shut this down please give me some time because i am using this thread as a base to modify my project

    quick edit:

    Got a little further by using the slot1text = power.uptext (inverted) as the condition that returns to original position rather than using notslotted.

    the problem really lies with the conditions that start triggered to the same conditions that return to original position (Notslotted = true, Slot1active = False, Slot2Active = False, Slot3Active = False) this keeps not only making it so they return to position when you try to slot/equip them, but also (for some reason) they don't appear to be cooperating with the SlotCounter position reset. however, i believe the text condition got me further because it only triggers to true ONCE you equip it, allowing it to activate only after another has been equipped (again, that was accomplished by using the add 1 to SlotCounter, if SlotCounter is over 1 check all powerups, for every power up not equipped (now using text logic) return to original position)

  • Still having issues, it kind of works, however, when you place it it enters an infinite loop of glitching between the two spots, most likely because it checks if over one, changes positions based on notslotted variable, then resets the counter so it kind of goes from one to the other over and over because it is constantly switching between slotted and notslotted, need to find a way to break it up

  • I think I figured it out

    Every time a power becomes equipped to slot(x) add 1 to slot(x) counter [number variable]

    Every time slot(x) counter is above 1 check every power up; for every power up that is not equipped [notslotted = true] then reset position and reset counter to 0

    I think this will create a constant check that resets position without relying on the timescale

    I will update once I have implemented and let know if it worked or not

  • also i think you are right about changing it to animation frames rather than objects themselves, that might be easier to work with, hopefully i can find an alternative fix though because that would require quite a bit of reworking

  • so for anyone interested i've progressed a little further by adding set notslotted to false when powerup is touching any one of the 3 slots, and then set it to true in the same line of code that sets all the other slot(x)active instance variables to false ((once a given powerup is equipped to said slot))

    now when you set any power to equipped it will save it as equipped and returns the other power ups to original positions when you exit the menu ((if you reopen the menu then the other power ups are at original positions and equipped are in the equipped slots))

    however, it appears that the return to original position works at first but then stops, i've noticed that it works correctly approximately 2 or 3 times before they begin stacking upon each other again

    i believe the reason for this is that the "return to original position" code has a trigger once condition so it does not interfere with the drag and drop functionality ((without the trigger once you cannot move them at all as the conditions are set upon layout start and it keeps them at their positions))

    my immediate solution would be "every x seconds, if notslotted, then return to original position" however, the timescale is set to 0 when this menu is open as the game is paused, meaning ((i believe)) that the every x seconds function won't work

    if anyone has an idea on what to use instead of "every x seconds" that doesn't rely on the timescale being set to 1, please share your thoughts

smumpy's avatar

smumpy

Member since 29 Aug, 2018

None one is following smumpy yet!

Trophy Case

  • 6-Year Club
  • Email Verified

Progress

7/44
How to earn trophies