dop2000's Recent Forum Activity

  • Do you need to read the contents of the file?

    In this case you have to access it with AJAX:

    You can use "AJAX Request URL" action if you want, and type the name of the file in the URL field.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • with everything formerly worked on there, how would I now implement the new into the old?

    It's your game and only you can answer this question. I mentioned before that your system of attaching sprites with dx/dy instance variables and a dictionary was overly complex and error-prone. I understand you based it on R0J0hound's advice - he's a brilliant programmer, but he works in Construct 2, where hierarchies don't exist. In Construct 3, the hierarchy feature would be a much simpler and more efficient solution for your task. That said, you don't necessarily have to switch to it.

  • You can add a 1-2px offset with bbcode. But it's possible that some texts will become clipped on the right.

    Another option is to convert this font to spritefont and use spritefonts everywhere.

  • I strongly suggest starting using JSON instead of arrays. It will take a little time to learn, but will save you a lot of time and headache down the road!

    Consider this JSON, which stores all weapons in the game and their stats:

    {
     "IronSword": {
     "Type": "Melee",
     "Rarity": "Common",
     "Damage": 25,
     "Attack Speed": 1.2,
     "Crit Chance": "5%",
     "Range": 1.5,
     "Durability": 100,
     "Special Effect": "None"
     },
     "SteelAxe": {
     "Type": "Melee",
     "Rarity": "Uncommon",
     "Damage": 40,
     "Attack Speed": 0.9,
     "Crit Chance": "3%",
     "Range": 1.3,
     "Durability": 120,
     "Special Effect": "Cleave"
     },
     "HunterBow": {
     "Type": "Ranged",
     "Rarity": "Common",
     "Damage": 18,
     "Attack Speed": 1.5,
     "Crit Chance": "10%",
     "Range": 8.0,
     "Durability": 80,
     "Special Effect": "Quick Draw"
     },
     "Longbow": {
     "Type": "Ranged",
     "Rarity": "Rare",
     "Damage": 35,
     "Attack Speed": 1.1,
     "Crit Chance": "15%",
     "Range": 10.0,
     "Durability": 70,
     "Special Effect": "Armor Pierce"
     }
    }
    

    You can access any stat directly with a single expression, for example: WeaponJSON.Get("Longbow.Damage"). It's a lot easier than dealing with arrays!

    .

    Besides, JSON is flexible - you can create records and structures that are simply not possible with arrays:

    .

    And here is a more advanced trick - I often store the data as an array in a table format, which makes it easy to view and modify in the editor. But at runtime, I convert it to JSON. I've been using this method for the past few years with great success.

  • That's only a small part of the code. Did you implement all other steps? It feels like you don't fully understand the idea.

    Here is a demo - click any molek sprite to destroy it and break apart the remaining chain.

    dropbox.com/scl/fi/11l3w99yrnteao5t1atqn/MolekDemo.c3p

  • You don't have to use the family in all code. Think of it as an alias. It's useful when you need to pick two instances of the same object in one event - one by object's real name and another by its alias (family name).

    Otherwise you can use Molek or MolekFamily, it doesn't matter.

  • Maybe two sprites on a layer that only become visible where they overlap?

    Yes, put both sprites - the one you want to reveal and the mask - on a separate layer, enable own textures and set a blend mode on the mask. See the Blend Modes example in the editor, it demonstrates all modes.

  • Strange thing number 2 is that even the example from Construct editor.construct.net is not working. It can unlock levels, but the clear button does not work until the project is reopened. I even tried to force restart the layout by pressing the button after clearing, but nothing changed.

    The layout is restarted already, but the array is not cleared. Simply add this action to the last event:

    -> System: Set gameFirstExec to True

    This will force reading the array from LocalStorage, and because the key is removed from LocalStorage, the array will be filled with default values.

  • That's not a script, that's Construct code in pseudocode. You can re-create it with events on the event sheet.

    You will need to use a family to allow picking two instances of molek independently in the same event, and then to check if they overlap each other.

    This event won't work because the same instance of molek can't be attached and not attached at the same time:

    Molek is attached
    Molek is NOT attached
    Molek overlapping Molek

    That's why we use families:

    Molek is attached
    MolekFamily is NOT attached
    Molek overlapping MolekFamily
    
  • even though the type is strictly set to "number"

    Textbox always stores text, no matter what type you set.

    To convert to numbers use int(Textbox.text) or float(Textbox.text)

  • What do you mean? Where what would go?

  • We do this in Moonstone Island.

    Our world is made up of individual islands (tilemaps) arranged on a 10x10 grid, so the JSON looks like this:

    {"island1_1":{objects}, "island1_2":{objects}, "island1_3":{objects}, ...}

    Based on the character's location in the world, we create the corresponding tilemap or multiple tilemaps and all their objects.

    1. Look at a small zone around the player (about 1000px in each direction). If an island in that zone doesn't exist yet, it gets created together with its objects.

    2. Check for islands that are far away from the player (more than 2400px). Those distant islands, and all objects on them, get destroyed.

    This way, only a few islands (usually 1-2) are loaded at any given time, depending on where the player is.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 273 followers

Connect with dop2000

Trophy Case

  • 9-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

29/44
How to earn trophies