RageByte's Recent Forum Activity

  • Some prototype gameplay of my Doctor Who fan project:

    https://www.youtube.com/watch?v=S7FUmBpH6WE&t=6s

    Your game looks really good, good luck!

    EDIT: I was suggesting you post screenshots but you already had.

  • If you only need 2 values I guess the simplest way is to store them as "Value1, Value2" in a single key and then use tokenat to get them. For example tokenat(Dictionary.Get("ThatParticularKey"), 0, ", ") will get you the first value in the key. Change the 0 to 1 and you get the second *value. The 0 is the index and the ", " is the separator between values.

    EDIT: meant to say *value, not key

  • It's better to move to the new built-in Functions feature. It helps you make your project events modular and the functions can be easily looked up.

    Although, I do not recommend Function Maps, use the Scripting Feature for string based Function calls.

    > 	runtime.callFunction("functionName", param1, param2, param3, ...);
    

    I hope that helps.

    Hmm, I'll give that a try, thanks. That could really trim some of my code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The restrictions of the new functions are intended to both enforce better organisation on your project, and improve performance. For example if you are allowed a function with the same name in two places, you can no longer look at a function and know what it does - you have to be aware of the entire rest of the project and see if there are any other functions with the same name. Besides, there's no reason to do it: you could just use one function with a series of sub-events to do everything in one function. And if for some reason that is difficult or awkward, you probably actually just want two separate functions. Now with the new functions you can look at one function and be confident that is the full logic of the function right there since other functions with the same name are not allowed. This improves your ability to reason about your events. It's also faster since the engine doesn't have to handle iterating over multiple functions with the same name, it just goes to the one function directly and runs that.

    There are also major usability improvements, like being able to properly name and describe parameters, and renaming functions and parameters automatically updates the entire project for you.

    I would strongly discourage you from using the old functions since they have poorer usability and much slower performance. Also in general deprecated features should not be used in new projects, since one day eventually they will probably be removed.

    There's more info in the blog post Construct 3's new redesigned functions and More about Construct's new functions.

    This got more attention than I imagined it would. Is there any chance you could make it so we can set default maps and strings for a function directly when we create it, in some update in the future? I have already switched to new functions and am getting used to them.

  • Actually you can use the old function on C3 runtime, but since its unprecated you can't add it as a new object, although you can use it if its already added in your project.

    But I still doesn't understand your reasons to not use the new functions, since it can do all things the old function do and more.

    I used to call functions directly by string variables and make a whole tree of them. I can still do that now but it's a bit more tricky.

  • Wow, I didn't know that. Thanks for the info. I guess for better or worse I have to integrate C3 functions into my builds.

  • The old function system was more rudimentary but in some ways a lot more flexible. I used to take full advantage of the fact that you could call a function willy-nilly just using a string and the fact that parameters were not restricted to number/string/boolean.

    Now if I want to build the same kind of flexible functionality for my scripts I have to use a much more elaborate and clunky build.

    My question is, would it be safe enough to switch back to the old system? And by that I mean starting my projects in Construct 2 and then converting them to Construct 3 but without the new functions. My fear is the old functions will become completely deprecated in the future and I'll have to switch back to C3 functions anyway.

  • I'm going to guess it's not possible

  • I have a silly question I haven't found any answers for. How do you change the width of the event and action columns on the mobile editor? Is it even possible?

  • I finally managed to implement my solution in the app I was talking about. Just to confirm, the whole point was to edit metadata that consists exclusively of text without corrupting the binary parts of the files. The app loads each file inside a specified folder as binary data, then copies the data into a text string and uses the string to determine where the text is and where the actual binary data is in order to separate them. Then it edits the text, converts it back to binary and sticks the real binary data to it to re-assemble the file.

    I now was able to mass edit 400+ files in a matter of minutes and save loads of time and effort so thank you all for your help.

  • I am currently working on manipulating the metadata in a format called EPS. At it's origins it's all text but because I save the files in a custom Adobe format they call EPS10 (which also allows the format to have metadata at all) there is a portion of it that is encoded as binary data.

    What I am trying to do is separate the text from the binary without touching the latter. I've managed to do this in a small test project, on a txt file with special characters. I load the file into a BinaryData with Ajax, then I copy the binary into a string as text, solely for the purpose of figuring out where the binary data starts. Within the string I look for a certain phrase/tag that signals the begging of the binary stuff, which, thankfully, is all at the end of the file. In this case I choose an arbitrary point where I break the file in half. Now I have the ByteOffset by which I can copy the binary data from the BinaryData object into a new temporary BinaryData object, for safekeeping. Now I cut off the corrupted binary data from the text string and do my edits on the meta part of it. Now I rewrite the BinaryData object by loading the text string into it, aka the first half of the file and then I attach the actual binary data I was safekeeping, aka the second half of the file. Now the file is successfully altered without corrupting the binary information. And just to clarify, I indeed have no intention of altering that information, only to work around it without breaking it.

    My main confusion was about how to use the data manipulation actions on the BinaryData object since I never worked with binary before. I think I got it to a degree. I am yet to implement this technique into my actual software but the test project seems to have worked because in the txt file it alters, the first half has it's special characters all screwed-up while the second part doesn't.

    As for JPGs, I see that they keep all their metadata right at the beginning of the file so it would probably work the same.

  • I also mentioned I have no idea what to do other than load and save the files using the Binary Data Object. When I load them as text I put the data into a string and use find, replace and such to make the edits I need. How do I do that with the data inside the Binary object? I tried converting it to text but it brought me back to the same problem.

RageByte's avatar

RageByte

Member since 21 Sep, 2016

Twitter
RageByte has 10 followers

Trophy Case

  • 8-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies