farflamex's Forum Posts

  • Thanks Ashley. I do have that when I'm connecting to my uploaded files on my server. But it doesn't seem to work the same with a localhost (i.e everything just running on my local PC). I'll try fiddling about, see if I can get it to connect.

  • I'm testing my server on Xampp, rather than directly to a web address, mainly because it's easier and a bit less fiddly to do it on my own PC. But can I get Construct to connect to the localhost? Just copying the url from the browser into C3 doesn't work, it doesn't seem to be connecting.

    I can obviously just upload the tested scripts and then have C3 connect there but if I can do it all 'offline', that's a bit easier during testing.

  • Nice set of tutorials, thanks, I'll keep em bookmarked.

  • Ok, I think I've worked it out.

    I needed to do :

    JSON.For each entry in ""

    (subevent) - JSON.For each entry in "."

    That at least extracts the values individually.

    EDIT : Formatting issue with the forum again. The 2nd line a sub-event of the first.

  • Again, mine is a 50x50 array, I didn't want to paste that here, but yes, it would show as you typed it above in a 2x2 array.

    So is is possible to parse that to a C3 array?

  • Yes, typo. I typed it by hand from the screen and the forum box changed it slightly (i.e it separated the first square bracket for some reason).

  • Well I'm making my array in PHP and that's how arrays are formed. Is there no way to extract it line by line and then manually parse it into a C3 array?

  • I have a simple 50x50 PHP array, just integers that I'm trying to parse into a C3 array.

    For simplicity, if it was a 2x2 array, the JSON looks like this..

    [

    [3,2][4,1]]

    I assume that the first step is to parse this into a JSON object from AJAX.LastData. I AM receiving the string fine, as it looks above (although it's 50x50).

    I'm trying some kind of 'JSON : For each entry in', but I can't get it to work. If I try 'For each entry in ""' it just skips to the end in the debugger. Likewise, 'For each entry in "."'

  • Would I be correct in thinking that a lot of sprite fonts would use up a lot of memory? Say that I had 10 lines of text, if I used sprite fonts, would EACH of them require a copy of the graphical font?

  • Hmmm, interestingly, it does work but not if you just disable the comment, which is why I thought this wouldn't work. Removing the reference completely did allow me to change it.

  • I've come across this a few times with functions and haven't found a good way of fixing it, other than to manually copy the whole thing over. I have quite a large function which I thought would require a return value, but realised later that it didn't. I want to change it to not require a return value but I don't know how.

    And just to add, I tried removing any calls to the function but it still doesn't want to let me change it. If I'm forced to change it manually, is there a better way other than line by line copying it?

  • Yep, you're spot on, that was the problem and adding str did fix it. Good to know for the future as I'll be using this string array quite a bit in my project.

  • I think this might actually be a bug in C3. I can run a check if anyone is interested, e.g Ashley?

    Basically, when I did the comparison between a string and the string in the array, it didn't match. But when I put the string in the array into another string and then compared the two strings, they matched. Not sure if I did something wrong somewhere but it does appear that a string in an array isn't the same as a string.... maybe that's as intended?

  • I have two strings which appear identical. One is set up in a local string variable, as '442' and the other comes from an array and is also '442'.

    I've put them side by side on the screen and they both look exactly like that, but for some reason, a C3 match doesn't want to match them (i.e System String1 = String2 isn't triggering).

    I've tried trimming them both (e.g System trim(string1) = trim(string2)) but it's still not triggering.

    Am I missing something else that can make identical looking strings not match up?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a bunch of identical objects that have the drag and drop behaviour and each has a variable attached. When I drop one on top of the other, I want to simply switch the variables.

    It feels like one of those issues that are fairly unique to the way Construct works. When you do 'Object On DragDrop drop' and then 'Object is overlapping Object', you've picked ... I think the 2nd object? I suppose therefore the solution is to save a copy of the first objects UID and the variable, save the 2nd objects variable, put the first variable into the collided object, do a pick-all object, find by UID of the first again, put the 2nd variable into there?

    Or am I being dumb and this is much simpler?