dop2000's Recent Forum Activity

  • Scirra website is very slow, the link does work, just try again.

    If you are reading the questions from AJAX, you need to load them all into the array first:

    Array set size to X=0, Y=1, Z=1

    For x=0 to (tokencount(AJAX.LastData, "|")-1) : array Push trim(tokenat(AJAX.LastData, loopindex, "|"))

    Then pick a random index from the array:

    System -> set RandomIndex to int(random(array.width))

    Then print the question:

    function -> Call "show" (array.At(RandomIndex))

    Then delete this index from the array:

    Array -> Delete index=RandomIndex

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley

    Like I mentioned in my bug report, I ran tests on two different laptops (Windows 8.1 and Windows 10) and with two different gamepads - Logitech and Phillips.

    On both machines and for both gamepads the Right analog Y axis didn't work in Chrome.

    Maybe the Xbox 360 does work, but all other gamepads don't?

    NetOne

    I just tried axis numbers from 4 to 10 - no luck.

  • Then I suggest you start with tutorials, there are lots about using the arrays.

    https://www.scirra.com/tutorials/all

    To add a question to array:

    Array-> Push "Question text"

    To pick a random index:

    System -> set RandomIndexVariable to int(random(array.width))

    To print picked question on the screen:

    TextObject -> set text to array.At(RandomIndexVariable)

    To delete this index from the array:

    Array -> Delete index=RandomIndexVariable

    I also highly recommend using Debug Mode (Ctrl-F4) - it will allow you to monitor the contents of the array, variables etc.

  • You can add all questions to an array. Pick random record, display it and then delete it from the array.

  • This may be easier to do with another behavior - Car or 8-direction.

    If you need to use Bullet, you can add two Bullet behaviors to the same object (rename them BulletMain and BulletDrift) and then do something like this:

    (click)

  • I'm not sure what you mean. How do you "change the angle, but not rotate"?

    Do you want to set only the fixed angles - 0, 90, 180 and 270 degrees?

    You can do something like this:

    System-> Is between angles -> Sprite.8Direction.MovingAngle between -45 and 45 : Sprite set angle to 0

    System-> Is between angles -> Sprite.8Direction.MovingAngle between 45 and 135 : Sprite set angle to 90

    etc.

    Or you can create different animations or animation frames for each direction:

    And then switch between them depending on MovingAngle, using the same method as above.

  • What do you mean by "as Sprite"?

    9-Patch works in C3 similar to Sprite, but with some limitations - it doesn't support rotation, collisions and some other events/actions.

  • Your code should work, however since you have to pick all buildings in On Timer event, I suggest you move your Timer behavior to some other object (which you only have one instance on the layout, for example Map sprite).

    In event 79 you don't need "Pick all person" condition.

    In event 80 you don't need to compare person.Build_ID with building.Build_ID, since you've just assigned it, so this condition will always be true.

  • What behaviors you are using to move the ball? (drag&drop, 8-direction etc.)

    Please post your capx or a screenshot of your events.

  • You can start a Timer "Find_Builder" for each new building, say for 1 second.

    On Timer event try to find an available builder. If not found, restart the Timer.

    (Make sure to use "For each Building" in On Timer event, as it may be triggered for multiple building instances at once)

  • It's hard to tell what's going on by these screenshot. My guess is the event 76 is triggered multiple times and multiple people are marked with status=1.

    Event 79 is definitely wrong. Condition "Build_ID=Person_Build_ID" checks instance 0 of person object only! So if there are many people, this event will almost always be executed on every tick, clearing Builder_On_The_Way state.

    If there are multiple buildings being constructed, event 78 may move the Pathfinding_Destination sprite from one building to another on every tick.

    In other words, it's a mess

    I suggest you put Brower.Log into these events and output some debug info, then you'll be able to see how everything works.

    Object.PickedCount is a useful expression, it can tell you how many instances are picked in each event.

    I would change these events completely. Testing a bunch of instance variables for lots of objects on every tick is bad for performance and it's hard to program these events correctly.

    Use triggered events! When player clicks on the map to put a new building, pick all free people (with status=0), then pick one that is closest, direct it to the building site, set status=1.

    On pathfinder arrival, change status to 2, start building. On completion, set status to 0.

  • So you want the brick to move 32px and stop?

    I suggest MoveTo plugin by RexRainbow.

    https://github.com/rexrainbow/C3RexDoc/tree/master/repo

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