Posts by Jax

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.

    Hi Uro,

    I don't have access to Fusion at the moment (it thinks my copy has expired or something), but LB kindly still hosts the help document: Please login to see this link.

    I think you can search for group "*", the item whatever "ItemA" and the value "*" and then the number of results expression (if there is one) should tell you how many there are. You can also iterate through the values.

    Hope this helps. If you need an example maybe I can try to figure out what has gone wrong with my copy.

    The reason was just that Unicode MMF didn't exist at the time I wrote it! You are free to convert it - you can get the latest code off Clickteam, I think Yves has it - but beware! I wrote it when I was about 15. It is not good!

    (The chart object being written before HWA was a bigger disappointment, as it doesn't work at all now, and I thought it was pretty cool)

    I continued the conversation via PM to stop spamming this thread too much, but that's not dissimilar to the way went for (except I put it in helper in the form ^\t* so that it was only indent lines, but I doubt there is any practical distance)

    Ah sorry I didn't get what you meant!

    Perhaps try this:

    function helper(x,y)
    return x .. y:gsub("\n","$") .. "\n"
    end
    function fix(a)
    local b="\n" .. a:gsub("\r?\n","\n") .. "\n"
    return b:gsub("([^=\n]+%=)([^=%[]*)\n",helper):gsub("\n","\r\n")
    end

    I haven't had a chance to really test it, but that should allow multi-line entries which don't start on an empty line. I thought that was part of your desired format, sorry! I also changed it a little bit more so it doesn't use backticks anymore, which I thought was to get around some special behaviour in gsub and newlines, but apparently I just imagined that.

    I should note that multiline entries cannot have a left-square bracket ("[") in them. If that's a problem there might be some ways around it, but hopefully it isn't such a big issue.

    I think replacing

    return "`" .. x .. y:gsub("`","\\n") .. "`"

    with

    return "`" .. x .. y:gsub("`","\\n"):gsub("\t","") .. "`"

    will do - unless you only want to remove tabs at start of lines but still allow them inside. If that's the case, then:

    return "`" .. x .. y:gsub("`\t*","\\n"):gsub("^\t*","") .. "`"

    Should do it, at the cost of being a little more complex.

    This Lua object is actually really cool. Good work Donald May (is that Vortex2?)

    [Edit 1: Actually in the latter case, merely return "`" .. x .. y:gsub("`\t*","\\n") .. "`" should work for the reason you previously mentioned about white-space being ignored)]
    [Edit 2: Forgot to actually change the code in Edit 1]

    Opps sorry. If you go to the Lua object and look at the script property (which is its only property) you can change it to this:

    function helper(x,y)
    return "`" .. x .. y:gsub("`","\\n") .. "`"
    end
    function fix(a)
    local b="`" .. a:gsub("\r?\n","`") .. "`"
    return b:gsub("([^=`]+%=)`([^=%[]*)`",helper):gsub("`","\r\n")
    end

    (which is identical except for a backtick on the one-from-last line, which I convinced myself was needed but actually isn't). I hadn't actually used the Lua object before, but it's pretty cool actually - although I swear the Lua pattern language doesn't do the right thing sometimes. I couldn't find the Python object in the manager.

    It turns out Fusion 2.5 is free right now so I was able to download it (I swear I've bought it at some point but I can't find anything in my emails about it). Here is an example of using the Lua object to convert some text from CruddyBuddy-INI form to standard the INI form (except using escape characters too): Please login to see this link.
    I haven't done the saving bit, but I think it should be easier (although probably still want to use the Lua object since it turns out the regular expression object is pro-only)

    Another thing I tried was setting the newline character to NewLine$ + NewLine$, and then, providing you are happy with two-line-spacing between everything, you can have a single new-line in your comments. That's a bit easier.

    I'm afraid I don't have my environment set up anymore to do any extension coding very easily. However, I wonder if you could do something like this:

    1. Load the file into a string (using the File object or something?)
    2. Perform a regular expression on the whole string, something like ([^=]+)=(\n[^=]*)+ , and replace each match with the matched string having a simple replacement of \n to (however you want newlines to be represented). Repeat the until there are no more to be found.
    3. Load that into the INI object

    But it feels a bit complicated and I don't really know how you'd do step 2 inside Fusion (I don't have Fusion installed anymore, I think I might have lost my copy of it. I do have Multimedia Fusion 2 installed by with no extensions). I think there was a Lua and a Python extention at some point, which feels like it could be possible to write a function in - but again, I don't have these installed.

    Sorry I can't be of more help immedaitely.

    Would it be possible to add sometime in the future, a setting which would allow a value to have a real carriage return? I know you can do the \n escape character but I would like to be able to have a true NewLine$ like this:

    [group]
    line1=this is one
    continuous line
    line2=this is the next line

    All it would need is some sort of interpreter to look at the next line for the "=" delimiter and if it's not present it would tread the new line as part of the previous string

    Is this so the INI file looks in a particular way when users or other programs view it?

    For addition, a+b cannot overflow unless a and b are of the same sign.

    In the case that they are positive then it will happen exactly when a > (2^32-1)-b (assuming MMF still uses 32-bit integers, which I guess it does?)
    In the case that they are negative then it will happen exactly when a < -2^32-b (notice this is strict less-than, not less-than-or-equals)

    For multiplication, I'd probably just take logs of the absolute value. That is, log(|a|)+log(|b|) <= log(2^32).

    Hi BartekB,

    Ini++ originally didn't support empty groups - when the last element of a group was deleted, the group just disappeared. This was most natural from the point of view of data storage, but if you opened and then immediately saved an Ini file through Ini++ you would lose structure. An updated added basic support for empty groups (the update allowed empty groups and preserved the order of groups and items. Comments are still lost though). However, I didn't change the basic behaviour and it was by design that the "Set current group" function doesn't actually create the group until an item is added, as Schrodinger rightly said.

    Hopefully you won't have to rewrite the GameJolt API then! Feel free to PM me if you feel you've found other problems though.

    Hi Zugwang,

    There is a way to do something quite similar. You could have a group a bit like this:

    [Questions]
    1=What's your name?
    2=What's your date of birth?
    3=What's your favourite food?
    4=What's your favourite song?
    5=Do you prefer cats or dogs?

    Then you can delete the item with the name "1" (or alternatively, use the "Delete first item" option on the "Reorder a group" action). This will obviously leave you with this:

    [Questions]
    2=What's your date of birth?
    3=What's your favourite food?
    4=What's your favourite song?
    5=Do you prefer cats or dogs?

    Then you can use the "Reorder a group" action again with the "Renumber items" option (the very bottom one) and it will make it become:

    [Questions]
    1=What's your date of birth?
    2=What's your favourite food?
    3=What's your favourite song?
    4=Do you prefer cats or dogs?

    Does that do the job?

    No, there are no temporary files that they can read it. However, it is left in unencrypted form in memory. There are various tools which let you view or modify the memory (for instance, you can attach a debugger, or like those Game Sharks things you could get for the Mega-Drive). So it isn't completely secret but for most users this would be a lot of effort.

    I'm not sure about the specific case, but I believe that the object will not work with Unicode characters, but will work in general with MMF2.5 if unicode characters are not used. MMF converts the string when using old extensions, as far as I can see, and so any unicode characters will usually get lost (changed to another character which can be represented in whatever character set it is using).

    That said, given the line breaks are usual characters in the 8-bit character set it is strange this is happening.

    Well I can confirm the problem, and it is a bug it seems. But I can't seem to figure out why at all. In the latest build I fixed problems to do with this, but obviously not enough.

    I suspect not being able to rely upon the encryption in Ini++ is a bit of a problem for people. Sorry about this, it is very difficult to find the time to work on things. There are plans for a new light-weight version of Ini++ with cross-platform support, but again time is the problem.