Magistross's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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 ?

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