Jump to content

Example Scripts

Recommended Posts

Hi Everyone,

Is there any examples scripts out there for Gizmo?
I am wanting to explore the object and particle parts of the API but I think I am making some simple syntax mistakes as whenever I try to load an object, Xplane just crashes when I hit "Reboot Scripts" with the example line modified to point at an object in a folder that's in XP11

local obj_id = gfx.loadObject( "Aircraft/General Aviation/Cirrus Jet/objects/cockpit.obj" )

local exampleobj = gfx.loadObject( "Aircraft/Laminar Research/Aerolite 103/objects/controls.obj" )


Share this post

Link to post
Share on other sites

@BenDLeadbetter first of all, for the particle API, Ben says don't use it. With XP11.30, we are going to get Laminar's particle engine, which you will be able to customize via scripts.

If loading an object crashes X-Plane, then you might have some indications why in Gizmolog.txt or Log.txt. Check those files first (or post them here).

Also please give more info about what you are trying to do. Which aircraft? Yours or the Aerolite? There are differences when trying accessing a file in X-Plane, if you are working on the specific plane, or trying to load an object from somewhere else.

Beyond that, the example might not be right. I think that the below examples should work.

local xpFolder = xp.getFolder() --Get the X-Plane folder

local exampleobj = gfx.loadObject( xpFolder .. "Aircraft/Laminar Research/Aerolite 103/objects/controls.obj")


local exampleobj = gfx.loadObject( xp.getFolder() .. "Aircraft/Laminar Research/Aerolite 103/objects/controls.obj")


Share this post

Link to post
Share on other sites

Hi sorry for the slow reply.

I had a go at your corrected line and had no success. My rather broad goal is to be able to place objects at co-ordinates that can be used for complex missions. I find that feature in gizmo interesting because it would allow all sorts of options such as placing an object at a random location within certain bounds etc

I have used FlyWithLua alot, so I know a small amount. But this is helping me appreciate how limited my current understanding is ;)
Thanks for your help

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.