Crash when running msg.url(nil, my_object) (DEF-2036)

Hey!
Ran the code, as shown here: http://doc.defold.com/ref/factory

msg.url(nil, my_object)

It turns out that it crashes (rather than just throwing out a runtime error) the game when it runs.

This seems to work though:

msg.url(nil, my_object, nil)
1 Like

Thanks for the report! This bug has been added to the backlog.

1 Like

@sicher is this bug still present in 1.2.85? I tried to give a script some properties and defold crashed instantly. But when I took out nested gameobjects it worked - but still didn’t display all components of the current collection…


The editor crashed, right? I believe that is a different bug.

yes. I had to force-quit it. tried multiple times to restart the ide, but i even can’t open the script to delete the faulty line, because it instantly crashes again. had to revert to an older commit…

Hello @jack0088 ,

Local files broken too?

Regards,

Technically, the files aren’t broken, defold just cant open my script with the msg.url() statement, without crashing.

I could have edited the file by another editor and have defold it run again. But it’s still a bug…

If you still have the files it would be great if you could post it so we could fix the causing and resulting errors.

1 Like

@Ragnar_Svensson @sicher I wanted to add some properties to my camera script. One of them should be a component selector for the object, that the camera should fallow. Here’s my experimental setup

The component I’d like the camera to fallow is hero.go which is is gameobject file. Right now it’s nested inside the same gameobject as the camera is the child of. This might be not logical, but the bug should appear in this case either…

Inside my camera script I do this camera_controller.script (1.1 KB)
The bug occurred as soon as I added go.property("fallow", msg.url()) to the script, which is what the documentation suggests.

At this point the property isn’t shown but running the game still works … until you want to open the script again. In this case OSX shows the mouse-spinning-wheel and everything hangs up.

Thanks for the report. I’ve managed to find a minimal repro case:

  1. Create a script file with a url property.

  2. Create a game object in a collection. Add the script as a component to the go.

  3. Create another game object in the same collection.

  4. Child the second game object to the first.

  5. Select the first game object. Now the editor hangs.

1 Like

You nailed it!

A workaround for your case is to put camera and camera controller in a separate go and set up the following parent-child hierarchy:

fallower.go
|
|- hero.go
|
|- camera.go
      # camera.camera
      # camera_controller.script

Anyone working at the office who could JIRA this? @Ragnar_Svensson @Mathias_Westerdahl ?

Is there a way to make msg.url() list game objects also?
I’d expect it showing fallower, #camera, #camera_constroller, hero, world…
Because I need the hero.go to be the “object to fallow”…

Like in the manual…

1 Like

It seems like you hit another bug! :slight_smile:

The solution is simple. Make fallower a separate go file (fallower.go) and put that in the collection instead of an in-place game object.

1 Like

:sweat_smile: sorry for finding these easter eggs

No, really, thank your providing quick workarounds! :thumbsup:

2 Likes

No problem! And it’s really good that you find them!

2 Likes

Added as DEF-2036

1 Like

Cool, did you see both issues? One for editor hang and one for game objects not showing up in url property if the game object containing prop-script is in-place.

1 Like

Hmm, no. Not sure what the second issue actually is?

1 Like