ome6a1717's Forum Posts

  • Desperate bump - I already paid for art with spriter in mind, so if I can't figure this out I'm in trouble

  • Has anyone else had problems using spriter with nwjs? It works great in preview, but when I export it, the sprites are invisible. If I restart the layout, I can usually get the sprites to appear on the 3rd or 4th time I restart (and then it seemingly works from that point forward)

    - Hey Mike, any idea on this? I've saved both scon and scml files (only imported scml). I'm using r244 with the most recent version of nwjs (july 29 2017). I have the initialize event in an inactive group that is initialized on the specific layout/mission start (not sure if that would be a problem).

    Any insight would be very helpful.

  • 99Instances2Go - Thank you. You were right; it's because im not confident it. I really just hate the idea that I can't use saving in a function, and instead have to call triggers. However, I've figured out my problem (and it's pretty much what you said). I just needed to save the data in an array for the save slots and then save everything else to a dictionary. The only thing I needed to do was create a splashscreen that loads everything away from any #includes (so if I call a "local storage item get" somewhere else, I can add specific save and load functions that wouldn't pertain to the first time).

    - This looks great! I'm definitely going to consider this, as well. However, it looks like you still have to check if it's loaded or missing in this, too. Really what I want is to be able to save and load a game in a function without checks, whatsoever (that includes CHANGING said local storage and calling it from a function, expression, etc.)

  • I've looked a bit more into this issue - localstorage just isn't the right tool for multiple saves like I'm trying to do. I'm wondering if anyone has had success in using javascript in creating their own save function plugin?

  • I haven't really played around with LocalStorage much, but all I can tell is it's completely inferior to the older webstorage plugin.

    I'm trying to do the following and having a heck of a time figuring out the best way to do it.

    I have multiple dictionaries, arrays, and global variables that I need saved. In the game, you can have multiple saves to a saveslot, similar to the "save" under the system actions. I then need to be able to get access to the name of all the games (as well as a couple other stats) that exist to put the data into a list that you can select from.

    My original idea was to save everything to a single dictionary, save it to the local storage using AsJson, and then also save a separate local storage called "gameName" (the value of this would be "gamename1;game1time;%completion-gamename2;game1time;%completion-gamename3 " etc. etc. Then, in order to create the list to select from I would do

    repeat(tokencount(LocalStorage.ItemValue, "-")[/code:w2yccgcl] times, and set everything according to 
    
    [code:w2yccgcl]tokenat(tokenat(LocalStorage.itemvalue, loopindex, ";"), <textinstance>, "-")[/code:w2yccgcl]
    
    I assume you're lost by now - me too.  Can anyone else think of a better way to do this?  I don't want to use the built in save and load function because I need more control over it.  The constant "check if item exists, check if item has been gotten after it exists" is super clunky and confusing.  It's making it very difficult to organize this in the way I have my event sheets, functions, and variables.
    
    I'd love to not have to resort to saving to a txt file, but will if I have to.
  • You can't do it with layers, but you can set the button invisible. Al HTML objects will always appear on the top no matter what.

  • NetOne - yeah that's what I worry about. Would this affect the GPU fillrate? Because if it does, it's already hampering slower machines and needs to be taken care of.

  • NetOne - right. That's where I read that. I guess my question is "will doing all the legwork to fix it be worth it?"

  • After (of course) developing 50% of my pretty large game, I've finally read something about tilemaps that worried me. I was using them to get tons of variation on almost every tile (ie platform floors with 3-4 variants, BG walls with 6-7 variants, windows that are 4-6 tiles wide/long, etc.), but I'm realizing for each next different tile it has to issue a whole new draw call. So a window in the background, even though its really only 4 tiles, it has to render 4 draw calls instead of having a single sprite of a window and only doing 1 draw call.

    Now, my levels aren't HUGE, per se, but some of them have a lot of variations going on and nothing is really being "tiled". Is this something I should go back in and look at, or because it's pixel art it's not a huge deal? Or am I (once again) misunderstanding how the tilemaps are supposed to be used?

  • UPDATE: Problem found - it was script mini-fication.

  • Problem Description

    When in full NWjs export (works fine in preview), if you open a dialog box (save or open) and then do a "on dialog cancel or OK", that trigger will never be called in the export.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/28104568/NW%20Bug.capx

    (this requires you to export a nwjs build to work; win32 tested)

    Description of Capx

    Single button that opens save dialog. Clicking cancel should cause the browser to close. You must export this to NW (it will work fine in preview)

    Steps to Reproduce Bug

      Add button to click to open NW save dialog Add trigger of NWjs on "save dialog CANCEL" and add browser close action

    Observed Result

    The trigger isn't being called - no matter what you put in the "on save CANCEL". This also happens on "save OK"

    Expected Result

    The event should work outside of preview.

    Affected Browsers

      NW: No (nw specific)

    Operating System and Service Pack

    Windows 10 Pro

    Construct 2 Version ID

    C2 Personal stable (244)

    Most recent C2 NWjs

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm curious about everyone's thoughts on good practices for battling with GPU fillrate issues. This is mainly geared towards high powered laptops that have insane resolutions (or mobile devices, if you will).

  • R0J0hound - sorry, one more question. For some reason I got it to work using the int(), but I've just tried to recreate something I have in a different layout (which is working) and its literally the same code, but I can't figure out why it's not working in this new instance.

    I'm trying to just get the rgb of a canvas object based on the mouse position (the canvas object is being filled by gradient). I'm just doing "set text box to "rgb("&userGradient.redAt(Mouse.X, Mouse.Y)&","&userGradient.greenAt(Mouse.X, Mouse.Y)&","&userGradient.blueAt(Mouse.X, Mouse.Y)&")", but it's always returning rgb(0,0,0).

    I've tried int() on both individual mouse.x and mouse.y, as well as the entirety of the redAt, greenAt, etc.

    It just keeps returning 0 for all the paramenters.

    EDIT AGAIN (sorry)

    AhHA! Got it - I didn't know this breaks when you resize a canvas. For those who were wondering you fix by setting the mouse.x - canvas.x, and mouse.y - canvas.y for each.

  • R0J0hound - unfortunately the default variables were already integers and not floats. It just keeps returning black (but when I set the "rgb(x,x,x)" to a text object, it looks the exact same as if I just set the color to "rgb(x,x,x)" using numbers (without variables)

    EDIT - I'm wrong. That worked strangely enough. Thank you!

  • I do find the article Huemerson posted a bit ... interesting. Basically what I'm getting from the performance tips there is the best way to optimize your game is not to make the game at all.

    I'm not sure my fps slowdown is from global layers, but I am using a lot of them, too, and have over 400 invisible objects on all of them combined. Has anyone else had issues with this?