Will a future C3 build convert old functions to the new system?

0 favourites
From the Asset Store
Dynamic, heavy and powerful rock themes. 11 music tracks.
  • Ashley I want to update all of my existing functions to use the new system, but wanted to make sure a future build won't do this automatically before I do so. I read that the old function object will be removed soon, so it might be a possibility?

  • It's very difficult, and can't work in 100% of cases, because you could do things like call functions or access parameters by expressions which the new system doesn't allow. I might give it a go but I'm not sure it will work...

  • Can't you just depreciate it like web storage?

  • I believe this thread is about providing a tool to automatically upgrade old functions to new functions. This is different to deprecation.

  • I believe this thread is about providing a tool to automatically upgrade old functions to new functions. This is different to deprecation.

    Just curious, will the old functions be removed entirely?

  • Just curious, will the old functions be removed entirely??

    Old functions will be deprecated, but it's unlikely we'll be able to fully remove them for a long time, given the number of projects that still use them. In particular projects still using the C2 runtime can't switch to builtin functions until they switch to the C3 runtime. So realistically we could only fully remove the old functions if we fully remove the C2 runtime and pretty much all C3 runtime projects have switched over to using builtin functions. That is probably at least a couple of years off.

    Tokinsom - I'm currently investigating a feature to switch old functions to builtin functions for the next beta. The main complication is old function parameters could be numbers or strings, but builtin functions are typed and must be one or the other. So if the parameter uses both types it cannot be converted. Additionally doing things like calling functions by expressions throws off the static analysis and forces it to assume that call could call any function in the project, making it more likely it can't work out the parameter types. So even if I can get it working, it's not yet clear it will be useful in practice, depending to the extent people's projects use dynamic types or calling functions by expressions.

  • Ashley Thanks for the detailed reply. To be fair I didn't expect an automatic conversion! I totally understand that it will be difficult and maybe not even possible due to the issues you mentioned - they're just too different. I just wanted to make sure it wasn't on the horizon before I spend the next few days converting them all by hand. I misread an earlier post thinking the old functions would be "removed" (and converted) instead of "deprecated" so that's my bad! I know I don't have to convert all of my functions now, but would like to for the sake of cohesion/organization and potential performance gains cause I suuuuure use them a lot.

  • Just an update: I think I've got automatic conversion working well enough that it should ship in the next beta release. It's not 100% effective though, since it can't handle things like dynamic function names, or retrieving dynamic parameter indices. When it does work though it should do a reasonable job, hopefully.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley is that something that will be automatic? or do you have to opt in to the conversion?

  • It will be opt-in. You'll likely still have to review the results too. It can't always automatically convert, and it doesn't cover cases like calling a dynamic function name.

  • That´s pretty neat. What´s the recommended way for functions called by expressions? I´m using that quite some... Or will it be gone for good? That would be sad :(

  • What do you mean? Built-in functions support being used as expressions too.

  • I meant something like this

  • In that case you ought to pass the dynamic part as a parameter instead.

  • Ashley - along similar lines, how can we call the new built-in functions from the JS C3 SDK?

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