Ratmaster's Forum Posts

  • PulvererPeter

    Well, I learned a lot from the official Construct2 manual and tutorials (I strongly advise you to check them as often as needed), and other users helped me now and then when I had questions ^^

    I'm sorry I don't know how to access specific data from the json file yet, I learned how tu use NW.js by myself a week ago and I didn't have time to learn that ^^'

    I'm interested in that too, so please let me know if you find a way to do so

  • You wouldn't want your player to lose dozens of hours of game in a few seconds, except if he choses to erase his savegame himself.

  • PulvererPeter

    I'm glad I could help you

    Well, the normal "system save and load" uses json too, but it stores data in either WebStorage or IndexedDB

    (I'm not really sure where it is exactly), which are in theory "permanent storages" and are not affected by the user clearing their cache.

    However if he uses a program such as CCleaner, the savegame may be erased... (that's what appened to me ^^')

    So to avoid problems and prevent the user to lose his savegame, it's important to save the game in a file, especially if your game is a desktop application.

  • And you have to set "NW.js" as preview browser or it will not work ! (the first link in my tutorial explains how to install it if you haven't done it yet)

  • PulvererPeter

    I'm glad it could help you a little

    I just had a quick look at your CAPX file, and I see where the problems are :

    In your file, you wrote :

    On save complete -> NWjs | Write "" to file NWjs.UserFolder&"\Test\Slot1"

    • First, with this you try to write in "Slot1", but it must be a file, so maybe you should name it "Slot1.something" (you forgot to precise a file extension, so maybe no file was created)
    • Also, you try to write "" (an empty string...) so even if your file was created it would be EMPTY, so nothing could be loaded from it ^^'

    -> You have to use the SaveStateJSON expression to write the savestate

    => with something like On save complete -> NWjs | Write SaveStateJSON to file NWjs.UserFolder&"\Test\Slot1.something" it should work just fine

  • Hi PulvererPeter,

    I recently wrote a small tutorial about saving/loading game with NW.js, maybe it could help you a little

    https://www.scirra.com/tutorials/4870/save-and-load-game-in-a-specific-folder-using-nwjs-node-webkit

    At least, it could show you some basic stuff and help you understanding how it works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ninjadoodle

    You're welcome

    What's great with global variables is that you can for example have switches in a dungeon that open a secret room in another dungeon or other complicated things and it's easy to organize

    RamPackWobble

    I didn't know you could do it that way, thanks for sharing !

  • Ninjadoodle

    Have you thought to use GLOBAL variable for each lightswitch, and then simply compare the value of these variables to trigger your event ?

    When you trigger the switch, you change its animation frame and the global variable's value.

    The other condition relies on the variable, not on the animation frame, furthermore with this you could create puzzles where each light can have a few different colors

    I mean you could just "split" this in a few events :

    • first for each lightswitch, when it's activated you change the global variable's value and set the light color according to this variable
    • in the second you check the value of each GLOBAL variable and then trigger the action if variable 1 ="this value" and variable2 = "another value", etc, etc...
  • have a look at the lighting example that ships with c2 - might be what you want

    Thx that's exactly what I needed ! I knew I had seen this somewhere but I couldn't remember where !

  • Seen that we deal with the subject of the lighting, does anyone know how I could give a "night effect" to a side-viewed game ?

    I'll try to explain what I mean by night effect : The all screen is darker (I thought I could use a semi-transparent black layer on top of others), except the area around torches or fireballs for example.

  • Actually think I got it working, sort of..

    It uses a combination of alpha clamp and alpha threshold (download from forum)..

    Only places where none of the lights shine have shadows..

    It's awesome ! Thx a lot !

  • LittleStain

    I tried this effect (AlphaClamp) but I'm not really sure I understood how to use it properly

    Could you please help me out ? show me a CAPX example ?

  • [quote:1a0c0xt5] RamPackWobble » Tue Nov 10, 2015 8:56 am

    Yes I see what you mean, sorry. I think you could do something along these lines using LOS to a tilemap but it would be a blocky?

    also look at the following post where Magistross posted a clever shadow casting capx which might give you a head start ? (only for one light, but with work ...)

    viewtopic.php?f=147&t=150994&p=958035&hilit=+404#p958035

    Please post if you make any progress ?

    Interesting idea, but the result is really blocky

    [quote:1a0c0xt5]Post by LittleStain » Tue Nov 10, 2015 9:35 am

    I believe it can be done with semi-transparent-shadows and the alpha-threshold effect on the layer where the shadows are..

    I didn't know this effect, bit I'll give it a try, thx for sharing !

  • I think I understand what Aracalaus meant, because I had the same problem, and it isn't solved in your capx file :

    -> tanks aren't realistic lightsources, because if you have a tank on each side of a wall, a shadow is cast on each side, but instead they both should be enlighted

    Unfortunately, as far as I know the "shadow caster" behaviour allows you to cast shadow (thx captain obvious) but that's all, so if an object is enlightened on multiple side, it will cast multiple shadows, and oposed lightsources won't cancel each-other's shadow...

    I wanted to use it in my game too, but I have no idea how to fix the problem, and I'm not sure it's even possible in construct 2...

  • As a french guy, playing with exotic english words can be quite difficult indeed

    It would be awesome to add a difficulty selector, with a different list for each level.

    Anyway, it's a nice first game, keep going !