Corona simulator does not update with code changes

I started a project using SSK2 and I am noticing that my code changes are not reflected in the simulator. For example, I tried changing the amount of bullets and angle of spread in my bullets, but they do not change. Could this problem be because of SSK2 or just a bug in the Corona Simulator?

I am running v2016.2949 and I am using an El Capitan Mac V 10.11.5. 

There is an option in the Preferences panel. At the bottom is an option Relaunch Simulator.  Make sure you’re set to “Always” to get auto reloading.

Rob

Did you copy the SSK2 folder directly to your app or are you symbolically linking to it?

Both work for me on Windows 10, but there may be an issue with symbolic links and auto-reloading under OS X.

In any case, I use SSK2 w/ auto-reloading all day every day so I know that is not going to cause you any issues.

PS - You listed two options:

  1. SSK2 issue

  2. Corona Bug

, but you neglected to list a third possibility:

  1. User error.

You’re assuming the problem is with us, when in all likelihood it is a usage problem. :slight_smile:

I copied the folder directly to my app. As for user error, could you elaborate more on that, I am a bit confused.

Also, I tried deleting and re-installing Corona Simulator and it still does not update.

I’m saying:

  1. You may have made a mistake(s).

  2. You may have made assumption(s).

  3. You may have an incorrect understanding(s) of some feature you’re trying to use.

None of these are insults.  We all fall prey to the same issues.

In fact, I can confidently say that about 50% or more of the posts I see in the forums about ‘errors’, actually have their root in the above causes.

This is why it is always best (when you are stuck) to get a second set of eyes on the problem.

I always suggest one or both of the following ways to get help:

  1. Post a succinct snippet of the problem code (less useful in this case)

  2. Post a zip file link to your project for others to try/test.

_ Note: If you are going to use option 2, and your project uses SSK2, do not include SSK2 in the zip. _

Note: If you’re testing to see if ‘auto-relaunch’ is working, do the following:

  1. Create a main.lua file (on your desktop) containing this code:

    local a = 10 local b = 20 print( “Bob”, a, b, b-a)

  2. Save the file and open it with Corona.

  3. Verify you have the Corona Preferences --> Relaunch --> Always turned on.  (Not sure of exact steps to set this on OS X, I use Windows version of simulator; However you can find it.  Poke around.)

  4. Verify that this message prints in the console:

Bob 10 20 10

  1. Now, without closing the simulator, modify the code to read:

    local a = 10 local b = 0 print( “Bob”, a, b, b-a)

  2. Save the file.

7 Verify that the console now shows:

Bob 10 0 -10

Done!  This should work and show that auto-relaunch works fine.

The auto-relaunch is fine, but it does not seem to be working for one specific project. 

EDIT: Actual Video this time: 

https://www.youtube.com/watch?v=CVNB-nw4upo

  1. That is not a link to a video.  It goes to a comments page.

  2.  Again, link to your code (minus SSK2).  Seeing it in a video ONLY won’t really help.

-Ed

PS - I’m quite sure the auto-relaunch is universally fine. I use it all the time w/o issue.

I’m sure you’ve actually got a problem with your project, thus my interest in simply running it.

Note: I’m going offline very soon, so if you can’t post that link in the next 10 minutes or so… I’m afraid this question will have to wait.

Here is the code to my project (minus SSK2):

Also, I have double checked to make sure Corona ALWAYS relaunches with code changes.

  1. I see you have a file called menu.lua.

– This file is not used or loaded.

– This file in turn is responsible for loading ‘level1.lua’, but since you don’t load the menu, the level1.lua file is never loaded, thus any changes you make will never have any effect.

Error: Assumption that you’re even loading the scene.

Error: Incorrect usage of composer

  1. I see you are loading SSK and initializing it multiple times.  This is wrong.

Error: Incorrect usage of SSK

Do this once and only once in main.lua.

Note: I sense you are starting with composer a bit early in the game development.  I would suggest you focus on learning to make a game module that can load and destroy levels first.  Then, drop that into a composer framework.

By using composer before you’re solid on modules and game logic you are really complicating things for yourself.  

This is my opinion, and others may disagree, but to me, more moving parts equal more things to go wrong.

I’m still poking at your code and if I can get it to load I’ll post a correction…  no guarantees though.

More errors:

composer.gotoScene( "level1", "fade", 500 )

should be:

composer.gotoScene( "level1", { effect = "fade", time = 500 } )

Hmm… level1.lua is not a scene file, so no matter what you do, that simply won’t work.  It needs to be a scene file before you can load it via composer.gotoScene().

The code that is running in this code is in main.lua

If you change the settings in main.lua that code will update.

As noted above,  your scene structure is wrong and not being used.

I won’t be posting a fix because I would have to re-write a significant portion of your code and at the end of those changes my code probably wouldn’t be what you want.

My suggestions are as follows:

  1. Start the project over.

  2. Do not start using composer.  (lots of users jump into this early because it is sexy and gives you the feeling of a ‘working game’, but again and again I see folks stumble and fall when they get confused by concepts.)

  3. Write a ‘game.lua’ module that loads a level, runs it, and destroys it when done.

  4. Consider collaborating with someone or getting help from someone for free or $.

I fully understand the want to run run run, but you’ve got to walk first.  Also, iteration is the key.   Don’t be disappointed if you try and fail.  Simple try again (thus #1 above).

I know this isn’t the answer you were probably hoping for, but I’ve got to get working on a paid gig and I’m out of time for now.

Cheers,

Ed

I am such a fool, I just realized I had been editing the wrong file. Sorry for all the trouble, and thank you for your help.

Not a fool.  This is exactly what I mean by being too close to the problem and benefiting from another set of eyes.  We all make mistakes based on basic assumptions.  In this case you simply assumed you were editing the file that was being run when you weren’t.

Cheers,

ed

There is an option in the Preferences panel. At the bottom is an option Relaunch Simulator.  Make sure you’re set to “Always” to get auto reloading.

Rob