Jump to content

Questions from a newbie


Server2000
 Share

Recommended Posts

Hi all, 

I'm a new developer that is trying to learn Gizmo and Lua, but I already have a lot of questions.

1) When i would output some logging infos i use the command 

logging.debug( message )

but the debug message goes in the "debug" window and not in the X-Plane Log.txt file, is there a way to log in the main log.txt file?

 

2) When I use the command 

gfx.drawString( string, OPT_x,OPT_y )

inside the function:

function OnDraw_Windows()

it runs correctly, but when I use it inside another function it display nothing, how to use it?

 

3) I saw that there is an AES crypt/decrypt function in the API, can i use it to Crypt my script files? (like init.lua.aes, ecc...)?

 

I'm sorry for these basic questions, but i come from PHP development so for me is a little difficult.

 

Thanks in advance for any help!

Link to comment
Share on other sites

1. No. Logging has been directed into GizmoLog.txt to keep Log.txt clean.

Laminar requested that all plugin authors cut down on the noise in Log.txt

 

2. Graphics functions can only be used inside graphics hooks.

No effort is made to ensure you do this correctly or somehow buffer and queue your.

This keeps the speed up but you do need to be more aware of how things work together.

 

3. The AES function is not useful for securing scripts.

Script Protection is a function of the commercial portion of Gizmo and is available to licensed developers only.

The AES functions you've discovered are there to provide a means to encrypt your own preference or asset data that may be "user writable".

Scripts are packaged for protected distribution using a server-side tool. You submit a zip file containing your scripts folder with plaintext .lua source and you get a zip file back containing .lua.aes files.

The script protection tool is only available for use via the server. This ensures that license agreements are adhered to.

 

Hope that helps.

 

Gizmo was created to be fairly close the to the X-Plane C SDK. I have made some assumptions that people are somewhat familiar with that and the rest of how X-Plane works.

 

Keep asking questions.. :)

 

  • Upvote 1
Link to comment
Share on other sites

3 minutes ago, Ben Russell said:

1. No. Logging has been directed into GizmoLog.txt to keep Log.txt clean.

Laminar requested that all plugin authors cut down on the noise in Log.txt

 

2. Graphics functions can only be used inside graphics hooks.

No effort is made to ensure you do this correctly or somehow buffer and queue your.

This keeps the speed up but you do need to be more aware of how things work together.

 

3. The AES function is not useful for securing scripts.

Script Protection is a function of the commercial portion of Gizmo and is available to licensed developers only.

The AES functions you've discovered are there to provide a means to encrypt your own preference or asset data that may be "user writable".

Scripts are packaged for protected distribution using a server-side tool. You submit a zip file containing your scripts folder with plaintext .lua source and you get a zip file back containing .lua.aes files.

The script protection tool is only available for use via the server. This ensures that license agreements are adhered to.

 

Hope that helps.

 

Gizmo was created to be fairly close the to the X-Plane C SDK. I have made some assumptions that people are somewhat familiar with that and the rest of how X-Plane works.

 

Keep asking questions.. :)

 

Thank you a lot for your answer! 

I have read your useful answer, but I still have a question:

how to display a simple text on a button click (for example) (so not in the standard function)? I think that this is the basic :-)

 

Thanks again!

Link to comment
Share on other sites

Use a global Lua table (array) to store some state flags.

When the button is clicked, set a flag to true.

When the drawing code runs, check the flag, draw as needed.

 

Think of the Lua global with all your state as the Session.

Think of each frame X-Plane draws as a client request.

Manage state between each frame accordingly.

 

 

...Side note; gizmo needs better ability to send objects by reference so we can avoid so many globals and use more anon functions/tables/etc.

  • Upvote 1
Link to comment
Share on other sites

2 minutes ago, Ben Russell said:

Use a global Lua table (array) to store some state flags.

When the button is clicked, set a flag to true.

When the drawing code runs, check the flag, draw as needed.

 

Think of the Lua global with all your state as the Session.

Think of each frame X-Plane draws as a client request.

Manage state between each frame accordingly.

 

 

...Side note; gizmo needs better ability to send objects by reference so we can avoid so many globals and use more anon functions/tables/etc.

This is a great and easy-to-do idea! Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...