brent_hamel's Recent Forum Activity

  • Just a quick question, as I've failed to find much online to help point me in the right direction...

    My goal is to:

    - load a Binary Data object with specific values from an external binary file

    - see them displayed as HEX using a text object tp verify they're correct

    - write them to a new external binary file

    What is the best approach to accomplishing this? I've noticed that simply including the source bin as a project file, requesting it through AJAX, saving it to the Binary Data buffer (UTF-8 Text seems to be the only option?), loading it into a text object (I've made my own decimal to hex conversion function) appears to function as expected, however, when I then try to write the binary data to a new file externally using AJAX, my file nearly doubles in size...

    What am I missing here?

    Thanks in advance!

    (Ideally I'd like to be able to write the bytes directly into the Binary Data object using either %00000000 Binary or #FF Hex... I don't suppose this is coming down the pipe any time soon is it?)

    • Post link icon

    I agree with Ashley that its better to use the advanced features of the behaviour... My own personal solution is:

    If CanJump = true, then

    If "Jump" is pressed, then set Y vector to "-JumpStrength" (as mentioned

    this does not allow for JumpSustain as it currently works)

    If "Jump" is released & Y vector < 0, then set Y vector to "Y vector * 0.25"

    (this essentially kills the jump but still allows the movement arc to feel

    natural)

    For coyoteTime:

    If OnGround = true, then set "Coyote Timer" to 1 (or whatever duration you prefer)

    Else set "Coyote Timer" to "Coyote Timer - dt"

    If "Coyote Timer" > 0, then CanJump = true

    Else CanJump = false

    So basically I check the conditions for CanJump, ie: IsOnGround, JumpCounter is less than JumpMax, CoyoteTimer > 0, etc, and then execute my jump with Set Y Vector, and do my own Sustain method. Honestly, for my purposes it works flawlessly, and to be fair, Construct 3 is intended to be accessible for beginners to help them learn to become more advanced... I honestly think adding the DoubleJump to the platform behaviour was overkill, as it was also easily done in events...

    Btw, I only use events, I have 0 code writing ability beyond doing some simple equations inside of event value fields... so like testing basic conditions and doing basic math instead of entering hard values into a given field...

    Hope this might help, cheers!

  • Hey all,

    Just wondering if there's a way to set up an Enum. I've created an input handler that reads the input state of 16 different inputs ( replicating a gamepad without being tied to the Gamepad plugin ).

    This handler uses a string that stores all 16 states, separated by commas, so when I test an input, I just tokenAt() the index I want for the specific input I want to test. Is there any way to tie these index values to actual string names for readability and convenience?

    I'm sure I'll remember the index order of all my inputs eventually... but it'd sure be nice to just type the name of the input I want and have the appropriate value serve as the actual index to be read from.

    example:

    current = "int( tokenAt( obj_inputHandler.inputState, 0, ", " ) )

    desired = "int( tokenAt( obj_inputHandler.inputState, Up, ", " ) )

    Is this possible or will have to come up with a workaround?

    Thanks in advance,

    Brent

  • My idea was that you continue developing your game with just one default spritefont object (English). And you can add 30+ spritefont objects for other languages to a separate repository layout. In runtime, if the selected language is not English, you replace the default spritefont, spawning another spritefont in its place, and copying text/size/color and all other properties to it. You will only need one "EnglishSpritefont On Created" event.

    I appreciate your workaround, I have one that I've been using thus far and will continue to do so, at this point, I have about 5 different SpriteFonts for English alone: TitleText, SubTitleText, MenuText, NarrationText, and CharacterText (this I can change the colour of on the fly, so that's helpful at least) and they're all different based on context and mood. I'll be doubling a few of these with a PlainText font I've made, which is white or black on the opposite BG, used for accessibility purposes and people with vision impairment. Other languages will also need the same treatment.

    It's fine for what it is, for now, it just seemed like easy value to add depending on how the plugin is working compared to other graphics plugins like Sprite, Tiled Background, and TileMap... (which all allow swapping the visuals on the fly) its curious that 9-Patch is in the same boat as SpriteFont though, so perhaps it IS some kind of limitation rather than oversight?

    I don't know, I just know it'd make my life infinitely easier if these features were in place, and I suspect I'm not the only one. I'll leave the thread alone now and keep limping along as I am, thanks all for the input.

  • That's fair, the last thing I want is to cause problems. I've posted my needs as an official suggestion on the appropriate site. I just hope it's something feasible, as I'm sure that if it is, it's likely quite low on the priority list, as you guys are swamped with stuff to do I'm sure.

    I was more curious if the lack of those features was simply an oversight, or if there was some technical reason for their omission.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Even with the modified plugin, you will still have to add and manage images, character sets and spacing data for each language. In my opinion it's not much different from adding multiple SpriteFont objects to your project.

    You can create a simple system which will automatically swap English spritefont for a spritefont in another language in runtime.

    I understand what you're describing, but its not the way I'd prefer to do things if possible. My ideal setup would include the features I've mentioned, and then simply loading all of my external SpriteFont image files into project, and then having a textManager array that would contain all the information needed for each font. Then its a single function to swap fonts at any time. Be it different characters that use different fonts, different sections of menus, users choosing to disable styled fonts in place of plain white or black text on the opposing background for clarity, etc.

    I've thought of a few workarounds, but my whole purpose for questioning these features being available or not, was to get away from workarounds and start doing things more intentionally. Not having to spend wasted time having to load and manually set each font, which at this point is numbering 30+, in editor, hard setting properties for each one, then in code, spawning potentially 30+ text boxes for each separate element of text, when I could, in theory, have a MUCH simpler system that could hot swap them on the fly, using only a single opbject and its various instances, for the entire project.

  • My intention was to simply use them as reference for creating a second independant version. Not modifying the originals. I can fully understand the reasoning behind keeping them hidden.

    It's really just this functionality that I'm hoping for, regardless of where it some from.

  • Those settings are all exposed and accessible, while Set SpriteFont Image and Character Set are not... It seems brutally inefficient to have to add extra SpriteFonts for every language/alphabet ( english, arabic, thai, chinese, russian, etc) * number of styles ( artistic style, single colour, multi-colour, serif, sans-serif, etc)

    For my specific application, all of my fonts use characters that exists within an 8x8 pixel grid, as all of my projects replicate old 8 and 16 bit aesthetics, but even if using hi-res fonts for a more modern look, I still think there's value in those elements being available for use during runtime. And while I don't actually use all that much text myself, having that functionality seems like it should be a no brainer unless there's some other factor playing into preventing it.

    Is there a technical reason that prevents this from being feasible or effective as a method of use?

  • The alternative is to have a separate SpriteFont plugin for every font style, language, etc, and then replace all instances in engine with the appropriate SpriteFont... which seems highly inefficient, time-consuming to set up, and kinda silly to have to do, frankly...

  • I'm looking to add:

    - Load Image from URL, so that I can swap Fonts on the fly, not just for style but also accessibility and language purposes

    - Set Character Set - this would allow being able to accommodate other languages more easily by allowing quick character set swapping on the fly

    Now this said, I don't know how the official plugin is doing things, so it may not be possible for some technical reason that I'm unaware of, however it seems more like an oversight then an exclusion.

    Thoughts? I have opened an official suggestion here

    construct3-21h2.ideas.aha.io/ideas/C321H2-I-170

    I think there's a lot of value to be added here for anyone interested in creating their own fonts as well as wanting to accommodate things like accessibility and language options in-game

  • Hey all,

    Just wondering where the plug-in and behaviour files are stored in the downloaded version of C3. I'd like to try making a duplicate Spritefont plugin and see about tinkering with some extensions on it, using the Sprite plugin as potential reference. Any ideas where the files might be?

    Thanks in advance,

    Brent

  • Thank you for the info!! I've submitted the feature request here: https://construct3-21h2.ideas.aha.io/ideas/C321H2-I-170, in case anyone is interested in having a look and seeing if it might be useful for them as well.

    The gist is to simply add "Load Image from URL" and "Set Character Set" to the Sprite Font plugin to add more use and versatility to an already fantastic plugin.

brent_hamel's avatar

brent_hamel

Member since 31 Dec, 2009

None one is following brent_hamel yet!

Trophy Case

  • 15-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies