ramones's Forum Posts

  • Print out the width/height/depth of the array when the button is clicked. And make sure there's no stray spr_playerspawner at (0,0) and that there is a spr_playerspawner on the layout :)

    Either the array is the wrong size and the value isn't being set when the button is clicked or the value is being set to 0. If the array is the correct size you could try setting the value to -1 and see if it changes.

  • Are you loading the array from JSON somewhere in your event sheet? If you had saved an array of width 15 earlier and were loading that it would override the width of your array. Just a guess.

  • VectorX is 600 but the platform max speed is 330, that's why the horizontal movement quickly stalls. I'd probably do it like this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well you're spawning a ball if ballcount <= 2 in event 22 and it always is because of event 21. You could rearrange it like this:

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/ballcount.PNG" border="0" />

  • Yep any files added as project files are exported with the project.

  • When you have the array filled you can use the array Download action to save it to a file:

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile01.PNG" border="0">

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile01a.PNG" border="0">

    When you run that action it will pop up the save file dialog or just save the file directly to your download folder depending on how you have your browser set up:

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile02.PNG" border="0">

    The file looks like this. It's the array in JSON format (I call it 'level.json' and have notepad set to open .json files. You can call it 'level.txt' or anything really.):

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile02a.PNG" border="0">

    You could also create this file by hand or generate it with code.

    Now you can add that file to your project (When you want to change the level just open this file from within C2 and edit it instead of deleting and importing it again.):

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile03.PNG" border="0">

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile04.PNG" border="0">

    Now you need to add the AJAX plugin to the project and request the file:

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile05.PNG" border="0">

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile06.PNG" border="0">

    When the request has completed, the value AJAX.LastData will hold the contents of the file. Use the array 'Load' action to load it into the array.

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile06a.PNG" border="0">

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile07.PNG" border="0">

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/arrayToProjectFile08.PNG" border="0">

    Example: levelEditorExample.capx (r139)

  • Pick a random enemy and send it to the target. When it arrives, set hasMoved to True, then pick another random one that hasn't moved yet and send it etc.

    oneAtATime.capx (r139)

  • You can use the array download action to save the array to a file and then add it as a project file. See this:

    https://www.scirra.com/tutorials/328/using-project-files-in-construct-2

  • Hmm make sure there is actually a path from bad_dude to dude and that neither of them have solid behavior if you're using solids as obstacles.

  • Have you got another event:

    bad_dude: on path found -> bad_dude: move along path

    And make sure you're not checking for paths every tick when in line of sight. You could add a "system:every x seconds" condition.

  • You don't want "" around the variable name when you save it. You're saving the string "xed" instead of the value of the variable.

  • The 'ProgramTip: NOT Is on-screen' event won't run if there is no 'ProgramTip'. You should check if ProgramTip.Count == 0.

  • You can change the loading icon in Files/Icons/loading-logo.png.

    <img src="https://dl.dropboxusercontent.com/u/8367729/construct/pics/loading-logo.PNG" border="0" />

  • First you're using a for each loop so only one sprite will be picked on each iteration. There's no point picking the sprite with the smallest distance from a group of one. As well as that 'on pathfinding path found' triggers once for each sprite so even the loop is unnecessary.

    You'd want to calculate all the paths first and then pick the sprite with the smallest distance once each sprite has calculated it's path.

    moveWhenAllPathsFound.capx (r139)

  • It's probably the disabled 'else' in event 71. Without the else then when you press 's' it drops the civilian and then immediately catches him again.