Magistross's Forum Posts

  • Very clever way of doing things. However, it doesn't seem to be doing exactly what spongehammer wanted.

  • Here's a more "programmer" way of doing such circuits. Might be a little bit too complicated though...

    https://dl.dropboxusercontent.com/u/7004246/circuit.capx

    First time doing recursivity in C2... and man was that a pain ! <img src="smileys/smiley36.gif" border="0" align="middle">

  • Is there any way ? "stop loop" doesn't seem to work for the "for each element" condition of the array object. Is that a bug ?

  • There are other ways to do such comparisons. Here, I modified Joannesalfa capx to show the use of the logical OR operator (the |), and an alternative method using a function.

    OR blocks are definately easier to read... although I hate the fact that you can't combine AND and OR in a single block.

  • A simple fix for that would be to disable the scroll to behavior of the hidden object.

  • I think I might know what your problem is. The For Each XY element will always loop through Depth-0 only. Are you expecting that both "levels" get created at the same time ?

  • Create two distinct events. One for the keyboard, one for the Gamepad. In the gamepad event, add a "trigger once while true" condition (found under the System condition)

    The keyboard event is already a trigger, so no need for that second condition there.

  • It all depends on how you access your array when you create your levels. Could you detail a bit on what you are currently doing and what or how it goes wrong ?

  • philzeleski

    Sorry for the late response, you should the "@username" trick so your correspondence know they have a message waiting for them ! <img src="smileys/smiley2.gif" border="0" align="middle" />

    The XPath that qualifies the first power's name is actually this : "/rows/row[1]/PowerName"

    You should rename your "rows" tag to "powers" and "row" tag to "power", it'd make more sense that way ! <img src="smileys/smiley2.gif" border="0" align="middle" />

    Now for your second question, simply set the text to :

    "Requirements: " & XML.StringValue("/rows/row[1]/PowerName")

    rob

    I don't understand what you actually want. Could you explain it a bit more ?

  • You could also use "Insert at Array.CurX + 1" to get the newly added value picked next in the for each.

  • I just tested it and it does indeed seem that you can do it. But you must do a push back if you want the new value to be selected by the for each, otherwise the same value get picked twice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First of all, your XML contains error. Some characters cannot be used in tag names. Minus and plus signs are a no go, and so are spaces.

    Second, you'll have to get familiar with XPath expressions if you want to be able to fetch whatever data you want.

    I've prepared a small example for you using your XML data. It displays the description for the selected power. You should be able to build upon it. Happy learning !

  • Here's a simple yet working example to help you understand how it could work.

  • You can emulate a logical OR with a function. As pictured here.

    <img src="http://www.freewebs.com/johnwof/or.PNG" border="0" />

    A simple reversal of the logic could also emulate a logical AND... but it's quite useless considering Construct already does that ! <img src="smileys/smiley17.gif" border="0" align="middle" />

    edit: Oh, I almost forgot... just call this function in a condition like so : System -> Compare two value

    1st value = Function.Call("OR", statement1, statement2...)

    2nd value = 1

  • Of course it's possible. Depending on how you implement your characters, the method varies. If you have only one character on the layout at the same time, simply delete/do not create the other ones. If multiple playable objects can be present simultaneously, disable the behavior of the inactive ones, and set the scrolling to follow the active one.