question

christoph gruber avatar image
0 Likes"
christoph gruber asked christoph gruber commented

Label reset without function

I have to count people on different doors in relationship! But the reset function does not work. Version 19.2.3

labelreset.fsm

people flowon resetreset labellabels automatically reset
labelreset.png (134.4 KiB)
labelreset.fsm (139.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image
0 Likes"
Phil BoBo answered christoph gruber commented

This looks like the Automatically Reset Labels isn't working correctly on Prop objects. I'll add a case to the dev list.

It looks like the OnReset trigger for Prop objects is also not firing, which is a bug too (and probably related).

Thanks for pointing this out. You can use Benjamin's suggestion to develop a workaround in the meantime.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

christoph gruber avatar image christoph gruber commented ·

Thank you @phil.bobo

....and sorry all for my small english knowlegde to discribe a problem perfectly ;-)

1 Like 1 ·
tannerp avatar image
0 Likes"
tannerp answered Phil BoBo converted comment to answer

Hi @christoph gruber,

You have two conflicting reset values. There's the one in your trigger that's trying to set the value to 0:

The other one is trying to reset the value to 1:

Apparently, the latter is winning. I would just use the "Automatically Reset Labels" to accomplish this and set the value of count to "0" rather than "1".


reset-to-0.png (13.5 KiB)
reset-to-1.png (17.6 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

christoph gruber avatar image christoph gruber commented ·

Hi @Tanner Poulton no, it doesn´t work! Also if you only use "Automatically Reset labels" it doesn´t work. It must be a bug. You can set the value of count to "0", run the model and reset. You will see that the value of count will be "1" instead of "0".

0 Likes 0 ·
Benjamin W2 avatar image Benjamin W2 christoph gruber commented ·

Hi @christoph gruber,

I think that Tanner is right in that the Label and OnReset trigger are conflicting. To avoid this, delete the OnReset trigger in the object. Then, in your toolbox underneath "Modeling Logic\Model Trigger", click "On Reset".

Add the following custom code:

Model.find("Exit1").labels.assert("count").value = 0;

This should give you the behavior you are looking for.

onresetmodel.fsm

0 Likes 0 ·
onresetmodel.fsm (40.2 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.