Jump to content

Recommended Posts

Posted

Good day, a little while a go I found some really nice tutorials on getting a Leadwerks C++ project running from scratch. I cannot find them now. The few topics in the docs are kind of all over the place. Where's the set up for windows, creating objects, loading maps, that sort of thing. Some of these things (like loading maps) I have found in the docs but the rest.... a mystery. YT is filled with Lua tutorials and a single C++ playlist from 2008, that thing can't be accurate, can it? 

  • Like 1
  • Haha 1
Posted

It's a bit messy but on the Editor Interface page it mentions you can create a new project in the editor.  Then the Introduction to C++ page says that you need to install Visual Studio 2017 and that when you create a new project, it will include a Visual Studio file you can open.

After that, you can copy and paste examples/snippets from the documentation to learn the API.  Creating objects, loading maps, etc. have examples (though the documentation is lacking in some important areas like GUI).

You can search the forums for anything that might be missing above.  I've been saved by this a few times, even when I had to try to figure things out from Lua code.

And finally, you can always post if you have a question.

There is a bit of a learning curve (as with all engines) but I've found the Leadwerks C++ API to be very easy to understand.

I do understand some people prefer to be guided through the process and I agree that it would go a long way if there was a single, modern Getting Started with Leadwerks Professional video out there.

Posted

Thanks @gamecreator

 

I got that much. All up and running now. I found my own post where I referenced the video tutorial that helped me getting up and running, and no wonder I couldn't find the damn thing, the dickhead removed it.... 

I'm gonna get the C++ tutorial and and running on this myself.

Posted

Aggror wrote a series of c++ tutorials for le 3.1. One of them still works fine on my pc. Not sure where to find them though.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Posted

Now in this setting, I've basically voided the use of App.cpp and just deleted everything in the Mail.cpp file and used Leadwerks from scratch. 

I am curious, what is the purpose of all that pre-existing code in a freshly created main.cpp and App.cpp? Debugging routines or something of the sort? 

Posted

The App stuff came about back when Leadwerks supported mobile.  I always delete them for new projects.

The start code does various things.  I think part of it is interfacing with Lua.  Another is accessing the packaged data/zip file from code (the one created either by publishing a project).  A few other things somewhat documented with comments that go over my head.

I watched only part of your video but it may also be worth mentioning (if you didn't already) that there are some undocumented functions not in the Learn section.  One I use often is world->FindEntity(string) to find entities in a map by name.  Use these at your own peril though as they may be unsupported.

Edit: window->GetActive() is also undocumented but tells you if your window is focused or not.  You can check this if you want to pause the game if the player alt-tabs or stop centering the mouse (used for character controller rotation).

  • Thanks 1
Posted
2 minutes ago, gamecreator said:

The App stuff came about back when Leadwerks supported mobile.  I always delete them for new projects.

The start code does various things.  I think part of it is interfacing with Lua.  Another is accessing the packaged data/zip file from code (the one created either by publishing a project).  A few other things somewhat documented with comments that go over my head.

I watched only part of your video but it may also be worth mentioning (if you didn't already) that there are some undocumented functions not in the Learn section.  One I use often is world->FindEntity(string) to find entities in a map by name.  Use these at your own peril though as they may be unsupported.

That sounds super useful gem. Why in the world is not NOT documented? How much more is there? Do we need to dive into the engine files to find out?

 

EDIT: Ah... "unsupported" eh.

 

If you use them then aren't they supported? Does it only work on a case to case basis or something?

Posted

I believe Josh adds some things for his personal use as he develops the engine but makes it available to us as well on the condition that it's not optimized and may break stuff.  At least, that's my understanding.

Posted
Just now, gamecreator said:

I believe Josh adds some things for his personal use as he develops the engine but makes it available to us as well on the condition that it's not optimized and may break stuff.  At least, that's my understanding.

Ah, I see. Very well then.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...