dop2000's Forum Posts

  • It's hard to make sense of your code without seeing the project file and the structure of txt file with questions.

    If you need a randomized array, you can initially set array width to 0. Then read a new question from AJAX and insert it at index int(random(array.width+1))

    Or you can load all questions into the array at Y=1, put random values into Y=0 and then use "array sort".

    Or load all questions into temp array, then pick a random element, push it into another array and remove from the temp array. Repeat until all questions are transferred.

  • In real world or in a game?

  • You need to change the loop to "For each X element". This will not fix the problem (if there is any), but it's more efficient.

    You're monitoring only one fixed array element with browser log - CraftingTable.At(1,2). Try changing this to CraftingTable.At(CraftingTable.CurX,2)

    Also, have you tried Debug Mode? You'll be able to see the entire array.

  • R0J0hound Thanks! That was actually my second question - how do you chain two curves, or make a curve from 4 or more points?

    I tried drawing a second curve from where the first stopped, but it obviously didn't work that well.

  • Use System condition "Is between angles" instead of "Compare instance variable" in your TouchPad group in events 121-142.

    Also, in event 121 you have a mistake, the range should be -22.5 to 22.5

  • It does work:

    dropbox.com/s/ml7mf2upjz5vy5d/PinPlusDemo.capx

    You can do the same with events, of course. It's just easier with the behavior if you want to "pin" many different properties.

  • R0J0hound Your method works great, as usual. :)

    The only small correction - "set t to loopindex/9"

  • There is also Pin+ addon, which allows you to pin to image point, takes care of mirroring, scaling etc.

  • In sprite font you can get the size of each character, space width, line height etc. This allows you to calculate position of any words in the text, but in a big multi-line text with word wrapping it may not be a very easy task.

    How do you currently scroll the text? Do you have a really tall text object and scroll the entire layout?

  • Your question is too general. You might need to use instance variables, "For each" loops, Timer behavior etc.

    Search for "AI" in the Tutorials section, there are lots of examples there:

    scirra.com/tutorials/all

  • You can pick sprites by animation name. If you want to continue using the family, you'll have to add a bunch of events for creating individual weapons, there is no workaround for this in Construct 2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See this chapter from the manual:

    scirra.com/manual/83/variables

    Local variables are often used when you need a "temporary" variable in an event for some calculations. Note, that local variable is reset on the next tick, so if you use "Wait" in the event, the variable will be reset after it.

    If you need the variable to not reset, you can set it as Static. For example, you can create an event group Audio, add local static variable MusicVolume there. This variable will only be accessible inside the Audio group (which is good, because you don't need it anywhere else) and it will not be reset even if you reset all global variables.

  • I did it! Don't ask me how, but it works..

    dropbox.com/s/8ae8h948w8jt1sa/SineRopeChangeMagnitude.capx

  • Do you mean screen coordinates (x,y), or position (index) of a word in text?

    Text is rendered differently, so it's a really difficult task to get correct screen coordinates with text object. You can do it with sprite font though.

    If you just need to know the position of a sub-string, use find() expression. For example, find("ab cd ef", "cd") will return 3.