Graphics

 View Only
Expand all | Collapse all

Script not running?

Luis Blank

Luis Blank05-19-2015 16:38

  • 1.  Script not running?

    Posted 05-18-2015 20:44
    I was working in a scene and when I went to the script editor and programmed some lines to test something. When I was done I went to run it but nothing happened. The code I had written was ignored. I thought it was an error on my part but I scripted the change of a value it didn't work. What I wanted to do was find the average of two values and place that in one variable, but for some reason I couldn't even get simple code to register.

    What I wanted to work on the script editor of a variable

    dim v1

    dim v2

    Scene.GetObjectByName("Stat Input 2", v1)

    Scene.GetObjectByName("Stat Input 5", v2)

    text = v1/v2

    this did not work. When I went to trouble shoot it I attempted just running this line of code by itself with nothing else

    text = 6

    That also did not work. It stayed the value it was before. I don't understand. The thing that really throws me of is that I used this same code on another project and it worked flawlessly. If it makes a difference the variables that I am averaging are being inputted by a html. The variable that I am modifying is also being inputted by the same html.


  • 2.  RE: Script not running?

    Posted 05-18-2015 21:00
    Hello Luis,

    Maybe a stupid question but did you click on the lightning sign after you edited the script? It's a thing I sometimes forget when I'm in a hurry.

    When the script is okay you should see a green icon instead of a red one besides the scene state.

    Hope this will help.

    Kind regards

    #XPression


  • 3.  RE: Script not running?

    Posted 05-19-2015 15:42
    Where are you running the script? OnOnline? OnSetText? OnEvent?

    #XPression


  • 4.  RE: Script not running?

    Posted 05-19-2015 16:03
    `text = v1/v2` doesn't make sense as that would be trying to divide two text objects and will crash the script.

    I expect you meant to use `v1.text / v2.text` which may work but would be better written as `text = CInt(v1.text) / CInt(v2.text)` or use CDbl() if you are using floating point values.

    #XPression


  • 5.  RE: Script not running?

    Posted 05-19-2015 16:37
    yes sorry about that. I was using

    CInt(v1.text)/CInt(v2.text)

    the reason is that it is the way it is up there is that I changed it for trouble shooting proposes and copied pasted and forgot to switch back

    #XPression


  • 6.  RE: Script not running?

    Posted 05-19-2015 16:38
    and it is running OnSetText

    #XPression


  • 7.  RE: Script not running?

    Posted 05-19-2015 17:05
    one more thing that I would like to add. when I program into OnOnline it works but when I work on individual fields with OnSetText it does not. What I mean is that when I run it OnOnline displays what I wish while OnSetText does not.

    This is my code for OnSetText:

    if Text = "" then

    Text = 0

    end if


    and this is my code for OnOnline

    'sets the name of workable variables

    dim v1 as xptextobject

    dim v2 as xptextobject

    dim v3 as xptextobject

    dim v4 as xptextobject

    dim v5 as xptextobject

    'puts things in inside the variables

    Self.GetObjectByName("Stat Input 1", v1)

    Self.GetObjectByName("Stat Input 6", v2)

    Self.GetObjectByName("Stat Input 2", v3)

    Self.GetObjectByName("Stat Input 3", v4)

    Self.GetObjectByName("Stat Input 4", v4)

    'checks to see if what is inside said variables is empty and if

    'it is then replaces it with 0

    if v1.text = "" then

    Self.SetObjectPropertyString("Stat Input 1", "Text", "0")

    end if

    if v2.text = "" then

    Self.SetObjectPropertyString("Stat Input 6", "Text", "0")

    end if

    if v3.text = "" then

    Self.SetObjectPropertyString("Stat Input 2", "Text", "0")

    end if

    if v4.text = "" then

    Self.SetObjectPropertyString("Stat Input 3", "Text", "0")

    end if

    if v5.text = "" then

    Self.SetObjectPropertyString("Stat Input 4", "Text", "0")

    end if


    #XPression


  • 8.  RE: Script not running?

    Posted 05-19-2015 17:09
    You are missing an `end if` in the OnSetText script.

    I tried your OnSetText script and it works fine for me.. Maybe you can post your actual project as their could be somethign else wrong that we can't see from your script alone.

    #XPression


  • 9.  RE: Script not running?

    Posted 05-19-2015 17:44
    Yes tried it to with the end if in it still did not work. Unfortunately I cant make the project public so I cant post it. Don't have the permission. Some thing that could be affecting it is that the variable is using data link. That might have something to do with it. Don't know.

    #XPression


  • 10.  RE: Script not running?

    Posted 05-19-2015 17:45
    Can you make a sample project that shows your issue but doesn't have all the images/videos you don't want to make public?

    #XPression


  • 11.  RE: Script not running?

    Posted 05-19-2015 17:47
    The project is simply displaying some data from a html. Some of the variables are linked through data link.

    #XPression


  • 12.  RE: Script not running?

    Posted 05-19-2015 17:56
    Don't know about making a sample. The whole thing is just a stat card. Nothing truly complex but 4 or 5 variables which are ints. The only thing I cant account for is the data link.

    #XPression


  • 13.  RE: Script not running?

    Posted 05-20-2015 14:40
    If you just create a new project, import that one scene, and remove any graphics/videos/images you don't want to share, that would be the best way to create a sample. You could then export that project to an xpp, and we would take a look at it on our local machines to help out.

    #XPression


  • 14.  RE: Script not running?

    Posted 05-20-2015 17:13
    Luis,

    You can also upload to the Ross Customer FTP site here:

    app.brickftp.com

    User: Xpression

    Password: rossvideo

    Folder: XPression Projects

    Users on this site can only upload and cannot read the files on the site. Only Ross support employees have access to the files on this FTP.

    #XPression


  • 15.  RE: Script not running?

    Posted 05-20-2015 21:10
    I used the site that you mentioned and remade the working variables to as close to what they were in the actual project. I called the folder knight systems. there are two files which are almost identical. The difference is that one has code in both OnOnline and OnSetText while the other only has code on OnOnline. I was having trouble getting the OnSetText to work even though all I wanted it to do was display some something in the variable fields that was not being shown.

    #XPression


  • 16.  RE: Script not running?

    Posted 05-20-2015 22:08
    Hey Luis,

    We tried your script and it seems to be working for us.

    Can you email me at gmillward@rossvideo.com and we can arrange a remote session to take a look directly on your system.

    #XPression