philzeleski's Forum Posts

  • I am trying to create a Diablo II style skill tree. For the purpose of my initial prototype, what I want to do is have three icons organized on the left pane on the screen. On the right is an empty pane. This pane will be populated with data that is tied to the icon that is clicked on on the right pane. First off, let me explain what I do know. I've taken a look at the following tutorials:

    scirra.com/tutorials/354/xml-parsing

    This one taught me how to reference data in a pasted XML file.

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

    This one taught me how to add a .xml file to a project.

    Here's what I am trying to do:

    -Load a .xml project file on start of layout.

    -This .xml file looks something like this:

    (EDIT: I've corrected the issues with the XML shown below based on feedback pointing out it was borked)

    <?xml version="1.0" encoding="UTF-8"?>

    <rows>

    <row>

        <PowerName>Heavy Slash</PowerName>

        <Requirements>Long Sword</Requirements>

        <Keywords>Sword, Long Sword, Technique, Focus Builder, Accurate, Mandatory</Keywords>

        <Power>1(W),Special</Power>

        <Type>Technique</Type>

        <PlusResource>+1 Focus</PlusResource>

        <MinusResource>N/A</MinusResource>

        <Target>Single</Target>

        <Range>1</Range>

        <Splash>N/A</Splash>

        <Resist>Physical</Resist>

        <Duration>Instant</Duration>

        <Cooldown>At Will</Cooldown>

        <Description>Accurate: +5 Precision. Deals 1*Weapon Damage to target. Builds 1 Focus. If caster has no Focus at time of usage, damage is boosted to 1.5*Weapon Damage.</Description>

    </row>

    <row>

        <PowerName>Runthrough</PowerName>

        <Requirements>Long Sword</Requirements>

        <Keywords>Sword, Long Sword, Technique, Focus Consumer, Accurate, Mandatory</Keywords>

        <Power>1(W), +.5(W) per Focus</Power>

        <Type>Technique</Type>

        <PlusResource>N/A</PlusResource>

        <MinusResource>-All Focus</MinusResource>

        <Target>Single</Target>

        <Range>1</Range>

        <Splash>N/A</Splash>

        <Resist>Physical</Resist>

        <Duration>Instant</Duration>

        <Cooldown>At Will</Cooldown>

        <Description>Requires at least 1 Focus, consumes all Focus. Accurate: +5 Precision. Deals 1*Weapon Damage (plus .5 Weapon Damage per Focus consumed). Reduces the target's Toughness by 10 (plus 2 per Focus consumed) for 2 rounds. Actionless if user has 3 or more Focus.</Description>

    </row>

    <row>

        <PowerName>Defensive Strike</PowerName>

        <Requirements>Long Sword</Requirements>

        <Keywords>Sword, Long Sword, Technique, Focus Builder, Accurate, Offhand, Actionless, Accurate</Keywords>

        <Power>1(W)</Power>

        <Type>Technique</Type>

        <PlusResource>+2 Focus</PlusResource>

        <MinusResource>N/A</MinusResource>

        <Target>Single</Target>

        <Range>1</Range>

        <Splash>N/A</Splash>

        <Resist>Physical</Resist>

        <Duration>1 round</Duration>

        <Cooldown>2 rounds</Cooldown>

        <Description>Accurate: +5 Precision. Deals 1*Weapon Damage to target. Builds 2 Focus. Boosts Toughness by 10 (plus Sword Proficiency Level) until end of next round.</Description>

    </row>

    </rows>

    -I would like some way for the action of clicking on a specific sprite, on the left pane, to tell text objects on the right pane to load specific data from one of the three power entries in the .xml file above.

    What is the most efficient way to do this? I am struggling with reconciling what I've learned from the first and second tutorial I linked to above.

    Thanks in advance,

    Phil

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That improved example helps a great deal. Thank you! I haven't been able to find a tutorial that explains how to call data from XML or JSON. I did manage to find a tutorial that explains how to add such files to the project file though. So, I suppose that's a start.

    Do you know of a tutorial that can help load data from an XML file and toss that into an array or something that can be easy referenced and manipulated?

  • Boom! Knowledge. Thank you for that. I would appreciate further examples, they're tremendously helpful. In the meantime I will try to implement what I've learned here.

    Another question:

    Is there an easier way to populate data into an array (or other data storage object)? Can an array or some other data storage object call data from a text or .csv file line by line?

    Regards,

    Phil Z

  • First off, thank you very much for replying! Secondly: My array looks something like this:

    -The first row contains several columns. The first is name and the second through 13th provide further statistical data. Damage, Range, Keywords, etc.

    -The second row would contain a second power and its details.

    or 0 to array.height

    .. create text at 100, 100+100*loopIndex // these could be icons or whatever, you could set icons frame/animation based on array value

    .. set text to array.at(0, loopIndex)

    .. set text.Index to loopIndex // an instance variable that defines which row of the array this text represents

    At risk of revealing that I am a noob, I am going to have to ask... what is loopindex? I am just getting into arrays. So, I don't entirely follow what you're suggesting. I've looked at the sample project you sent and I understand only the first event. The second and third, I think I get... but the Loopindex part is confusing me.

    Again, thanks so much for responding. Double thanks for posting your example.

  • So, I am in the process of prototyping a skill tree and am running into a few issues. I have telling myself "There has GOT to be a better way" quite a bit. So, here's what I am doing:

    The left side of the layout is a pane that contains a WoW/Diablo II style skill tree with a number of colorful icons that can be clicked on. On the right side is a pane that is intended to give statistical information once you click on a power.

    Here is how things are set up now:

    -Currently, I have a 2 dimensional array. In each row is the power name and relevant information all of this is set at beginning of layout. This means for each attribute of a power, I have to create an event to add it to the array. This is a colossal pain in the butt.

    -The right pane has a number of text boxes that call text from the array depending on the power icon, that is clicked, in the left pane.

    Is there a better way to store and more easily re-call data? Is there a way where a simple xml or text call can store this information and another object can easily recall it?

    Thanks!

  • Would this need to work in conjunction with any other behavior type? Or is this achievable solely with the physics behavior?

    EDIT: Found the solution in an example that came with Construct done completely with Physics behaviors. Thanks!

  • Hello all,

    Construct newbie here! I've been using the search feature in these forums and flipping through pages of tutorials trying to find out the best way to implement a rolling character.

    Here's what I am trying to accomplish:

    1) Player is roundish and rolls around.

    2) Player should appear to visually roll around left and right, not just slide. In other words I want its texture to rotate around much like 8-directional movement characters can.

    3) The player will roll only when moving. When the player stops moving, they'll stop in their current rolling state.

    4) The player will also need to be able to fall and jump as well.

    This is probably fairly simple, but exactly how to implement this has eluded me thus far. That's why I have come to you all for help!

    Thanks in advance!