Magistross's Forum Posts

  • Try this expression :

    Play sound : "gun" & (counter < 3 ? "1" : "2") & ".ogg"

    Then set the counter with this expression :

    Set counter to counter % 3 + 1

    (The pattern would be "gun1.ogg" - "gun1.ogg" - "gun2.ogg")

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If your JSON string is correctly written (and it seems so), you can load it into an array using the JSON - Load action. Just provide the AJAX response as your string. Once it is loaded, you'll only have to index your array accordingly. (i.e. (0,0) for first question, (0,1) for first answer, etc.)

  • Object referencing is usually done via UID. But you need families to be able to reference through multiple kind of object at once, thus the need to upgrade to the paid version.

    There IS a way without it though, but you'd have to do one of the two possible alternatives :

    -All "monsters" are the same sprite object (with multiple animations)

    -Duplicate all events for each kind of monster

  • Two sine behaviors would do the trick too. Just set one behavior with a period offset of 25% for anti-clockwise rotation and 75% for clockwise rotation.

  • Having a loop with a pause between iteration kind of defeats the purpose of the loop altogether. I'd use a variable to keep track of the index instead of curX and do the positionning with the timer behavior or something equivalent.

  • It works fine for me. But the only thing I can say is that algorithmic heavy process like this should be done directly in javascript with a plugin or behavior.

    List tokenizing and operation like find() is probably what is slowing you.

  • Here's how you can do it :

    --Some initial picking conditions

    --For each object order by object.IID ascending

         -Some actions on the first picked object with the lowest IID

         -Stop loop

  • You should usually do the picking BEFORE the for each, no need to iterate through objects that does not meet the PartsActive > Self.PartsMax condition.

  • (possibly wrong)

    Most certainly wrong I'd say ! The function aims at destroying the furthest part of a particular program. The way it is right now, it destroy the furthest part only IF it is of that particular program.

    Guess you found the problem ! <img src="smileys/smiley2.gif" border="0" align="middle" />

    (Don't forget that if you keep it function embedded, you must call the function in a for each loop !)

  • Submit us your actual problem, in a simple capx.

  • I replied to the post you mentionned. It's not a picking problem, it's just that functions aren't called iteratively for each picked objects as you might think. It's one of those case where you have to explicitely iterate through your objects with a for each.

  • I checked your function "DestroyFurthestPart", and you're only calling it once. Everytime your condition is met, be it by one or more instances of the family PlayerPrograms, the function will only be called once, with the first instance that meet the condition. You should do a for each family member under the condition PartsActive > Self.PartsMax.

  • Only way I see to pick instance by lowest/highest value is with a for each (ordered) and a stop loop thereafter.

  • That's pretty much the same formula without using the angle ! <img src="smileys/smiley2.gif" border="0" align="middle" />

    Tan(angle) = (y2-y1) / (x2 - x1)

    Replacing that in my formula, we obtain the same thing ! Maybe there's something wrong with the angle() function... Nevertheless, you're better off without it !

  • Oh, so you can have multiple identical entries ? How about a function that return a string with all matching index concatanated with a separator ?