Magistross's Recent Forum Activity

  • Problem is when you start from the "Start" layout, the text instance doesn't exist yet, so "getFirstInstance()" returns null. When you try to use your global variable "statusTextInstance", it then fails from a null reference error.

    What you could do is simply set the global during the start of the "Print" layout, or using the "on created" trigger of the text instance.

  • Eren basically took under his belt the maintenance of this addon with his fantastic C3 runtime conversion. Let's see if he's still active to adapt it to the new module mode for external scripts.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Might be simpler to just check the "PickedCount" expression under the overlapping condition.

    + Circle: Is overlapping Square

    + System: Square.PickedCount >= 2

    -> (Do something)

  • I feel like we exchanged mails recently. Haha !

    What dop2000 means is that you usually preload all JSON data on the loader layout, storing it in either variables, global dictionary and such to be parsed later, or you can also load the data directly in its corresponding object.

    However, knowing what your use is, you will probably have to end up storing the JSON as text, and parse it on demand depending on what files (dialogues) you currently need.

  • I recommend using a dummy layout where you place a single instance of every object. That layout will never be used in runtime, but you can use it in the editor to edit default values of instance variables for example.

    I find that Construct usually dislikes and/or behave strangely when using objects that have 0 instance at edit time.

  • You can also use Mouse.AbsoluteX and Mouse.AbsoluteY to get coordinates relative to the game window (or canvas) and not the layout.

  • I'm not sure I understood exactly what you were trying to do, but here's my take.

    drive.google.com/file/d/1Om-Qr8qDfzjRqzDde0NpOvgG-iIgliSp/view

    I load the array from the JSON, and pick 4 pairs of x-index 0 and 2 from the 653 possibilities. I load x-index 0 as "word" and x-index 2 as "meaning". Those get shuffled randomly, left side for "word", right side for "meaning". You have to match each "word" with its "meaning" to get points.

    Note that you can't create multiple permutation tables at once, so I had to store some in arrays (namely, slots for "word" and slots for "meaning").

  • It seems you are using height for your expanding axis, so in that case, you should be using the permutation table value on the Y axis.

    Also, shuffling the permutation table as soon as it is created is pointless, as it is already randomized on creation.

    Keep in mind that using AdvancedRandom.Permutation(0) will always give you the first index. You should probably be using a variable (instead of 0) to keep track of which permutation you are currently using.

    If you share your c3p with a broad description of what you are trying to do, I might be able to help you further.

  • AdvancedRandom.Permutation(0) gives you your first random index. So let's say you need to get values from an array, you'd use something like Array.At(AdvancedRandom.Permutation(0), 0).

  • When you want to pick more than 1 element in a list of n elements with no repetition, you should think of a permutations table. The "Advanced Random" plugin makes it very easy to implement such a thing.

    If you have 6 matching pairs, you create a permutation table of length 6 starting at 0. It will create an array of values from 0 to 5 in a random order (basically, your indexes). You can then use AdvancedRandom.Permutation(0) to get the first random number, AdvancedRandom.Permutation(1) for the second, etc. assuring no repeating number.

    You can then use these values to index either your dictionary or array, depending on what you ended using.

  • A few things:

    1. First, the text object must be white for this to work.
    2. Second, the colorRgb value assignment must use proper array syntax, brackets instead of parentheses.
    3. Finally, you should use values between 0 and 1 in your array, so red is [1,0,0].
  • > The path you are using is not correct

    >

    > JSON2.get(".recipes" & loopindex) probably will work

    > It depends on the content of your json file though.

    Interesting. Thank you for pointing that out. Does this mean that the parent "JSON part" (like the parent header) must have a "." before it? I thought it didn't need that, since it is at the very top.

    No, your path is correct, but returns an object like I mentionned earlier, and you can't use "Get" to retrieve its content. Top level absolute path never begins with ".", you only ever begin your path with "." when you are working with relative paths, like in a "for each" or by using the "Set path" action.

Magistross's avatar

Magistross

Member since 4 Jul, 2011

Twitter
Magistross has 14 followers

Trophy Case

  • 13-Year Club
  • Entrepreneur Sold something in the asset store
  • 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
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies