HawkRose's Recent Forum Activity

  • Hi all,

    I imported a custom SpriteFont, but I have discovered that it doesn't recognize blank spaces. If I tell the SpriteFont object to set text to "Hello world", it displays only "Hello". I can insert spaces by setting the text to "Hello*world" (* is not supported by the SpriteFont), but the spaces are the size of a full character, so it looks really weird. Also,*I'd*prefer*not*to*type*all*of*my*text*like*this.

    My questions:

    1)How do I get the Sprite Font object to recognize blank space/transparency in the imported image as a "space"?

    2)Is there a way to reduce the size of the "space", such that there is not an enormous distance between multiple words in a given SpriteFont text?

    Thanks in advance for your help!

    Tagged:

  • Thanks for your replies, dop2000 and Laura_D. Given the complexity of the dialogue box, I'll try your JSON tutorials, Laura_D.

  • New C3 user here.

    I'm using bbenny93's https://www.construct.net/en/tutorials/dialogue-box-lazy-people-1177 to study XML, and to look at one way of implementing a dialogue system.

    I think I understand in general terms what bbenny93 is doing: creating a JSON dictionary, and setting the key values to XML attributes in order to call lines of dialogue, and whatever functions might be related to that dialogue (animations, audio, cursor object, etc.). However, I can't understand the expressions bbenny93 is using to go about this, or why certain steps are necessary.

    Some questions:

    1)Line 50: ProjectVariables sets the key "name" equal to Function.Param(0). Which function is this does this apply to? "dialogue"? "create box"? Does it matter that "create box" doesn't seem to have any parameters? What will the value of "name" be at this point in, say, the Demo layout?

    2) Line 50: System sets the "dialogue" parameter, "dialogue_box_project_prefix" to... what? What does the expression "&ProjectVariables.Get("name")&"']/@ mean?

    3)Line 78: What in the wide wide world of sports is a'going on here? RegexMatchCount and all that follows it look like Greek to me.

    I've read this XML introduction https://www.liquid-technologies.com/xpath-tutorial, this tutorial on XML Parsing https://www.construct.net/en/tutorials/xml-parsing-209 and this one on using XML for dialogue https://www.construct.net/en/tutorials/read-xml-game-talk-518. I've also recreated and played around with the event sheets for the C3 tutorials myself. The latter tutorial says, "I hope you already understand the use of &ReferencingAVariableLikeThis&, if not, look into the Text Box tutorials as they can provide insight." So far these directions have proven too nebulous to be helpful. I also tried the Expressions and XML sections of the manual, but they weren't much help.

    If anybody can help me to understand the above, or point me in the direction of resources that might provide more comprehensive explanations of the problems in question, I'd be very grateful.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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!

HawkRose's avatar

HawkRose

Member since 17 Nov, 2014

None one is following HawkRose yet!

Trophy Case

  • 10-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies