Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Yeah those parameters need some work. What do you think looks better? Your post or the thing below? SetRotation($number_pitch, $number_yaw, $number_roll, $bool_global=false) SetRotation($vec3_rotation, $bool_global=false) On one hand I don't want to lose the type, but on the other hand it looks uglier. Both are just easily made so its just a matter of picking a style.
  2. I love your solution of creating the arc by calculating in gravity. Very creative.
  3. I added a massive amount of generated snippets based on the Leadwerks API. Video and more details here:
  4. Thanks for the reply klepto. Interesting to know it inherits. It makes sense for methods like SetRange, but there are also many camera specific methods that have nothing to do with lights like Zoom and SetSkybox. Are there inherited by the Light and probe? I currently process the entire toc.xml because I need more than just the classes. For instance I want to display available subclasses and methods.
  5. Generating the lua snippets brings up several issues with the toc. The lights and probe API are placed inside the camera.
  6. Maybe at a later stage perhaps. For now I will use https://www.leadwerks.com/documentation/toc.xml to retrieve the latest xml and generate the snippets.
  7. What was your opinion on the api docs being hosted on Github? I think it would make changes to the API as well as the generated snippets a lot more maintainable and complete.
  8. Extending the intellisense of vs code so that Leadwerks specific objects are recognised would be preferable. However generating snippets based on the Le API is an alternative/backup solution. It is part of the experiment to see what works best.
  9. I think he is asking if proffesional edition comes with source code access.
  10. Update with that. If you have more ideas feel free to list them here.
  11. Thats awesome to hear Josh. I am certain there are people who have made these debugger before. I am going to focus on getting the docs in to the extension now. Source code can be found in github: https://github.com/Aggror/VisualStudioCodeLeadwerksExtension Package updated with some new snippets.
  12. So is this something I can help out with Josh? Snippets aren't a problem and generating them from the xml files is something that I can look in to. If you your focus on the debugger, I can help you out with the documentation stuff.
  13. You could generate it and store it inside the extension and additionally let the extension look for the online version every time you start VS code. That way you have an offline version of the API at your disposal and when you go online, you get the latest documentation.
  14. I knew you would fall in love with it eventually.
  15. Okay josh. Go to extensions and search Leadwerks. Or here: https://marketplace.visualstudio.com/items?itemName=aggror.Leadwerks Then just type in propstring or collision, followed by a tab. With the snippets you can easily identify tabbing positions which makes adding properties really easy.
  16. I will post my extension for vs code this evening.
  17. Looks like VS code is build on top of Atom. Looking at their repo https://atom.io/ it looks pretty customisable too.
  18. I think we need a separate forum to keep track of this. I have completely hijacked the original topic (PLUGINS ftw).
  19. Here is visual studio code with .nut files. (great extension name). A downside is the documentation part. Squirrel is not very well known it seems, despite being used in several big games.
  20. Never heard of it but it looks pretty good at first glance. The constructutor, classes and inheritance support by default are a big plus. https://en.wikipedia.org/wiki/Squirrel_(programming_language)
  21. That actually doesn't sound bad. For the Leadwerks API that could result in something like this. People can use this for their own functions too, but it is not mandatory. --pos, A vector 3 position --global, boolean that detemines global=true or local=false SetPosition(pos, global) This gives me bad memories to an internship were every variable was prefixed with the datatype: (integer) i_myVar, (string)s_myVar. I personally find this really ugly. That is how I did it in my post. Funny to see you would do something similar.
  22. Making a template would only be the first step. It is the fastest and easiest step. Writing the tutorials and making screenshots along the way (and hoping you don't miss anything) is far more crucial. The ultimate way would be to do it like with Project Saturn: every other tutorial part would have all scripts in a different folder: http://aggror.com/downloads/projects/saturn/saturn_source_code.rar. In the end you would end up with the following project Tower defense example FINAL: For those who just want to look at the completed project START: For those starting our the tutorial PART1: For those who have completed tutorial part 1. PART2: etc PART3 PART4 That way you can start from scratch, follow part 1 of a tutorial and if your code is somehow wrong, check the accompanied scripts that were made specifically for that part. Building the documentation this way is also the most time consuming process. But luckily with frequent and proper source code commits this can be done relatively easy. You could even make a branch for every tutorial part that is completed.
  23. These are things that I haven't tried yet. I will have to play around with this before I can give an accurate answer. Like I said, it is not as powerful as with strong typed languages like C#/C++. But maybe something like showing a list of all Leadwerks functions is possible once you have type something like "myVariable:". The 'intellisense' you saw in the screenshot above only roughly displays some of the functions it can find on the page and perhaps some other methods. Either way a custom intellisense extension could work/help, but will not be as sophisticated as C#/C++. Perhaps when the colon is typed, the variable used in this case, could be lookup in the current page and see where it is first declared. The intellisense could see that 'Model:load' is used and 'assumes' it is a model, display Leadwerks model functions first. I don't know, just thinking out loud here. local someVariable = Model:Load() someVariable: There is enough stuff out here to spend a lot of time on. Will make a video/blog if I have something worthwhile.
  24. I have been using Visual Studio Code for a couple of years now and it is my defacto text editor next to Notepadd++. I mainly use it however to write Lua scripts. Opensource Lightweight Cross platform Completely adjustable hotkeys (or automatically map from Visual Studio: https://marketplace.visualstudio.com/items?itemName=ms-vscode.vs-keybindings) Fully customisable theming (with standard themes included) Supports all major languages. Lua is supported via an extension: https://marketplace.visualstudio.com/items?itemName=trixnz.vscode-lua Build in GIT source control Has a huge amount of extensions: https://code.visualstudio.com/docs/editor/extension-gallery Supports creating custom extensions: https://code.visualstudio.com/docs/extensions/overview Supports creating custom debuggers (on top of the ones that already exist). Leadwerks extension Personally I would love to see it if Visual Studio Code would be the default code editor for Leadwerks (either with 4.x or 5.x). So I got started on working on a custom Leadwerks extension. You can download it here: https://marketplace.visualstudio.com/items?itemName=aggror.Leadwerks Todo list: Done: Leadwerks extension has a dependency on the Lua extension. So this Lua extension is automatically installed when you install the Leadwerks extension. Done: Snippets. Every time you create a new script in the Leadwerks editor, you get a couple of default scripts like Function Script:Start(), UpdateWorld(), PostRender(context). Using a very simple snippet, these kind of functions can be inserted with ease. prop[type] : Creates Leadwerk editor properties print: Shortcut for System:Print("") lescripts: Inserts all entity script functions (commented) class: Creates a basic class objects with example functions start: Start function of an entity script updateworld: UpdateWorld function of an entity script updatephysics: UpdatesPhysics function of an entity script collision: Collision function of an entity script with all parameters PostRender: PostRender function of an entity script with the context parameter function: Creates a function for either a custom object or for the specific script if for pair ipar For instance: just type 'col' followed by 1 tab and you get: function Script:Collision(entity0,entity1,position,normal,speed) end Partially done: Supporting intellisense (sort of) with Leadwerks entities. Lua is a typeless language (not a strong typed language), which makes intellisense not really possible. VS code is smart enough to recognise some functions that are available in your script, but it is not as complete as when you would work with C# or C++. Done: Generate snippets for the entire Leadwerks API. Snippets are created per object and a second one without the object. For instance Entity:SetPosition() SetPosition() TODO: Classes with parents, would require matching functions. For instance: a pivot is an entity and thus requires Pivot:SetPosition() Done: parameters into placeholder slots. If I can extend the intellisense so that it recognises Leadwerks entities, perhaps we could see correct variables and functions of those entities. TODO: Loading in the API documentation in a split screen. The API documentation is written in an XML format which I can retrieve in VS code. I can display it in a splitscreen. I would have to play with the styling a bit but in general this should work really fast API documentation can be cached if in online mode. Documentation could also be periodically fetched. Moving the API documentation to Github would help improve this process. (newer file versions etc) Debugging Josh stated that he is getting someone to make this for him. So fingers crossed. The biggest issue at the moment is the lack of debugging support. Visual studio has debugging options of course, but it can't communicate with the Leadwerks editor. If you have an error in your script while running from the editor, the default Lua editor is opened.
  25. I will do some experimenting with this.
×
×
  • Create New...