closed
Public

It’d be cool if a custom event could return a value. I’m putting my reusable logic in custom events, but I need to make a global property to carry the results of each custom event and then I have to remember to clean up after myself to avoid stale results.

2 answers

Hi Jon,

It is true that the custom event (and its handler) really like a function in programming. However it is hard to allow “returning a value from event” basing the current behavior tree structure.

Setting a global property in custom event handler is a good way to achieve your purpose. One thing need to be mentioned is that, you don’t have to create the global property in the “Global Property” window, you can use the “Set Global Property” action to set its name and value directly. If the global property does not exist, ForeUI will dynamically create one in the simulation.

If you have a custom event named “User_Logout”, it can set a property named “User_Logout_Result”, which is really easy to remember.

#1

also it would be cool to carry over properties when trigger a custom event.

sure i could set a global propertie to a value and use this propertie in the event. but for this i would need a line for every parameter i wish to use in the custom event.

like move textbox to “x”,”y” and make it “width” and “hight” and set the text to “text” need 5 lines in the action. instead of seperat this parameter from the call, like:

Trigger “Sample_Event;{x};{y};120;50;”text”” Custom Event

PS: Merry Xmas and happy new year.

#2
  1. We might consider that, thanks.

    Merry Christmas & happy new year!

This question is now closed