dop2000's Forum Posts

  • Here is a very simple demo:

    dropbox.com/s/6sm8wpt9820bo4c/SaveSpritesToArray.c3p

    You can save the array itself in Local Storage, use Array.AsJSON expression.

  • (deleted)

  • "[Project] Exception opening: File format is not recognized."

    This must be the error. Have you tried changing the extension of the project file from C3P to ZIP? If ZIP archive is corrupted and you can't extract files from it, then there's probably nothing that can be done.

  • Where is the file stored - in some folder on your hard drive, or is it added to the project?

  • When you see this error on the screen, press F12 and check for error messages in the Console tab. There's usually an explanation why the project can not be opened - for example a missing file etc.

    Then you can rename the project to .ZIP, extract it to an empty folder and try to fix the issue.

    Before doing anything, make a couple of backup copies of the project first!

    .

    Also, maybe you do have automatic backups - check "Save & Backup" section in Construct 3 Settings.

  • Almost every object in Construct has AsJSON expression and "Set from JSON" action - you can use these. JSON will contain all object properties.

    You can put all JSON strings into an array if you want, for easier storage.

    .

    If you need to re-create the entire scene with lots of objects, it may be easier to use System Save/Load actions. After saving, you can get SaveStateJSON expression and saving it to a file - it will contain properties for all objects on the layout.

  • You need to build a string of all objects and their positions in the level, then export this string. And you need a code which will do this in reverse - decode the string and restore objects and positions from it.

    How you do this really depends on your game and the complexity of levels.

    If your level is just one tilemap, you can simply export all tiles in JSON. If your level consists of many different sprites, you can put their names, coordinates, sizes, angle and other properties into an array, and then save this array as JSON.

    If your game is grid based, you can invent some creative and compact way to save it, for example see how the chess board is saved in FEN format:

    dailychess.com/chess/chess-fen-viewer.php

  • If the entire sprite needs to be colored, then you can simply add a condition - Sprite is overlapping Mask : Sprite set effect "Grayscale" disabled.

    .

    If you want to show only the overlapping part of the sprite in color, I'm not sure how to do it. Maybe this will help:

    dropbox.com/s/bskzrw0b8xea80n/ColorMask.c3p

  • You need to break the text into words and check each word separately. You can try something like this:

    Boolean swearWordFound
    Text variable s
    
    Set s to InputBox.text
    
    // first replacing spaces and other punctuation marks with commas ","
    Set s to replace(s, " ", ",")
    Set s to replace(s, ".", ",")
    Set s to replace(s, "!", ",")
    Set s to replace(s, "?", ",")
    
    // now checking each word 
    Repeat tokencount(s, ",")
    SwearWordsDictionary key tokenat(s, loopindex, ",") exists 
    .... Set swearWordFound = true
    
    
    
  • This code may be in the general sheet. Make sure it's included in all layouts. Double-check that you made everything exactly as in my screenshot. If it doesn't work, please post your project file.

    .

    Sorry, forgot to add - your room layouts should be named Room0, Room1, Room2.

    Or you can change the action like this:

    Go To Layout "Room" & (AdvancedRandom.permutation(permutationIndex)+1)

    then you can name layouts Room1, Room2, Room3.

  • Here is a demo I made a long time ago. It's not very good, but you may get some useful ideas from it:

    howtoconstructdemos.com/top-down-view-shooter-collect-swap-and-fire-different-weapons

    And this example shows how to switch between primary and secondary weapons:

    howtoconstructdemos.com/collect-weapons-and-swap-between-primary-and-secondary-weapons-in-a-platformer-game

  • You can use AdvancedRandom plugin to create a non-repeating random list of rooms:

  • So I guess it's something like:

    MyText set text to Ink.LastText

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Press F12 and check error messages in Console.