BinaryPanda's Recent Forum Activity

  • Yeah have it working that way too, but was trying to add in some other checks and thought the for loop would allow me to get those things working easier. Clearly not

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Could someone explain what this for loop is doing when executed in construct?

    sounds a silly question but its doing strange things.

    Cant seem to get predictable behavior from it. All I want to do is

    when something happens

    from 1 to variablestorednumber

    every 1 second

    ---------------------------- do something

    if i repeat it once for an action what i get is the the loop seems to just jump to the end, no matter how i play around with it.

    And if i dont do that it just keeps counting up.

    Cant seem to find a working example of the for loop about.

  • Thanks for your help talking this through.

    Think I have it working now, Just testing all the numerous states it can go wrong in.

  • Here is a graphic of what I have set up as basics, hope that sheds some light on what I am doing wrong.

    [attachment=0:2kij3mny][/attachment:2kij3mny]

  • Well when i try and enter the user name or channel address i get the browser going to this:

    YouTube /user/Binary%20Panda%20Games

    or

    YouTube /user/UCFV3603aS565w1bc7GWw1Kw

    What i need is it to say "channel" where the "user" currently is in the web address.

  • Thanks for the reply.

    I think this is pretty much what i have set up, but am using a boolean to change the state of the chest.

    I am spawning characters which have the bullet behavior and then setting their angles to the chest they have picked. If no chest in sight then they do something else until a chest does come into sight.

    I have something like this:

    for each character that hasnt picked up a chest

    chest/pick nearest to character (pick nearest one to character)

    chest/chestFALSEchosen (has the picked chest already been chosen by a character)

    character has LOS to chest

    ----- action ---- chest/set chosenTRUE (set boolean on chest to have been chosen)

    chest has NOT been picked up by player

    chest chosenTRUE (chest has been chosen by a character)

    character has LOS to chest

    ----- action ---- character rotate angle towards chest (set the character towards that chest)

    (sub events under the above)

    stuff when the character gets within certain distances do certain things

    when character is on top of chest set the picked up boolean to TRUE

    add the chest count variable

    destroy the chest

    what seems to be happening with that is the spawned characters are still able to be given the same chest to aim at, if i collect it first they then aim at the next closest chest to them.

    what i need is pick nearest that hasnt already been picked then move onto the next nearest if it has, but i dont think the picknearest is behaving like that.

    Under the For Each Character at the top of this page, If the condition of "chest chosen" is TRUE in the same block (where it should be false to get the action to work) then I think it skips the action part associated, which is why i was thinking of storing and comparing the UID of the chests etc At the moment all characters seem to be picking the closest chest to them no matter what.

  • Hi,

    Am I missing something in trying to set the YouTube address in the forums profile?

    Once you enter your YouTube name and then click on the icon It links to a YouTube User and not a YouTube channel. So in effect doesn't work for my channel.

    Regards.

  • Just trying to think of a way to achieve this.

    I want each character (of the same character) to aim towards the nearest object, if that object has already been aimed at by one of the characters I want them to aim at the next closest available object of the same type.

    So far:

    I have a number of the same characters trying to pick up the same item (i dont want this because...). For example in a room full of chests 3 identical characters try to take one treasure chest. I need to reduce the chest count when collected but instead of just taking a -1 since all 3 characters get to it at the same time they –3 from the count instead of -1. this leaves just one chest removed and -3 from the count.

    In short i am doing this:

    For each character on the screen i am picking the closest chest and moving the character to it. If that chest goes before the character arrives (e.g. player collects it) then the character picks the next closest chest etc. The problem happens when several characters overlap and get close to a chest. I have the events triggered on a distance the character gets to the chest, so when they are a certain distance it triggers certain events, and when very close the chest is seen as picked up so destroyed and minus the chest count etc.

    i am using the pick nearest for character movement but this is where the problem lies in that more than one character can pick the same chest to aim at causing the issue. I was trying to think of a way to use the UID of the chests and not to let the characters pick it if the previous character has already spotted it and assigned it to an instance variable, but cant seem to see how to work that in construct.

    If anyone has any ideas, would be helpful.

    Thanks

BinaryPanda's avatar

BinaryPanda

Member since 11 Sep, 2014

Twitter
BinaryPanda has 6 followers

Connect with BinaryPanda

Trophy Case

  • 10-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Email Verified

Progress

13/44
How to earn trophies