plugin virgin

0 favourites
  • 9 posts
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • Hi, i am creating first time plugin that will simply show a message alert with a string.

    I created the plugin using the SDK template, i just changed the name and icon thats all, and also the settings like web, object etc..

    I ran the project, when i make no reference to the lolo actions it works fine.

    then i add a button and in its click event i add an action to use the alert action of lolo plugin, then i run the project and all i get is a blank grey screen and nothing works.

    here is the zipped project file. I have placed the plugin folder "lolo" here as well, you can copy it to your construct 2 plugin folder.

    http://uploading.com/files/9e5mfdfc/lolo.zip/

    help appreciated.

  • Read the tutorial about Checking for errors in browsers it should help you to find the problem in your code.

    Also read and follow the C2's SDK.

    Be sure to post your files on dropbox rather than on advertising slow and tedious webhosts.

    Finaly moving this topic for the "SDK" forum, more appropriate for help requests.

  • Do you have another plugin - i cannot open your C2-project because C2 claims missing the "Scoreoid" plugin.

    Some suggestions after a short look in the runtime:

    #) Why do you init the instance-variables (or object-variables (?)) in line 70 outside any function? I suppose line 65 or 53 are better places for the initiation.

    #) When these vars belong to the object it's better to call them with the keyword "this" - when you declare them with the javascript keyword "var" you make them global for the whole website. In line 57/67 are outcommented examples from the developer.

    #) "blank grey screen and nothing works."

    For javascript-development it's a good idea to use the Firefox-Addon "Firebug" in Firefox or with Chrome the built in "Chrome Developer Tools" - shortcut [CRTL]+[SHIFT]+[ I ] - there you should see details for most errors.

    [edit]post above <img src="smileys/smiley2.gif" border="0" align="middle" /> [/edit]

    g, Joe7

  • i make changes to the plugin javascript files but in order to test if they work i have close and rerun construct 2. its a pain!! why cant construct just reload the updated/modifed .js files before previewing the game??

    Anyway i somehow got this to work.. i deleted some of those VAR declarations...maybe?

    Well one last thing on this thread, can someone help me with this function, itts placed in the common.js file and called from one of the actions, it works but the post function doesnt work:

    function getGame()
    {
     $.post("http://www.apisite.com/api/getInfo", {api_key:"b9d57f3fbf2faa8d607ad2fc6178ab153cc08b48",game_id:"k4scvKUW3",response:"xml"},
       function(data){alert("Data Loaded: "+data);},"xml");
    };
    
  • i make changes to the plugin javascript files but in order to test if they work i have close and rerun construct 2. its a pain!! why cant construct just reload the updated/modifed .js files before previewing the game??

    See Developer Preview Mode!

  • rafhelp:

    1) The file common.js has another task(it should contain scripts for runtime and edittime)- i think only few plugins use it.

    If you need/want external scripts/libs you can do it this way:

    Put your "global" functions in an seperate file "yourFileName.js" (placed in your pluginfolder)and make in edittime.js a dependency (- create a parameter by the return of the function GetPluginSettings()"): "dependency": "yourFileName.js"

    2) new XMLHttpRequest();

    To make browserindependet developing much easier this is probably a task for jQuery (ajax - jquery)

    When you have a look at the ajax-Plugin or the ajaxPost-Plugin(=fork of ajax) you'll see how you can handle data with jQuery. Easier to read and recommended in the manual is jQuery.foo() instead of $.foo()

    have fun, Joe7

  • you got to talk to me like a newbie to javascript. I have tried alot oan decided it may be too time consuming to learn this.

    I creat a new file called myfunction.js and placed it in the same folder as runtime.js.

    no how do i reference to it and actually call function to it in the Addaction section of the templates.

    Also i tried XMLHTTPREQUEST i can never get it to work when i have to pass multiple form data.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you got to talk to me like a newbie to javascript. I have tried alot oan decided it may be too time consuming to learn this. ...

    rafhelp

    Yes, it really sounds as if you need more practice with basic JavaScript before you try to implement plugins.

    Have a look at this page in the SDK manual for good advice on mastering JavaScript.

    Good luck with your learning!

  • for the external js file i have placed a function in it but i cant call it, what is the structure required for the externl js file and how do you call function sin that file after importing using jquery get script

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