question

Osama A6 avatar image
0 Likes"
Osama A6 asked Connor A commented

Game

Let's say I have this dump game. I have three objects (1, 2, and 3). I want to assign to task executes, but for simplicity let's start with only one. I want to create a pointer that ticks 1 only when the task executer touches it, then returns to zero. I want to set up another counter that accumulates points at object 1 each time the task executer touches it. Finally, after the task executer touches object 2 or 3, object 1 accumulated counter reduced by one immediately. just-travel_no_idea.fsm

FlexSim 21.2.3
countergame
· 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.

Connor A avatar image Connor A commented ·

Hi @Osama A6, was one of Matthew Gillespie's or Eric M's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

You could use an Agent proximity system to trigger things when task executers arrive at the different objects. In this example, I've added all the destination objects to the proximity system and turned on their proximity behavior. I also added the task executer to the system, but turned off its behavior. Then in the proximity system I added an On Enter and On Exit Proximity trigger that increment stats in the table whenever the te enters or exits proximity with one of the objects.

AgentSystem.fsm


agentsystem.fsm (74.5 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.

Eric M avatar image
0 Likes"
Eric M answered

Hi @Osama A6, process flow is going to be a good tool to use for this. This replaces the custom on message tasks from before. The process flow tells the AGV to travel to a random object (or something else you control) and then writes the values to a table called ScoreKeeping. A label called PrevCase is kept on the token to keep track of which column to subtract from when the AGV arrives at a new object. The decide activity "same as prev case?" is used to make sure a new location is selected each iteration. Let me know if you have any questions.

just-travel-no-idea example.fsm


5 |100000

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