mardoch's Recent Forum Activity

  • Ok thanks lionz, with the 'copy picked' selected it's a bit better: Now I can see that the cooldown effect is applied on the correct power-up object.

    But it still use the action of the power-up on the first slot for both. That's really strange because now it should works.

    Even if I inverse the event, like "if Power-up is overlapping PU_act_Slots", the result doesn't change anything…

  • You should use a variable for this. Use a boolean "Infected" that turn to true when your object is in collision with an infected object.

    Then if you don't want to use an animation, maybe you can create another object over the infected one and use the pin behavior. The new object created can use it's own animation to look like the virus spreading over the first object.

  • Thanks but even if I change this my result is the same

    Whenever I use the "Y" or the "B" button it always call the power-up overlapping the first slot.

    I also use a cooldown as you can see. When the power-up is called it put the cooldown boolean to true and make the power-up sprite opacity to 50%, so I can see if the function work. It should work for only a power-up at once but actually both power-up's opacity turn to 50%. That's mean it doesn't make a difference between the power-up on Slot_1 and the power-up on Slot_2.

  • Try Construct 3

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

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

    I'm in trouble with a function problem. I have for my game two slots for my power-ups. Each one can be activated with a button, "Y" for slot_1 and "B" for slot_2.

    Of course it only works when there is a power up overlapping the slot.

    First I did this:

    It works fine and I can call the corresponding power-up for each slot. But I have to duplicate each power-up (event and action) for each slot. And I'm a bit lazy, so I thought that I could reduce my code to just one function that will call the correct power-up for each slot. So I will only need to edit this for futures power-ups.

    So I did this:

    So it choose the correct power-up in the function but unfortunately, it only choose the power-up overlapping the slot_1. It doesn't consider the slot ID number. I tried many different possibilities but it still doesn't work.

    So if anyone has a solution about this, it will really be helpful!!

    Thanks!

  • Ah! Thank you dop2000!! I knew I was messing up with something on the axis, I still need to practice!

  • Hi everyone,

    I'm just discovered the Advanced Random plugin and think I can use it for my game when I need to drop pick up some loot randomly.

    For now I create an array as a .Json file to manage my loot:

    The column 0 is for the name, the 1 is for the rarity of my object and the 3 is for the object cost. For now I don't need to use the "Cost" column for what I want to do.

    My main idea is to use the rarity column for the weight entry in te AdvancedRandom. So for exemple I would like the object "Banana" to spawn 75 more time than the others objects.

    I tried to create my AdvancedRandom table using this code:

    I can see that is doesn't really the correct way to use the plugin, the debug show me kind of a mess and repeat 3 times my datas (because of my 3 column)

    I can I correctly set this?

  • It's working! Thank you!

  • Oh yes you'r right, my mistake. But even corrected, it doesn't delete all the datas. My purpose is to delete everything in the X axis but also in the Y, like 0,0 0,1 0,2 and 0,3

    These are my saved values, and I want them to be deleted:

  • Hi everyone,

    I actually try to delete a data in my array but don't really know how I can do it. My array is width 0 and Height 4 and I recorded my object's Json in it plus 3 variables like UID and my ObjectTypeName.

    So it's look like this in my debug inspector (btw how can I see all the informations as the bloc can't be resized?) :

    I want now, after a trigger to delete the corresponding object in my array.

    I was thinking about looking for every X element in my array with the corresponding UID name, saved as a variable:

    Unfortunately it doesn't work. Maybe I forget something?

    Thanks for your help!

    Tagged:

  • I have been working on this for 10 days now and I wanted to share it with everyone!

    The idea is simple: generate a new room as the player choose in which direction he wants to go. And of course the mini map.

    Ok it seems to be a really common thing but the tricky part was to make the new rooms fit the already created ones. So the directions are always logical and possible: you can't join a room if there is no entrance to it.

    Here was my method:

    1 • In and Out Directions

    I need to check the actual in/out direction on the screen and create or load the next room as the player touch it.

    2 • Create Boards

    If the next room doesn't exists, it creates a new one according to the table NextBoardCreation.json loaded in an array. The table is big as there is a lot of possibilities as the player wants to go up, left, down or right. I also needed to check if the are already created rooms touching the next one.

    My table fro the rooms creation

    3 • Load Boards

    If the room exist already, I want it to be saved on an array. So it can be charged again if the player comes back in the room.

    4 • Map & Type of Board to create

    This was the big part of the work in the end.Beside showing the player his actual position, it helps for creating the next rooms with 2 types of detectors: the first range are the ones very close of the actual room (up,left,down,right) and the second range are there to check if there are actually some other rooms existing around and give information about it, like if there is an entrance to those rooms.

    You can access the file here:

    dropbox.com/s/5w9ad59vq7cd6lt/LevelGeneratorFinal.c3p

    As you can see, it works pretty well.

    Of course I'm sure it's not perfect. I'm not a dev and maybe there is a better method to do it or to optimise and reduce number of lines of code.

    I will be happy to hear your suggestions or impressions about it. And there is also more to do to make it even better, so feel free to custom it!

  • Thank you again tarek2

    I highly recommend you first read how the events work before you carry on or you will have many issues like that, which will make you spend hours debugging or changing Events unnecessarily.

    In fact I did know how it works and I usually test my event with the keyboard key press trigger. I don't know what I did and why it doesn't worked well last night, I was probably too tired to use my brain correctly!

    Anyway, thanks again for your help!

  • Just another quick question: When I get my second value, let say that I also want to put a Z dimension in my array (like 2 depth). So I can select a random dimension between 0,1 and 2 with different values for my selected cell. But how can I make the loop stop?

    For now I did something like this but the value change at every tick:

    + System: For "Y" from 0 to Array.Height-1
    ----+ Array: Value at (0, LoopIndex("Y")) = Variable1
    -----> Text: Set text to Array.At(1,LoopIndex("Y"),Array.CurZ)
    -----> System: Stop loop
    

    So do I have to make another loop for the "Z"?

mardoch's avatar

mardoch

Member since 21 Nov, 2013

None one is following mardoch yet!

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies