Is it possible to set a special start order in fxdk?

IMPORTANT! Found a better way (thx pink-pepper) : Special start order in FxDK
Is it possible to set a special start order in fxdk?
E.g. that mysql-async should be started before my scripts that use it.

EDIT @pink-pepper: This is not how you should solve your start order problem. Please read post below this one.

I found out that in the fxproject.json file, which is located with the scripts, you can change the starting order. However, while editing the file you have to close fxdk, otherwise it will not be taken over.
Here is an example:

  "assets": {
    "scomand": {
      "enabled": true
    },
    "[dependencys]\\mysql-async": {
      "enabled": true
    },
    "[dependencys]\\NativeUI": {
      "enabled": true
    },
    "[dependencys]\\MenuExample": {
      "enabled": true
    },
    "[dependencys]\\skinchanger": {
      "enabled": true
    },
    "[ks]\\ks_framework": {
      "enabled": true
    },
    "[ks]\\ks_skin": {
      "enabled": true
    },
 },

if you want to start ks_skin before ks_framework, move the part above it:

  "assets": {
    "scomand": {
      "enabled": true
    },
    "[dependencys]\\mysql-async": {
      "enabled": true
    },
    "[dependencys]\\NativeUI": {
      "enabled": true
    },
    "[dependencys]\\MenuExample": {
      "enabled": true
    },
    "[dependencys]\\skinchanger": {
      "enabled": true
    },
    "[ks]\\ks_skin": {
      "enabled": true
    },
    "[ks]\\ks_framework": {
      "enabled": true
    },
 },

When you are finished, safe the file and start fxdk.
When you add new scripts to the list via fxdk, they are automatically added at the bottom.

To ensure correct start order you have to state what needs to be started first as dependency in fxmanifest.lua, see Resource manifest - Cfx.re Docs.

For example, you have two resources: res1 and res2, and you want res1 to always start before res2. In res2's fxmanifest.lua, add dependency 'res1' and it’s done, server will always start res1 before res2.

Closing this now as fxproject.json is not intended to be edited manually and changing assets order in there helps only by sheer luck as order in this file does not guarantee start order.

1 Like