helto's Forum Posts

  • Kyatric

    Velojet

    Thanks guys, will do.

  • Velojet

    Kyatric

    There are several reasons:

    I have extra code that references the parent when loading games in an iframe.

    adding javascript functions

    passing/referencing dynamic data

  • So I find myself editing the index.html file from my games after exporting them quite often.

    This is simple enough, but becomes a nuisance when copying all the files over from a new build later, knowing that it will overwrite any changes I made in the index.

    I can set up a special case where it will ignore the index when copying everything, but I just want to be sure that I will never need to replace that file with a new version or a new export.

    I was thinking it would be cool if within Construct2 there was an html template that more advanced developers could edit and would be used to create the final index.html upon export.

    Anybody else already have a solution they use for this?

    I searched the site and didn't come up with anything

  • I am trying to pass in some initial data to the game similar to this post:

    http://www.scirra.com/forum/global-variables_topic50853.html

    However this example uses a button click and I am trying to do this onload

    I have a game that is being contained in an iframe and I am currently doing this from the parent:

    iframe.onload = function()
      {
         iframe.contentWindow.setVars();
      }
    

    The setVars function defined in the index.html used as the iframe src looks like this:

    function setVars(){     
                   var gameIDField = document.getElementById("gameID");
                   var gameID = "2";
                   gameIDField.value = gameID;
              }
    

    gameIDField is an offscreen textbox in the game with id "gameID"

    It seems that the onload is not enough to wait because I'm getting gameIDField as null. I would really like this to be event based if possible, maybe I'm just missing something.

    I have confirmed that this will set the text if forcing to script to wait a second or two, but this is not acceptable for a solution

  • very straightforward, I appreciate the tip :)

  • I am making a sidescrolling game where obstacles will be randomly generated. However, I want the series of obstacles to be clean and not just jumbled or impossible to navigate.

    My solution to this problem was to create groups of obstacles to randomly generate instead. I imagine I will want to define these groups in an external file and load them in via the ajax object which I am comfortable with. Maybe something like this:   obj1:0,obj7:50,obj3:100,obj3:140

    That string would represent a list of objects to spawn, along with a corresponding x offset that would place it behind the spawn x location.

    Here is where I'm not sure how to proceed:

    I want to be able to create these objects based on the string without needing to use a huge amount of events or having to repeat events for each scenario. What would be the best way to approach this, keeping in mind that I want it to be clean and dynamic.

    Thanks :)

  • Thanks PixelMonkey, works like a charm.

    For those having trouble finding the compare like slw666, its in System->General->Compare two values

    Sadly after implementing this I had to ditch it because my player has a wait attached to his jump. This is to allow for a scrunch down in the animation before jumping. The wait appears to be enough to nullify a distinguishable difference in time for the space press.

  • ty, I searched and didn't come up with that

  • I'm trying to set up a dynamic minigame library and I'd like to know if anybody has some suggestions for how to get initial data into the game. I understand php and working with the AJAX object, but how can I get the minigame.id from my database to send with the request without having to hard-code it into the game?

    It would be nice if we could pass vars in through html, but I don't see any options for this.

    Has anybody else done this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You were correct, thank you.

  • I didn't want to have to stop the sounds, since not looping should do that for you.

    I'm using a sprite with two different animations for the button states.

    My solution ended up being 2 conditions: mouse over and is animation playing

    Oh and thanks for the tips guys :)

  • Kyatric

    I've tried playing a sound on mouse over object, and it plays it constantly. And yes, looping is set to false.

    Any ideas?

  • Hey guys,

    This is great tool to play around with. Almost finished with my first game.

  • Normally I would blame the browser for causing new problems, but I caught an error you guys might be interested in.

    [10:28:27.962] Exposing chrome JS objects to content without __exposedProps__ is insecure and deprecated. See developer.mozilla.org/en/XPConnect_wrappers for more information. resource://ext-at-sprng-dot-me-api-utils-lib/securable-module.js -> resource://ext-at-sprng-dot-me-api-utils-lib/content/worker.js:230

    I'm on windows 7 64 bit Firefox 15.0

    Interestingly it works for me in preview mode fine, but after exporting and putting on our server, it crashes every time(unless I have the console open?)

    Anyways will be curious to hear of any solutions/workarounds. For now I'll probably just downgrade ff, but I can't count on that from my users.

  • I guess I see Sully's point, adding a warning would be annoying and I'm probably just used to it.

    Maybe a message at the top like the yellow ones that say its about to add an object to the entire project with the countdown. Could just warn the user without popping anything intrusive up.

    Anyways, keep up the good work!