0 Favourites

How do I Picked Count

  • It's basically a 2d tower and I'm counting on the y coordinates of each room to measure the amount of current staff on that floor however I'm getting wacky numbers sometimes. For instances I'll get a staff count of 1 if there is no one on the floor, so I assume its not picking correctly.

    Goal: To get an accurate count of instances of different types for each floor. The instances I refer to are staff, for example the valet.

    Note: The Staff_Valet family instances are also part of two other families which I'm using for movement and things so perhaps that's what is affecting things. Other times I'll get a picked count of 5 and no one is on the floor so I assume this has something to do with it

    Anyway I feel like I'm missing something obvious, I'm not narrowing the pick well enough so I thought I'd ask for a suggestion.

    The sub event where CurrentValet = 1 is because regardless of whether or not there are any staff on that floor it would set the picked count to 1 so I tried to counter it.

  • Hi, could you create a sample capx to show the problem?

    edit: never mind, have a look and see if this is close to what you want. I notice you are comparing absolute Y values which will not often match up exactly.. Here I'm just using an offset of 10 above and 10 below.

    [attachment=1:1olrbh79][/attachment:1olrbh79]

    (I'm just setting a textbox with the picked count of each floor).

    [attachment=2:1olrbh79][/attachment:1olrbh79]

    The I Must Be Bored version

    [attachment=0:1olrbh79][/attachment:1olrbh79]

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Hey there! Thank you for responding and with examples!

    So I was watching yours for a while and when all the valets finally left a floor floor the picked count was still 1 (on the room instance) which doesn't make sense if its tied to the text.

    (it cut the full image but the bottom right in the debugger shows current valet = 1 here's the direct link)

    http://i.imgur.com/b2AFRTM.png

    It seems that if any instance ever enters a floor the picked count will always be at least 1. I'm guessing it's something behind construct. Anyway the text picked count seems to be correct. I tried to take a recount of floors whose staff count was 1 even if it was zero thinking it might change but to no avail. I'm going to keep playing with it

  • Hey there! Thank you for responding and with examples!

    So I was watching yours for a while and when all the valets finally left a floor floor the picked count was still 1 (on the room instance)

    No problem. hmm I'm not entirely what you mean the picked count (on the room instance) still being 1. The text just displays the rooms.current_valet value, which is set from staff_valet.picketCount. Yea my demo is a bit rough but I thought it was enough to show the relevent info. Anyway good luck with it

  • Updated my original post with an example picture, the debugger shows it as still having a value of 1 which is curious

    http://i.imgur.com/11DaKyN.png

    another picture with the text at 0 and the room instance at 1

    Anyway, thank you for looking into it XD

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)