nworld has to be the newton world and not a gamestudio entity. that's why it crashes.

just copy my function into the newton lite-c demo source code and call it from somewhere. it doesn't crash. then you can go on from there and try to add tires.