smumpy's Recent Forum Activity

  • really my thought here is to make it either when overlapping a slot or in position then set notslotted to false and then there just needs to be some event that resets not slotted and in doing so that would return it to its original position

  • yeah that's how it works there are ability icons you drag and drop onto the different slots from a visible menu, the making them swap bit is literally all i am trying to solve here

    if there was only 1 slot then the slot1active, etc... instance variables would be redundant because you would only need the 1 slot to change out and it would be as simple as "is equipped" then do everything else

    however, because there are 3 slots if you set it so ;

    is ability 1 equipped, then reset positions on all other power ups

    then you couldn't assign more than 1 ability to more than 1 slot at a time, for every time you did it would reset all the others

    again you're right, this would work if it was only the 1 slot

    the actual problem is when assign ability 1 to slot 1 and then assign ability 2 to slot 1 they both stack up instead of returning ability 1 to its original position

  • the slot and text objects are required for later when you're actually playing the game to determine which powerup is assigned to which button in-game, i just used the text to assign position for convenience but essentially the text represents "is equipped"

    the instance variables were to determine which power up is on which slot

    which obviously you understand

    however as i think it through the proposed solution would lead to this problem;

    slot 1 = 1 of 16 possible instance variables representing the 16 different abilities

    slot 2 = 1 of 16 possible instance variables representing the 16 different abilities

    and slot 3 = 1 of 16 possible instance variables representing the 16 diff abilities

    also makes sense to have a neutral state "notslotted" which states there are no powerups active on a given slot

    now you make it so if slot1 = ___ instance variable set that ability icon to position of slot1 and all others to original position

    and so on through the other slots

    however, if you did that then you wouldn't be able to equip more than 1 power up at a time because it would constantly be resetting the other positions every time you equipped 1 power up to ANY slot

    or is there something i missing with that?

    that is why the code became so complicated, it is just to determine if any one power up is currently slotted and prevent that power up icon from being moved if another is slotted, i mean honestly it seems the text objects and instance variable option is interchangeable however they both lead to this problem

    oh the reason i used text objects is i was going off what you suggested originally in my other post

    construct.net/en/forum/construct-3/how-do-i-8/how-do-i-make-equipabble-power-140846

    about making the slot instance variables = the powerup instance variables but thought the only way to do this was using text objects in place of the instance variables because as i understand you cannot make an instance variable = another instance variable, maybe you meant to make it a string instance variable but even then i ran into problems, regardless the aforementioned problem is what matters because everything is working other than the returning to original position once a new power up is slotted

  • Use this if you are intending to use drag and drop functionality on a visual menu to drag and drop abilities [icons] into equipped slots (abilities/items/etc...) and use said menu to determine what abilities/items/etc... are currently equipped to your character

    So basically the idea is there are 16 abilities and 3 slots that you can equip them in, each ability is represented by an icon in the menu, you drag and drop the icons onto the slots to equip them. i have figured out how to get most of it working but i am stuck in the regard of getting the ability icons to return to their original positions once a new one is placed onto the slot.

    each ability has 4 instance variables atm (slot1active, slot2active, slot3active and notslotted)

    each ability has a text object associated to it and each slot has a text object associated with it

    the logic looks like this:

    if dropped and overlapping slot1/2/3 then set slot1, slot2, or slot3's text object to the said ability text object

    if slot(x) text object = ability(x) text object then set said ability (x)'s icon to slot position and set slot(x)active instance variable to true on that ability

    if slot(x)active instance variable is true on given ability then set slot(x)active instance ability to false for all other abilities (this goes through slot1/slot2 and slot3)

    if slot(1,2 and 3)active instance variables are false and notslotted is true then set ability icon to original position

    simultaneously if any ability is dropped anywhere but slot1,2 or 3 then return to original position

    i keep running into the problem that if slot(1,2,3)active instance variables are false then return to position, basically disables the ability to drag and drop them at all, however, if that logic isn't in there they don't return to their original positions. i added the notslotted instance variable in an attempt to disrupt this so it is not active one startup but then becomes active once it is slotted/unslotted, but i am not sure where/how to work in notslotted, or if that is truly the solution.

    does anyone have an idea as to how to approach this issue?

    my thinking is that there needs to be something that ensures that only 1 ability is slotted at a time on each slot, then something else that triggers the previous ability to return to original position once a new ability is equipped to a given slot. i just am not sure how the logic of this would look.

  • do you mean enemies that you approach, pick up and then throw as your playable character?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • oooh my bad, that makes sense, thanks

  • hey so i tried to implement this and am having trouble figuring out how to set slot's instance variable to power up instance variable, I set them both to numbers,string and boolean but the number is the only one that seems to have the set slotvariable = ____ function, however i am not seeing powerup instance variable in the drop down list and it doesn't seem to recognize it if i type it in. does it not recognize other instance variables? and if so how does one make it set slotvariable to = power up variable?

  • oh cool ok this eradicates the need to set the others to false then, thanks yet again

  • ok so have slot1, slot2, and slot3, then make it so when power-up1 is dropped into slot1 set slot1 animation to correlate to power-up1, right?

    then just have instance variables on each slot totaling 16, correlating to the 16 power-ups, so whichever power-up is dropped into slot1 it sets that power-up instance variable to true and others to false on that slot?

    that makes sense to me i just wanna make sure i'm getting what you're saying

  • why not create them as sprite/objects? you can set them to _ on the z-order (this ensures they appear as backgrounds), then create a second set of objects/sprites that spawn the background objects, then to make it random you can create a number variable and set the value as round(random(1,6)); this selects a number between 1 and 6.

    then just set it so if number variable = 1, then have spawner spawn background object 1, if number variable = 2, then have spawner spawn background object 2, and so on.

  • it likely is not moving to player because of every tick, if you have every tick then maybe it does not have the time to actually initiate the path, try using every x seconds and see if that helps, also maybe remove the line of sight to troubleshoot and see if that helps

  • you should be able to export as .html by going to menu > project > export and then select desired export file

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