dop2000's Forum Posts

  • If your object_1, object_2, object_3 etc. are different objects, then what you are asking is impossible. You can't refer to object by its name in expressions.

    One workaround is to put all objects into a family, define an instance variable "type" on this family, set different type for each object. Then in your events you can pick family member by type and access its value.

    You can create a function "GetObjectValue" that takes type parameter, picks that object from the family and returns object value. Then you will be able to use this function in expressions.

  • CalBro This post is 4 years old. And that advice was wrong anyway, don't use "Wait 3 seconds", use Timer behavior.

    Player On collision with enemy
    Invincible = 0
    	Player subtract 1 from health
    	set Invincible = 1
    	Player Start Timer "invincibility_remove" for 3 seconds
    
    On Timer "invincibility_remove" 
    	Set Invincible = 0
    

    .

    Another common method is to use Flash behavior. When player is hurt, start flashing, this will indicate that the player is temporary invincible. Use inverted "Is flashing" condition to check if the player can be hurt (is not invincible).

  • How about now? (I posted a longer gif, previous one was too short)

  • Try this:

    Set s to variable1 & "?"
    
    Repeat Array.width times
    	Set s to s&"name"&loopindex&"="&URLEnconde(Array.At(loopindex,1))&"&"
    	
    
    AJAX send "" to URL s
    

    Note, that the AJAX Send is outside of the loop. The loop should create a string like this: "......?name0=XXX&name1=YYY&name2=ZZZ&" , with all names from the array.

    And then you send the entire string.

    In the google script you will need to loop through all parameters ("nameN"). See comments in this post:

    construct.net/en/forum/construct-2/how-do-i-18/send-data-google-sheet-138376

  • Is it working? Didn't work the first time I posted, maybe needed to add some text.. Used this tag:

    [giphy=coffee-gif-CkMyyly0PDmI8]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Mobile Enhance - the addon that implements the Enhance SDK for mobile SDK integrations into the Construct 3 Editor with c3runtime. A c3runtime port of the Enhance SDK.

    Wow, this is an awesome addition! Enhance team would probably have never updated their plugin for C3 runtime.

  • You can simply put a Text object next to the checkbox and set any color for it. No need for CSS.

    If you delete text from the checkbox, but stretch its size to cover the Text object, then you will still be able to click on the Text to toggle checkbox.

  • Yes, you should probably disable all controls or at least display a message "Saving, please wait" to the user.

  • So, is saving works fine now?

    You can find out how many objects you need to add for the file size to reach 1Mb, I think a lot. And probably nothing awful will happen, but the file may take a bit longer to save - there will be a delay before "Save as" dialog appears.

  • By the way, the biggest object in your 225KB file is "TempArray". It doesn't need to be saved. You might want to clear it before saving, to decrease file size.

    Add "TempArray Set size to 0" at the start of event 185

    Come to think of it, this is probably the reason why your normal save size is suddenly so big. The more undo steps you add, the bigger TempArray gets.

  • 220KB for 10 objects seems normal. 3MB is definitely not.

    Open the browser log and keep an eye on the save size. You need to try to replicate the problem when the save size suddenly jumps to 3+ MB and then try to save that huge file. (You may need to wait some time for the "Save as" dialog to appear)

    If you manage to replicate it, maybe it will become obvious to you why this happens. If not, then post the saved file, I'll take a look.

  • Undo system uses the same Save action, so the size of saved data should be the same. And yet undo save is 50KB, but moments later normal save is suddenly 3MB? That's 6000% increase!

    There had definitely something else happened between the last undo and you clicking the save button. My guess is that it has something to do with snapshots, drawing canvas etc.

  • It was difficult, but fun!

    I really suggest you replace the text box with spritefont, it will look and work much better, as I told you in another post. Also, since this is supposed to be an old terminal, you shouldn't be able to select text, use copy/paste etc.

  • My guess is that TileMap should be better for performance. But you can actually test this - create a small map with sprites, run the game in Debug Mode and write down the number of collision checks per second. Then replace sprites with TileMap, check again. The less collision checks, the better.

  • Why the save size suddenly goes up from 50KB to over 3MB when you click save? It should be the same size as when saving Undo steps. This is not normal, there must be some other event in your project that's causing this. Maybe you also take a snapshot of the screen and load it into Binary data or something like that. 3MB save is A LOT, and it explains why there is a significant delay in displaying the "Save as" dialog.

    If you can't figure out why this happens, try to analyze the .alon file, see maybe there is a huge block of data that shouldn't be there, or thousands of small ones.. Try this tool for example:

    debugbear.com/json-size-analyzer