YoHoho's Forum Posts

  • I would definitely do this with arrays.

    Each Row would have a World/Stage code. For example, "W1S1" could be world 1 stage one.

    Then there would be two columns: Unlocked and Replay. They would all be set to zero.

    As players complete stages, it would change the array. Completing World 1 Stage 1 would change the W1S2 Unlocked value to 1.

    Defeating a midboss would change the appropriate Replay values to 1. Defeating midboss 1 would change the Replay value for W1S1 and W1S2 to 1.

    Defeating World 1's final boss would change the Unlocked and Replay values for W1S1, W1S2, W1S3, W1S4, and W1S5 to 1. It would also change the Unlocked value for W2S1 to 1 as well (since that's the first stage in the next world).

    Finally, the World Map (or stage select screen, etc) would reflect the current state of the array. For example, stages with an Unlocked value of 0 could be drawn at 50% opacity or in greyscale, and stages that have a Replay value of 0 could have a little lock icon.

    Is that what you're looking for? You could do also this with dictionary entries, if it's more comfortable (just more typing).

    Yeah, I figured it was going to come down to arrays.

    One of the issues I had with looking arrays over was I never found a list of tutorials that would explain how arrays could be used for multiple separate things in one project; kind of like how you just have separate event sheets.

    I just quickly found a YouTube tutorial on using an array for a weapon inventory and I'm going to follow that while integrating your World Unlock/Replay concept. I wouldn't have thought of 2 separate values for this but it makes sense. Maybe when I'm done I can get a Hi-Score array working as well.

  • Having yet to use arrays properly (just a note), I'm trying to figure out the best way to have a level unlock system that works in a certain way. The game would go as follows:

    Select World 1 (all Stages are locked; automatically start with Stage 1) -> Pass Stage 1 and proceed -> Pass Stage 2 and proceed -> Defeat Midboss 1; Stage 1 & 2 are unlocked for replay and proceed -> Pass Stage 3 and proceed -> Pass Stage 4 and proceed -> Defeat Midboss 2; Stage 3 & 4 are unlocked for replay and proceed -> Pass Stage 5 and proceed -> Defeat World Boss; Stage 5 is unlocked for replay and proceed

    Essentially, in order to unlock all of the stages for replay in a world, you have to defeat the midbosses to unlock the previous stages; defeating the world boss would unlock the last stage and the entire world for replay/continue point.

    I really wouldn't know where to begin here. I thought I could use a letter system since the stage numbers are close to all the quantity of letters in the English alphabet, but I'm not sure how to keep work with a variable for both stages AND worlds. Maybe now I can finally figure out how arrays work correctly. Any help would be appreciated

  • ....

  • ...

  • Hey BalthazarTheWizard,

    Here is an example of how it can be implemented. I made it with C3 so please open it there. It should work for C2 as well.

    I hope it will help you.

    c3p-file: https://1drv.ms/u/s!Ap_-qxoGKbDccub_B5pnfUs2rSM

    Construct 2 won't even find the file when you try to open. Do you have a version of this for C2?

  • Try Construct 3

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

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

    I've never used C3. If someone wants to use the code as a base, you can use.

    Cheers.

    Hello.

    I was looking to get your 'Plus' by PlayLive behavior/plugin for a .capx I'm trying to view. Is it available?

  • I'm looking for the following behaviors:

    'Scrolling' by rex.rainbow

    'Plus' by PlayLive

    I need them to open a .capx downloaded from the 'How do I' section. Any help would be appreciated.

  • YoHoho

    There is "LayoutName" expression.

    System- Compare two Values -> LayoutName equals "Level1" : Go to layout Level2

    You can also create a variable "NextLayoutName".

    When level 1 starts, set NextLayoutName="Level2"

    When level 2 starts, set NextLayoutName="Level3"

    etc.

    At the end of each level use event "Go to layout (by name) NextLayoutName"

    That's exactly what I was wondering. It does make sense to create a variable AND then have the 'Compare Two Values' with text instead of numbers. I'll try putting this together this weekend. Thanks for the help to the both of you.

  • On whatever the action is that completes the level system > go to layout > layout name

    Do this in each level for the next level. Same idea for the level skip, except that whatever it is that allows the level skip is where you put in the go to layout.

    so say they reached a door that leads to next level setup the condition on collision with object door and action system go to layout level 2

    if they got a certain item in the level that allows the skipping of level 2 add a sub condition with a variable setup for that item being obtained

    so conditions:

    on collision with object door

    if level skip is true

    Action:

    system go to layout level 3

    does that make sense?

    Well, I can see myself creating an event sheet just for this which won't be a problem since I'm not versed in arrays. But how exactly do I put together the event of 'On Level 1' -> If Complete -> Go to Layout 'Name'? I don't see an 'On Layout Name' event.

    Would I have to put together a system that requires comparing 2 global variables? I think I can manage something like that, but I'm not sure how to get the number out of my 'Layout Name' somehow to integrate it with a global variable that matches itself.

  • How would I setup my game so that when a level is completed, the game proceeds to whatever layout I want. For example, I would like to go in this order: Lv1 -> Lv2 -> Midboss -> Lvl3 -> World 1 Boss.

    Also, what ways could I incorporate a 'level skip' in a game?

  • What I'm working on is an action game where the player uses (1) character and takes a certain number of turns to attack the enemies on screen. Then, when the player runs out of turns, the enemies will attempt to attack the player in an assigned order based on a timer.

    The enemies have an attack order ex. #1 to #5 (first to fifth). When it's time for the enemy's turn, the attack order starts at #1. Then, 1 second passes and the attack order increases up 1 to #2 and so on. Once the order ends at #5, everything resets and the player has their turn to attack again.

    I'm having a problem getting the attack order increase to trigger on a timer; not sure about using global or instance variables to have a timer activated. Also, how would this work if the player uses up to (4) characters with (1) turn each?

    Any help/info that could be provided would be appreciated. I can also make the .capx available if needed.

  • After all of this time, I have never been able to figure out how to even create a local variable properly.

    This Global plugin addon looks like a great solution that I will definitely try.

  • I made this demo for another post recently:

    https://www.dropbox.com/s/0ex32akdcl7s2 ... .capx?dl=0

    You'll need CSV plugin to open it:

    plugin-csv-csv2array-csv2dictionary_t64326

    As for the button, you can change its appearance with CSS, but I prefer using sprites.

    Thanks. I'll give it a look over.

  • I'm trying to put together a shop that allows the player to unlock new team members when they have enough currency: combination of coins and gems. If the player has enough coins and gems, then the player can select to unlock the new team member, and those coins and gems are subtracted from the total.

    I couldn't get the subtraction to work at all. On top of that, I'm not sure whether it's better to use my own created sprite OR use the 'Buttons' function. Can 'Buttons' have their look/art changed?

    And why is the most recent tutorial for 'in-game shop' from 2012? Any help would be appreciated.

  • Do you mean you want to set the tilemap's tilesheet image from any other image? If you have the URL of that image (ie: if it's a project file, or a file hosted and accessible from elsewhere) you can use the 'Load image from URL' action on the Tilemap.

    Do you mean you want to be able to import an image at runtime and draw the tile with one pixel per tile? In which case you need to load the image into a sprite, draw the sprite at [0,0], then run a 2D loop that will check every cell in your array. For example:

    > For "x" from 0 to ( Tilemap.Width / Tilemap.Tilewidth )
    For "y" from 0 to ( Tilemap.Width / Tilemap.Tilewidth )
    [/code:2sz1tazp]
    
    Gives you a loop which iterates over every cell in the tilemap. You'll need a way of indexing the tiles to pixel colours, but the pixel colour can be determined using this lovely line from @R0J0hound:
    
    [code:2sz1tazp]
    Browser.ExecJS("var canvas=document.getElementById('c2canvas');
    var ctx=canvas.getContext('2d');
    var pixel=ctx.getImageData("&loopindex( "x" )&","&loopindex( "y" )&",1,1);
    pixel.data[0];")[/code:2sz1tazp]
    

    Well, I really want to take any picture I may have or obtain, turn it into a tilemap (outside of Construct 2/3) and then import it into the program to use how I wish.