NickRimer's Forum Posts

  • I think I know just a logic answer for your 2nd question..

    There is nothing that can stop us from naming files like this:

    fire1.wav, fire2.wav, fire3.wav etc. (for example, the last one will be 10th)

    For now all we need is to play them randomly. File name to play is: "fire" & random(10)+1 & ".wav"

  • yes, you can export your game for mac using NodeWebkit.

    C2 will make you an offer to download and install it, select Export Project, you'll see it at the bottom of export list (it can be called NW.js or smth. like this)

    NodeWebkit exports project for win, mac and linux at the same time

  • you need to save it to WebStorage BEFORE you close your layout or it will cause your progress to lose

  • Spawn point - (x,y)

    where:

    x = CenterX + RADIUS * cos(YourAngle)

    y = CenterY + RADIUS * sin(YourAngle)

    CenterX, CenterY - center of your circle

    RADIUS - circle radius

    YourAngle - angle you want from 0 to 359

  • If you want to use WebStorage you need to save your data to it and then - read it.

    To save data to WebStorage use Set local value action. Use any key and store you Timer value (example, key: "finish_time" value: Timer).

    Any time you want read it with WebStorage.LocalValue(key) expression.

    Our example: Text.SetText -> WebStorage.LocalValue("finish_time")

    You'll take your last Timer value.

    It will be still there even if you close your browser and open it again.

  • Hello man! Very interesting objective.

    I've just finished a little capx-source, I think it makes what you want and I hope it will help you.

  • locohost:

    Yes, C2 arrays have dynamically size, you can change it any time you want with SetSize(w,h,d) action.

    Default value for empty array is 'zero' - 0. So Array.Clear is smth. like to fill it with zeros.

    Set width to 0 and push/pop/delete new values at any time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 2dryas:

    To load local files through runtime I usually use AJAX's Request URL action and this url form - file:///<path to file>

    Without < and > brackets of course! C2 will search it in parent folder (if you write no full path, just filename).

    Example:

    file:///data.json

    file:///data_subfolder/aaa.txt

    file:///C:/Users/user/Documents/zzz.log

    Note: I check it with NodeWebkit ONLY! I don't know about how it works on other platforms.

  • I think it will not work because in this way I should know url of previous page, because current page will be application url.. It will be no so good to make 2 identical folders (for example "ru" and "en") to read this information and switch according to it..

  • Hi for all!

    The question is about:

    I have a personal wiki-site. I have an application stored on that site. This app supplies 2 different languages (also like a site).

    How can I run my application with parameter (or any another way) that will have an information about page language? If I will run app from english page, it must be in english, if I'll run it from russian page, it must be in russian.

    For now I can make it just with WebStorage. But it saves data user must to input by himself when he will start this app for the first time (if an english-speaking user will run it first time he'll see default-russian text first, then he have to switch into english mode, just after that language option will be saved for the next time).

    I want user to avoid switching. If he will start app from english page - he must take an english version of program.

    How to make this? How to run application with some language parameter?

  • Well, thank you for your time, Ashley.

    For now I can see that I just mix up in my head declaring and assignment.

    Maybe I need to learn JS more, because I can't understand why we wrote for the first time

    this.cx = this.properties[0]

    instead of

    var this.cx = this.properties[0]

    I thought, that it is an assignment, just not declaration. It seems, that I'm not right..

  • Hello there!

    I'm using SC2 for several years but it's first time I decide to make my own plugin.

    Well, to improve existing one a little..

    I have experience to work with different programming languages (C++, Delphi, Pascal and some others) and my question is not about how to make some things in JS.

    But I can't find some information about where some methods (functions, properties etc.) came from.

    This is a particular example.

    Plugin: Array

    File: runtime.js

    Where can I find description of this things: cx, cy, cz, forX, forY, forZ, arr, forDepth and some others? I've tried to search it in *.js files in html5 folder but no succeeded.

    I see that we can write this.cx = this.properties[0]; and this will be a Width of our Array.

    And for example var a = this.arr; what is arr? It seems to be smth. like a link to our array but where did we found such description and others?

    Well, another example, what means this.forX = []; or this.forDepth = -1;

    I hope you understand what I want to know. Maybe I just can't see things under my nose