dop2000's Recent Forum Activity

  • Thank you very much for the example. So depth translates to the different pages?

    It's up to you how you organize your data in table format. Pages may represent a parent object in JSON. (shops in my example above) I also often try to split big arrays into multiple pages, simply because it's easier to read and edit than one huge wall of numbers.

    And of course not all JSONs can be done this way, I have a few plain-text JSON files in my project as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • We're you able to see my other reply to you?

    Looks like I missed it.

    I'd like the transparency to happen when the player is about a quarter or so up the buildings length so it looks the the building is grounded on the floor.

    You can add additional conditions to the "Is overlapping" checks. For example, check that Player.BBoxBottom<=Building.BBoxBottom

    You can also pin an invisible sprite to each building with a slightly smaller collision mask than the building. And check for overlapping with that sprite.

  • Press F12 and check the console log - it should tell you exactly why the project can't be opened.

  • To enter data I use the array editor in C3, because it's convenient and you can copy/paste values from Excel or Google Sheets.

    And then on start of the game I convert this data to JSON, because it's much more flexible and easier to work with than arrays.

    Here is an example, the ShopStock array, it contains multiple sheets for different shops in the game. The first cell contains the name of the shop - "Blacksmith".

    On start of the game I'm loading this data into a temporary array and then parsing it into this neat JSON format:

    {
     "Blacksmith": {
     "copperaxe": {
     "Price": 2000,
     "Materials": [{"ingotCopper":3},{"axe":1}],
     "Quantity": 1
     },
     "copperhammer": {
     "Price": 2000,
     "Materials": [{"ingotCopper":3},{"hammer":1}],
     "Quantity": 1
     },
     "ironaxe": {
     "Price": 5000,
     "Materials": [{"ingotIron":3},{"copperaxe":1}],
     "Quantity": 1
     }
     },
     "Greenhouse": {
     "plantPurpleHeart": {
     "Price": 2100,
     "Quantity": 1,
     "Randomize": 1
     },
    .......
    
    

    I can then access any product in any shop using ShopStock.get("Shop.Product") expression, I can add new keys to JSON, remove products etc.

  • That's pretty terrible and makes little sense. Please change it like this:

    And if you not using those variables (1stplacescore, 2ndplacescore etc.) anywhere else, then you can even delete all sub-events. All you need is just the first line.

  • Oh and is the Trigger in the Systems Action?

    Do not use Trigger Once when you have multiple buildings! This demo explains why:

    dropbox.com/s/xdsme1i8f817gf4/TransparentBuildings.c3p

  • CHeers. Does On Enter pressed work though if you have multiple input boxes?

    Yes.

    Do I simply put a string "textInputID" into the ID parameter of each textinput object?

    Yeah, you have to give them unique IDs and call this code for each textinput. There are perhaps ways to optimize it, but I don't know JS.

  • It's easier if you use text variables - Loot=sword. Otherwise, if you have many loot types, you'll forget what all those numerical IDs correspond to.

    So if you define this Loot variable on the Enemies family, you can specify which enemy carries which loot, either directly on the layout, or when enemies are spawned.

    When an enemy is killed in Enemies On Destroyed (or in a similar event) you can do this:

    Enemies compare variable Loot=sword : Spawn a sword
    Else Enemies compare variable Loot=gold : Spawn a coin
    

    You can even put the exact name of the sprites which should be spawned in the Loot variable, and then use "Create object by name" action.

    Enemies On Destroyed : Create Object By Name Enemies.Loot
    
  • "On Enter Pressed" still works for me when cursor is in a text input.

    To stop the Tab key to move focus to another text input you can try this code, but it only works with Worker disabled:

  • Here is a solution (not mine) using a bit of JS:

    dropbox.com/s/16cj2nyykhhxcby/sort_different_object_type.c3p

    Be aware that it may work slower than the system "Sort Z order" action.

  • lilOptionz You don't need to pick instances inside the "For Each" loop. Like I said, this loop processes one instance at a time, so the instance is already picked! Just use "Compare Two Numbers loopindex=0" condition.

    Your events where you are trying to pick players by comparing loopindex make no sense. Also, expressions like loopindex(1)&loopindex(2) are totally wrong, loopindex doesn't take numerical argument.

    And as lionz mentioned, you shouldn't run this code on every tick, make sure it's executed once when needed, for example when a layout with scores is opened.

    Try changing the code like this:

  • Have you checked memory usage in the Task Manager? It may be a memory leak, I've seen this before, here is an example:

    github.com/Scirra/Construct-3-bugs/issues/5503

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-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

30/44
How to earn trophies