Graphics

 View Only
  • 1.  Migrating Scripts - mixed results

    Posted 06-29-2018 18:09

    Hey guys,

    I am in the process of trying to migrate scripts from an older version of a scene to a newer one. As an example in once scene - a lower 3rd with up to 5 player stats, there is a script at the scene level:

    dim Keys as xpDatalinqKeys
    Dim Key(5) as xpDatalinqKey
    dim Cat(5) as xptextObject
    dim i as integer

    Engine.DebugMessage("test", 1)

    Self.GetDatalinqKeys(Keys)



    For i = 1 to 5
    Keys.GetKeyByName("STAT" & i, Key(i))
    Self.GetObjectByName("CAT-" & i, Cat(i))
    Cat(i).text = Key(i).AsString
    Next



    This compiles successfully - great!

    Then further down in the hierarchy, there are scripts on the category names, such as:

    CatTrans(scene, text)


    These do not compile successfully, returning the following message:

    1,0: BC30451 Name'CatTrans' is not declared.

    I have looked everywhere I can think of in the both the scene, and the project's setup page for another piece of script in which said needed declaration is made, but to absolutely no avail. I do have all of the relevant stats successfully datalinqed up, so I am at something of a loss,

    Any ideas?

    Thanks
    - Willie



  • 2.  RE: Migrating Scripts - mixed results

    Posted 06-29-2018 19:42
    Are the two scenes in the same project or a different project?

    If they are in different projects, check Edit->Scripting->Global Methods...
    #XPression


  • 3.  RE: Migrating Scripts - mixed results

    Posted 06-29-2018 19:57
    yeah, that was it, I hadn't known about that particular hiding spot for scripts, but that did allow the previously un-compilable scripts compile successfully. I'm still not sure I know what they are doing, but at least I got that far, lol.

    Thanks
    #XPression