dop2000's Recent Forum Activity

  • You can do it in a loop. For example, if you need to check in 10 degrees intervals:

    Repeat 36 times
     Car.MoveTo.MovingAngle within 5 degrees of (loopindex*10)
     	Car set frame to loopindex
    	Stop loop
    

    I don't quite understand how the animation is made in your case, so you might have to set the frame to something like (36-loopindex).

  • Check out "3D castle maze" template added in the latest beta.

  • Well, you can clear browser cache and storage. I meant you can't delete save slot from events.

  • No, it's not possible.

  • Try this:

    v1>50
    OR 
    v2>100 Deactivate group
    
    Else
    v1<50 Activate group
    
  • It works without "array" key, then the path will be just "0.3"

    But make sure there are commas between sub-arrays in JSON:

    [

    ["111","112","113","114"] , <- comma

    ["121","122","123","124"] , <- comma

    ["131","132","133","134"]]

  • I would not recommend using dot in the key name.

    Also, it's easier to put JSON string into a variable, then you won't have to deal with escaping all quotation marks:

    String variable j={"key": "foo"}
    
    On start of layout 
     JSON Parse j
    

    Yes, I'm doing this as part of iterating through a foreach-loop.

    You need to post your project file or at least a screenshot of the full event sheet. When you show just one or two events, it's not possible to guess what might be wrong in the rest of your code.

  • If your JSON format is this:

    {"array": [["111","112","113","114"], ["121","122","123","124"], ["131","132","133","134"]]}

    you can access each value that you need using these expressions:

    JSON.get("array.0.3") - will return 114

    JSON.get("array.1.3") - will return 124

    JSON.get("array.2.3") - will return 134

  • Have you tried oosyrag's version? It's pretty cool.

    Here is with LOS raycasting:

    dropbox.com/s/djkilpaho46uuch/BorderAim.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > If the events are at root level, they are executed on every tick.

    Why are they excluded?

    "Executed", not "excluded". Because that's how Construct works. All events are executed on every tick, unless they are triggers or functions.

    It's all local, so nothing is fetched remotely. All I'm doing is loading in a local JSON file that is embedded with the project.

    It still may require 1-2 ticks to be fetched, or maybe even longer on a slower machine. So you should not start checking JSON keys until it finished loading!

    Try this code:

    JSON has key "maps.test" -> Browser Log "HAS key, "&tickcount
    Else -> Browser Log "NO key, "&tickcount
    

    Open browser console and check the messages. You will probably see a couple of "NO key" before "HAS key" appear.

    I keep running into strange scenarios...

    JSON.CurrentKey works only inside "JSON For Each" loop. If you need to get current path outside the loop, use JSON.path expression.

  • When then I don't understand what you are struggling with. Where do you store these JSON strings after you get them from the server? What is the JSON structure?

    In pseudocode, you need do something like this:

    Array For Each X element
     JSON Parse (string for this X)
     Array set at X=Self.CurX, Y=1 value:JSON.Get("key_for_Y1")
     Array set at X=Self.CurX, Y=2 value:JSON.Get("key_for_Y2")
     Array set at X=Self.CurX, Y=3 value:JSON.Get("key_for_Y3")
    
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