serpent's Forum Posts

  • Didnt realise i was using an outdated version

    Upgraded to 184 X64 but it didnt fix anything

    EDIT:

    Got more time to read into it all after work

    [quote:3ilaue2t]Form controls are actual HTML elements floating above the game canvas in the HTML page. Therefore, nothing can be displayed on top of a form control, apart from other form controls.

    So that answers them ignoring z-order and layers, looks like they are pretty useless for the most part so ill just use this tutorial

    https://www.scirra.com/tutorials/449/cr ... -healthbar

    As for the strange numbers appearing, I found this example to remove the unwanted numbers past decimal points instead of just hiding them by rounding off to a whole number, so hopefully that will help

    https://www.scirra.com/tutorials/179/de ... in-a-float

    Hopefully one day the progress bar gets better customizability instead of the need to manually create your own, and the ability to round off numbers and keep numbers past the decimal would be great.

  • Hey all,

    Making a simple HP and damage system, ran into a few issues

    Running release 178 (64bit) and tried this on node-webkit, chrome and phonegap

    PROGRESS BARS

    • Ignore Z-Order and Layers, Always show on top
    • CSS Style wont work, setting colour or color to red is ignored
    • Some CSS Style properties will default the progress bar to a green and grey CSS style

    I am also making a DPS (Damage Per Second) System, and want the HP bar to decline smoothly, instead of just having a chunk of it disappear every second.

    To do this I created a system event so that every 0.1 seconds it will subtract 1/10th of the DPS from the Health

    This works fine but it gives strange numbers to the HP, instead of being:

    99.9, 99.8, 99.7 etc, it is showing numbers like

    99.90000000054, 99.80000000023, 99.7000000064 etc

    I could just hide the number using floor, ceil or round but it is causing issues with timing, I calculated it to take 10 seconds to kill an enemy of a certain HP with my level of DPS, and it took an extra 6 seconds because of the strange fractions.

    And if i set the DPS timer to fire every 0.01 seconds and subtract (DPS / 100) it looks even smoother but the time calculation becomes even more unreliable and HP shows numbers like 99.999999999999754

    Heres the CAPX

    http://s000.tinyupload.com/index.php?fi ... 2955337379

  • On touched Object fixed that problem.

    So what are the gestures more geared for?

  • I now know its to do with the actual touch tap component.

    If i have a mouse click on down, it works, if its touch on pc or android it misses every second one if i click it faster than 1 second.

  • Hey guys,

    Feeling a bit noobish getting back into Construct 2, thought id try and make a Cookie clicker clone to test out mobile export, layout etc.

    For some reason mine seems to miss every second click if i am clicking faster than a second, even though the text is updating every tick.

    Anyway I have seen a heap of examples for clickers made in construct 2 and they seem to function and behave loads better than mine, so if someone is willing to kindly share a capx file that I could learn from it would be appreciated.

    EDIT: this is literally all i have coded so far, so im unsure to why it is missing every so few clicks

  • From my understanding, Multiplayer is based around P2P, so its serverless

  • Currently you can only use the official scirra server that you listed above, it does however automatically connect you to a lan game if it detects it, but lan games need the internet to make the initial connection.

    Edit: it helps to point out that the signalling server only helps people connect to the game, once connected the server isnt involved at all

  • Problem Description

    When Writing or Appending a file using Node-Webkit, newline seems to be ignored when the exported file is opened in notepad, it however works for other text editors i.e notepad++ or wordpad, its still an issue since i would assume notepad is the most common text editor since its a default.

    With Javascript \n is acceptable for newline on most nix systems, but windows insists on \r\n

    Couldnt upload Capx, kept saying "The uploaded file is empty"

    Steps to Reproduce Bug

    • On Start of Layout > NodeWebKit:WriteFile > Path: nodewebkit.appfolder & "example.txt" Contents: "Line 1" & newline & "Line 2" & newline & "Line 3"
    • Export to Node-Webkit
    • run executable
    • open example.txt with notepad

    Observed Result

    The text shows as:

    Line1Line2Line3

    Expected Result

    The text should show as:

    Line1

    Line2

    Line3

    Operating System and Service Pack

    Windows 7 X64 Ultimate SP1

    Construct 2 Version ID

    173 (64 Bit)

  • Ashley,

    Not sure if its a bug, notepad or the node-webkit write action,

    Every time I export my string that contains "newline", it all appears on a single line, yet I open the same file in word-pad and each part is on a new line it should be.

    Also does an expression exist to show a "whitespace tab"?

  • Managed to get it to work by using the Repeat condition and setting the count to "ConfigArray.Height"

    now i just need to figure out how to keep the newline when exporting it to a text file, right now it exports it all single line.

    Also im not sure, is there a way to do a "tab whitespace" in a string from construct 2?

    By that i mean, if you open up notepad in windows and press tab, it creates a space equal to pressing space bar at least 8 times, but it registers as a single character

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for replying

    i am indeed only using node-webkit, and im slowly learning how to use strings/tokens for array work:

    Ill get there with it, but it will be slow as i get about an hour to myself each night while i am at work

  • Perhaps you could create it in a video editor then save it as a video file, that way it would be perfect every time and you woulnt have to worry about timing or big code

  • Thanks for the reply Aphrodite,

    Had to add another "&" symbol after the :

    But for the most part when I put display the results of Textvar in a Text Object it does show Fullscreen = 1 or 0

    My array now looks like this, but only Fullscreen and its value showed using the Textvar loop

    (0, 0) = Fullscreen

    (1, 0) = 1

    (0, 1) = Volume

    (1, 1) = 67

    I also attempted to add your set textvar equation value to a For Each Element in ConfigArray event, but it spammed the textbox and wouldnt stop :/

  • Hey guys,

    I have created a simple Capx file that will let the user choose between a windowed or fullscreen node.webkit and save it to a JSON text file

    It works great but i want to be able to format the outputted "config.ini" JSON text file

    The output is as below:

    {"c2array":true,"size":[2,1,1],"data":[[["fullscreen"]],[[1]]]}[/code:5d8pxfhs]
    Id like to be able to format it to look like this
    [code:5d8pxfhs]fullscreen = 1[/code:5d8pxfhs]
    and eventually once I add more configurations, something like
    [code:5d8pxfhs][VIDEO]
    fullscreen = 1
    resolutionx = 1600
    resolutiony = 900
    
    [AUDIO]
    music = 26
    sound = 45
    
    [INPUT]
    Forward = 36
    Backward = 43
    Left = 13
    Right = 35[/code:5d8pxfhs]
    
    I believe to do this i would need to convert it to a string with tokens etc before saving and loading, i just have no idea how
    
    Any help would be great
  • Is there any chance you could create a small example of reading/writing an array to that format zatyka?