Calling a functions from another event sheet not returning result.

0 favourites
  • 4 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • So I call these functions to convert a number to an Intl.Number() format. Currency, percentage, that sort of stuff. The functions are in a separate event sheet. This works great in my Sandbox project.

    The same is not true for my main project. Same code, same setup, but the functions only ever return a "0". Before leaving the functions I log the result to the console. And they are the correct strings. So the functions get called, calculate the correct string but return a big fat "0".

    I have tried include, although not required. Compared my two projects line by line. No joy.

    Anybody know what's going on?

    P.S. If I duplicate the functions into the event sheet they work fine, but that's beside the point.

  • The only thing I noticed was that you are storing your calculated result in a string and then the return type of the function is a number, which may convert it a 0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for taking the time to respond.

    This happens to me when I look at something too long. You absolutely right!

    Ashley Maybe we can have the Return type in a more prominent color than grey for old farts like me? :)

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