lukeo25's Forum Posts

  • F&N Brilliant!

    Thanks sizcoz

  • Thanks but I still don't see how I am getting the index of where C2 finds the string in the array

  • I take it that the string can't be a part of the string.

  • Thanks dop2000

    I've seen that elsewhere.

    What does that look like in the Event sheet?

    Cheers

    Luke

  • Hi,

    I am storing user data in an array and I am separating each entry with a "|||" separator. I can load these fine but I have given each individual an id number that they enter on another website. The data gets pulled down using an ajax request URL - this all works fine. What I want to do is search through the array and find the occurrence of the users id number in that array and then get the index of that occurrence so as to only load that persons data.

    So the question is how do I find the index of an occurrence of string in an array?

    Luke

  • If you want to test your app, use the Debug APK option. - OK I will try this first

    Thanks Dude

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I just recently purchased C3 as an indy. My reason was because I wanted to create android apps. I have been having failed install after failed install. SO I wondered if it was the way I built my app in the first place. It was originally a construct 2 build. I decided to open one of the template projects and export it to android without making any changes. I sideloaded it to my android device after C3 export and......It shows as "CORRUPT".

    What gives? C3 claims it can do this...I am really pissed.

    Luke

  • OK yes I do have this in the edittime.js

    "dependency": "SCORM_API_wrapper.js",

    Should I put in all variables from this also?

  • Hey blackhornet,

    Does this go into the runtime or edittime?

  • Hi,

    I'm sure this must have been covered at some stage . I just can't seem to find the right tutorial/forum post.

    I have an external js file that is in my plugins folder. I am trying to call to a function in it using this in an expression.

    var learnername = (scorm.get("cmi.core.student_name"));

    But I just get an error saying scorm.get is not a function. Yet I know that it is a function of my external.js file.

    Any ideas?

    Cheers

    Luke

  • Its OK,

    I realized that my errors are caused by my external .js not being hosted on a moodle.

    Thanks for replying.

    Luke

  • This is hard to understand. I made the following change.

    This was the change to the edittime.js

    // example

    AddStringParam("Message", "Enter a string to alert.");

    AddAction(0, af_none, "Alert", "PipeCalls", "Alert {0}", "Description for my action!", "Pipecall_Alert");

    AddAction(1, af_none, "Initialize", "PipeCalls", "Initialize", "Description for my action!", "Initial");

    AddAction(2, af_none, "Terminate", "PipeCalls", "Terminate", "Description for my action!", "Finish");

    AddComboParamOption("student_id");

    AddComboParamOption("student_name");

    AddComboParamOption("lesson_location");

    AddComboParamOption("credit");

    AddComboParamOption("lesson_status");

    AddComboParamOption("entry");

    AddComboParamOption("total_time");

    AddComboParamOption("lesson_mode");

    AddComboParamOption("exit");

    AddComboParamOption("session_time");

    AddComboParamOption("RO");

    AddComboParam("Parameter to get", "Parameter", "{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}");

    AddAction(3, af_none, "GetValue", "PipeCalls", "GetValue {0}", "Description for my action!", "GeT");

    // (student_id, student_name, lesson_location, credit, lesson_status, entry, score, total_time, lesson_mode, exit, session_time, RO)

    AddComboParamOption("student_id");

    AddComboParamOption("student_name");

    AddComboParamOption("lesson_location");

    AddComboParamOption("credit");

    AddComboParamOption("lesson_status");

    AddComboParamOption("entry");

    AddComboParamOption("total_time");

    AddComboParamOption("lesson_mode");

    AddComboParamOption("exit");

    AddComboParamOption("session_time");

    AddComboParamOption("RO");

    AddComboParam("Parameter to set", "Parameter", "{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}");

    AddStringParam("Set it to what", "value");

    AddAction(4, af_none, "SetValue", "PipeCalls", "SetValue {0},{1}", "Description for my action!", "SeT");

    AddAction(5, af_none, "Save", "PipeCalls", "Save", "Description for my action!", "Save");

    AddAction(6, af_none, "Get Last Error", "PipeCalls", "Get Last Error {0}", "Description for my action!", "GeT_Error");

    AddAction(7, af_none, "Get an error string", "PipeCalls", "Get a SCORM error as a string {0}", "Description for my action!", "GeTError_Str");

    AddAction(8, af_none, "Get Diagnostic", "PipeCalls", "Get Diagnostic {0}", "Description for my action!", "GeT_Diog");

    ////////////////////////////////////////

    And this is the change in the runtime.js

    // ... other actions here ...

    Acts.prototype.GeT = function (pos)

    {

    // alert the message

    if(pos==2){ alert("you selected lesson_location");}

    };

    Any help appreciated.

    Cheers

    Luke

  • Josek5494

    Thanks for this.. In the second part here the AdMob refers to your action is that right?

  • Thanks zenox98.

  • Hi,

    Excuse my confusion, I have watched a couple of vids and tried reading the tutorials here but I am at a loss. I don't understand where the runtime.js is getting its param variables for functions. I can see the alert example but I can't find where it is getting the myParam var for the function from.

    Is this coming from the name as in AddComboParamOption("student_id");

    So am I to use the text in the braces as my variable name for the function or am I just lost.

    Hope someone can help I have some great ideas for plugins.

    Cheers