Jump to content

[CLOSED] Creating Label that shows List String


jdoran

Recommended Posts

I just want to make a label that outputs a list string, given a list state number. Similar to the Busy, Transporting, Failed list state types objects have.


E.G. Have a label over a vehicle, that says "Transporting" while it is moving, "Failed" when it has failed... etc.


The only way I can see how to do it, would be to make my own table, and do a search in it using the resource state number.


Will post back if I find it before someone else posts.

Edited by Guest
Link to comment
Share on other sites

Guest DanSpice

That function does not currently exist. I have added it to our backlog, It should not be very difficult to implement.


Right now you can use Vehicle1[X].ResourceState (Where Vehicle1 is just an example vehicle name, and X signifies the population member) - or just 'ResourceState' if you are attaching the status label - but this returns the numerical value of the Resource State...for example 0 means Idle, 1 means Busy, etc.


You can manually convert these numeric values to words using an If statements similar to:


Math.If(ResourceState == 0, "Idle", ResourceState == 7, "Transporting", " Busy") <-In an attached label.



Thanks,

Link to comment
Share on other sites

That function does not currently exist. I have added it to our backlog, It should not be very difficult to implement.


Right now you can use Vehicle1[X].ResourceState (Where Vehicle1 is just an example vehicle name, and X signifies the population member) - or just 'ResourceState' if you are attaching the status label - but this returns the numerical value of the Resource State...for example 0 means Idle, 1 means Busy, etc.


You can manually convert these numeric values to words using an If statements similar to:


Math.If(ResourceState == 0, "Idle", ResourceState == 7, "Transporting", " Busy") <-In an attached label.



Thanks,

I was afraid you would say that. Thanks anyway though. Looking forward to that feature.


In my instance, I have a list state of about 30states (last I checked). So this if statement is quite hefty, and a pain to update across all instances of the label.

Link to comment
Share on other sites

In my instance, I have a list state of about 30states (last I checked). So this if statement is quite hefty, and a pain to update across all instances of the label.

While an If like Dan suggested but with 30 clauses would certainly be tedious to create, I think you could do it once in a Function, perhaps named StringState that returns the string. Then in all of your objects you simply reference StringState.

Link to comment
Share on other sites

In my instance, I have a list state of about 30states (last I checked). So this if statement is quite hefty, and a pain to update across all instances of the label.

While an If like Dan suggested but with 30 clauses would certainly be tedious to create, I think you could do it once in a Function, perhaps named StringState that returns the string. Then in all of your objects you simply reference StringState.

That's a good work around. I had forgotten about functions in this kind of situation.

Link to comment
Share on other sites

  • 7 years later...
×
×
  • Create New...