oosyrag's Recent Forum Activity

  • Ok so there's a few problems here, in no particular order"

    Don't use physics unless your whole project is physics based (or you really really know what you're doing).

    Your platform with the sine shaking is probably causing multiple collisions and resets. It is often

    Avoid using wait, it simply delays the actions and doesn't stop events from running in the meantime. Better to use timers and timer triggers for anything that needs to happen over time.

    Using instance variables along with the timer behavior to keep track of the state of various objects could be useful as well. I put together an example for you, hope this helps. dropbox.com/scl/fi/ngmk87fvah1ykacwttsli/fallingplatformexample.c3p

  • Set their origins so that they are all at the same coordinate and aligned. Or use the pin behavior to pin the pieces together.

  • Trigger once only works when there are other conditions with it.

  • In the event that destroys the platform, spawn a new one at it's original location.

    You can keep track of it's original position with a pair of instance variables or an invisible helper sprite.

    An alternative would be to not have the original platform fall at all, just make it invisible, turn off solid, and spawn a dummy sprite to fall instead. Then make it visible and solid again later.

  • Is your target sprite origin in the right place? Or are you targeting an image point?

    If you use move to direct and handle your own waypoints, it should be more precise, but they'll slow down and stop at each waypoint.

    Otherwise if you need precision you can try using tween instead, which will be exact.

  • dropbox.com/scl/fi/k3leq691iv54oeiq2hzz0/dictionaryjsonexample.c3p

    Yeah if you want to just display the actual key for the key code no need for a dictionary/json. But if you want to remap keys, this is when it would be useful.

  • Yes, you can still save the dictionary as a JSON, edit it as text, and then load it back into a dictionary.

    You can get to the key either way, it's just easier if you use the dictionary object.

    Do you have a sample json available? I can make an example to get to the value both ways, and you can see the difference.

  • Generally speaking, you do a JSON for each, along with a system compare two values, json.currentvalue = value.

    Depends on the format of your JSON though, if you can loop through objects at a path.

    Considering you saved the json with the dictionary object though, it would make more sense to load the json back into the dictionary object, and use the dictionary.get(key) expression.

    Seems kinda silly to use the dictionary object to save as json to try to parse it as json and manually recreate the functionality of the dictionary object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made an attempt to refactor and simplify the example, as well as allowing it to be more flexible in terms of number of ingredients, and ended up redoing it in a way that made more sense to me. Maybe this might be of use to you.

    dropbox.com/scl/fi/cg7xje8s2lw9tq063uicx/dragdropcraftingexample.c3p

    Instead of using global variables, there is now a second array to keep track of matching ingredients, which allows for recipes of any size. This array is also used to delete the used ingredients by UID, so the instance variable that kept track of "used" is no longer necessary either.

    The overlap array now keeps track of both the item id and the UID of every overlapping item, so that each individual instance is kept track of.

    The JSON format for the recipes changed a little to make it more flexible as well. The ingredients list is now stored in an array inside an "ingredients" object, which can include as many ingredients as you want, without having to define id1, id2, ect.

    So it looks like this now.

    "recipes": [
    	{	
    		"ingredients": [0,1,2],
    		"result": 3
    	}
    ]
    

    Edit: Updated the example so it shows how to load json from multiple files, since I would personally keep them separate in an "items.json" file and a "recipes.json" file.

    Note that recipe matches are currently prioritized by first valid match. If I were to improve on it I would probably design the crafting system so that the order of the recipes in recipes.json doesn't matter. Basically account for conflicts to prevent situations where there may be two valid recipes ahead of time (such as defining what happens if you have a and c overlapping already, and drop a b onto it when you can have the recipes a+b=c, and a+b+c=d).

  • Rather than layouts, you probably want to hide and unhide layers for the local peer.

    Layouts will break object syncing - that is the host will attempt to sync objects regardless of the layout state of the peer I believe.

    It is possible, but you'll probably end up with a custom syncing system in the end.

    Alternatively, you can move the viewport of the local peer to an area not relevant to the main multiplayer game. This might work with layouts as well.

  • I thought the instance being dragged (item) wouldn't get set to used without the additional action, as opposed to the overlapping instances (items). But if it works without it that's fine too!

  • Afaik yes. Room connections should be completely independent from layouts.

    But object syncing becomes more complicated by a significant degree when trying to use layouts in a multiplayer project.

oosyrag's avatar

oosyrag

Member since 20 Feb, 2013

Twitter
oosyrag has 39 followers

Trophy Case

  • 11-Year Club
  • 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
  • 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
  • Email Verified

Progress

21/44
How to earn trophies