MoscowModder's Forum Posts

  • That seems so much like it should work... but I must still be doing something wrong because after the first element (of 3) gets added, I get a Javascript error about being unable to read property 0 of undefined.

    My JSON looks like this (and it matches EXACTLY what I got when I hard-coded the values and output it using asJson):

    {
    	"c2array" : true,
    	"size" : [3, 1, 1],
    	"data" : [[["Item1"], ["Item2"], ["Item3"]]]
    }[/code:3azy3w3x]
    
    I know this is stupid, but exactly how hard would it be to add a behavior for Selects that lets it import a 1D JSON array? I think this might be handy for other people as well. Keep in mind I'm somewhat experienced with JS but have never written a C2 plugin before.
    
    P.S. In your example, one of the dimensions is 0. Shouldn't that make the array have a net size of 0?
    
    EDIT: Ha! I got it to work by switching two dimensions in my size. From [3, 1, 1] to [1, 3, 1]. Thanks a ton.
  • I have a select box that lets users pick a profile (save file) by name, given a list of existing saves. The game queries the server, which returns an array of names as JSON. I have confirmed that the JSON returned to the AJAX object is correct.

    I have tried setting the array's contents from this JSON string, but the array is still full of 0's. Also, the array's size doesn't change when I do this!

    Whether an array gets used or not, what's the best (or any working) way to fill in values of a select box from JSON?

  • I could do that, and it could work, but it seems rather clunky and would require making a screen-sized image for every menu in the game, and one for each layer of some layered menus, which would take up a significant amount of RAM when uncompressed in memory (I've had memory issues already with a big backdrop).

  • I don't think this is possible, but if it were that would help me so much that I thought I'd just check.

    Can you make a family with multiple types of plugins? Example: I want to make a menu item family that contains sprites and sprite fonts (and maybe normal text too). If not, is there a workaround that would make it work similarly? Or do I just have to make a set of events for each menu item class?

  • ryanrybot: I'm using Button Index exclusively. However now that I'm done with the implementation there's something else I can check before calling it a lost cause...

  • How unfortunate. I guess I'll just bill my game as "Playable with XB360-Compatible controllers!"

    I wonder if Firefox or Chrome offer addons for more controller types?

  • I'm trying to add gamepad support to my game, but Construct 2 will not recognize my cheap PS2-style gamepads. The LastButton property will always be 0 for them.

    When I test with an XBox360 controller, everything is fine. But I don't want to require every gamepad user to go out and get an XBox360 controller.

    So... where do I find out what gamepads are supported by Construct 2 or by the Chrome browser I test on?

  • Keep in mind my game is running in an iFrame on Kongregate. Does the Browser.Domain return the iFrame URL or the top-level one?

  • I have the game published to both Kongregate and the Chrome web store using an iFrame/hosted app. This means that both apps point to the copy of my game on my own server. Do I really have to publish to Kongregate in order to use this feature? Is it possible to have one copy that Chrome, Kongregate, and normal web users can all play on?

  • Update: I had an alternative idea - adding an extra login button which will open up the Kongregate login page. However, that doesn't work on my preview. Does it only work on live servers? Do you need to add your game's API key? Where do you do that?

  • HUZZAH!

    Since the last post, I've added 2 new levels! Besides that, tons of refinements to EVERYTHING. Gameplay, login, menus, etc. Check it out, and tell me what you think!

    PLAY

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My game, Carnage in Space II, has a custom login system that lets players (optionally) sign in, automatically sync their save files between computers, and view highscores and achievements all on my website regardless of where it's being played from. Currently, you can play the game from my website (http://carnageinspace.com) or Newgrounds; I plan to add Chrome Store and Kongregate.

    The problem is, Kongregate doesn't want any games to have login systems outside of their own.

    What I'd like is to have the game check if you're on Kongregate, and then send you to the custom login or the Kongregate login. I can customize my website to allow Kongregate accounts alongside normal ones, storing their Kongregate name instead of an email address.

    My problem: I don't see a way to detect that the game is Kongregate. How do I do that?

  • I'm not sure how possible this is, but it would help make my game more professional.

    What I have:

    During cutscenes, text is sent several "blocks" at a time to a message queue.

    While the queue is not empty, the blocks are sent one at a time to a textbox.

    The textbox starts displaying the text, adding one letter at a time.

    When you press a button after the text is all written out, the text is cleared and the next block is filled in.

    When the last block is finished, the textbox disappears.

    What I want:

    While a block is being written out, if there is any overflow (it doesn't fit into the textbox), it will automatically remove the top line of the textbox. This way, the text will be filled in line by line and the blocks don't have to be short enough to all fit on screen at once.

    So, in short: I want to:

    a) Detect that the current text doesn't fit in the textbox

    b) When that happens, find the substring that makes up the first line of the textbox and remove it

    Is this possible?

    It looks like this plugin can handle scrolling to the next line, but how do I detect overflow?

    EDIT: Solved it! I looked around at rex's samples for the Scrolling behavior and found that I can accomplish this by always scrolling to the bottom (scroll by percent: 1.0).

  • Hey, that looks like it should work! Thanks!

    Edit: And it did. Thanks again!

  • You don't seem to get what I'm asking.

    I know how to hide the cursor. I know how to tell when the user is using the keyboard. What I don't know is how to tell when the mouse moves.

    I want the mouse to re-enable when it moves. That's what I want to know. How do I tell when the mouse is moving so I can stop ignoring it?