HawkRose's Forum Posts

  • Okay, I've adjusted my code for ES-Skill Select, and as far as I can tell, it's identical to yours. This is clearly not the case, however, because mine's not working properly. Also, I have tons of questions.

    Problems:

    1) In Hero Select, the "members" array in your example shows up blank. Mine displays "Text" both when I'm working on the layout, and when I run it. Otherwise it works fine.

    2) In Skill Select, preview functionality isn't working. For some reason, the "frame" parameter doesn't change from its initial value, and always shows frame 0... actually, this problem seems to have magically remedied itself since I began writing this response. Could Construct 2 confuse your capx (with edits) with my project when I open them both at once? Weird.

    Questions (apologies, my notes are a little scattered, so these might jump around a bit):

    1) Line 5:

    a. Why do you destroy the initial "skills" array?

    b. I assume that I'll just need to add a new array (with concomitant "addSkills" data) for each additional character I want the Skill Select layout to recognize. Is this correct?

    2) Function.Param: I think when you set local variables equal to this expression, you're essentially creating a slot for information needed in order for the function to run. For example: when setting the parameters for the "addSkill" function, you set heroName = Function.Param(0), which means that, on calling this function, a heroName value will have to be supplied in order for the function to do the stuff it's supposed to do. Is my understanding correct?

    3) Line 46: I think this line is taking the information provided when addSkills is called to populate the active member's "skills" array. The first action puts the skillName (supplied in the "addSkills" section beginning with Line 6) into the skills array. The next two lines seem to be filling in the type and frame data in the array, but I don't understand why their location in the array is expressed at (self.Width-1, 1) and (self.Width-1, 2).

    4) Is it correct to think of each line of data in the array (ie "Arthur", "attack", 0) as a point in a Cartesian coordinate system? Is there a better term for describing this than "line of data in the array"?

    5) What establishes the CurX value for the skills array? (relevant to Line 53) What is the condition which sets the value for skillNumber doing?

    6) Line 37: By the transitive property of equality, the parameters given for the "updatePreview" call are skills.At(skillName.Name, 1), (skillName.Name, 2). I think these correspond to the type and frame values in "the line of data" in the "skills" array that corresponds with that particular skillName.Name. Is that correct?

    7) As you may have surmised from my previous questions, I am having trouble understanding the relationship between various elements in arrays. Is ["Arthur", "attack", 0] a single data point, or three data points? Which (if any) of these correspond with Width, Height, Depth? Why, when establishing the parameters for a function call, is it written (self.Width-1, 1) or (skillIndex, 1)? These remind me of (x,y) coordinates, which is perhaps causing some confusion.

    Thanks again for your help.

  • Wow. You have totally overhauled this thing. I'm still going over everything you've done, trying to understand what I can before I come back with questions, but thank you so much for your help thus far.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks so much for doing all of this! Do you mind if I take a closer look over the next day or so, and get back to you with some follow-up questions?

  • Very new at Construct 2.

    I'm working on a tool for playtesting a card game prototype for an RPG combat system.

    So far, I've cobbled together my code mostly through trial and error. I'd like to know if there are places where I could use things like arrays or functions to make my life easier, and use fewer lines of code.

    Basically, my problem is that I don't know when I'm being inefficient, and when I just need to soldier on, and input that data line-by-line.

    [attachment=0:3u7ytzxc][/attachment:3u7ytzxc]

    You need to run beginning with the 'Mission Select' layout to allow everything to function properly, such as it is.

    Thanks in advance for any help!