Jump to content
mdgunn

C++ Tutorial Incorrect about Actor Example

Recommended Posts

Quote

By default, a new game will include a sample actor class you can modify called "MyActor". The code for this can be found in the "MyActor.h" and MyActor.cpp" files in the "Source" folder in your game directory.

C++ tutorial says the above but in my new projects I don't see this.  As a tutorial I feel it is important that information presented as a tutorial is correct, otherwise it is a bad experience for a new user.

Although some may argue people doing C++ should know there...stuff, I don't agree.   If you're interested in learning C++ LeadWerks is quite a good place to start (and puts itself forward for educational use).   It's a missed opportunity if there isn't a good sample or reliable and detailed information on how to get a NON-TRIVIAL example going (i..e loading up a map and getting entities out, passing data in etc.).  

I wish the sample project DID go a bit further with it's example as the way it loads up the Lua Interpreter but doesn't pass in any worlds, context, or get any out (if that is even possible - they are created in the Lua example it loads).  What the natural next steps would be are unclear given this starting approach. Well, at least to me  I can see I could rip stuff out and do it a different way (which I did) but the Lua Interpreter loading seems to suggest an intriguing alternative way.

Maybe the sample project should stay as it is with perhaps a few more comments as to what next steps should be, but there should probably also be a more thorough EASILY FOUND sample(s) to show you.  Examples beyond the useful, but sometimes simplified out of realistic context, help system examples, is an area that LeadWerks is still a bit weak in. 

 

Share this post


Link to post

Are you referring to the latest blank template in the project manager?

 I tried that but could not figure where to put my own code. My c++ experience is limited.

Share this post


Link to post

Yes, the C++ starter code in the PROJECTS folder created when you create any new project.  Think they are always the same regardless of the template you choose, though I suppose I could be wrong. 

That the tutorial text doesn't match what the Project folder seems to give you is a poor start for anyone not experienced and venturing down the C++ route.

A few examples beyond just the starter template would be useful, so as I say maybe the correct solution is a few simple examples and maybe the starter content could mostly stay the same.

I found a single sizeable example here in case anyone finds it useful.  

https://github.com/ArchaicMage/Leadwerks-Template/

I've not tried it yet so it may need updating to work properly but the principles it uses still probably apply and worth a look at.

 

Share this post


Link to post

After creating a blank project I remove all the files in the Source folder and replace them with files from pre updated project. This works but I lose any lua connection and the menu.

Share this post


Link to post

Yeah, I can get the actor class working fine. The issue for me isn't that that they don't work. The issue is that the tutorial explicitly says there should be an implementation of the Actor class MyActor (extended from Actor) but there isn't one.

This isn't a code problem bug report but a web site tutorial bug report.  The text on the website should be corrected so it is accurate.

Either it should not say a MyActor class is created or the starter source should contain it.  If it is changed to not mention the MyActor class then I think we sorely need a nice non-trivial example of a C++ project to go with an extended tutorial. Preferably one that retains most of what people get in Lua. E.g. working menus, illustration of how to manage some simple entities and pass data back and forth from lua to c++.

Yeah there is some forum data on this but I think it would be preferable to have a decent official example where a number of points can be brought together into a single place of maintained sample code (rather than potentially eventually non-working or misleading forum post from 2014 or something). 

Anyway the original point was that there is an error in the web site tutorial but I feel there is more to this issue than that.

Share this post


Link to post

It would be really nice to have these ("MyActor.h" and MyActor.cpp") included in the Source directory, as indicated in the tutorial, or at least posted somewhere on the forum. To further C++ progress, people following the C++ tutorials do need to reference them. 

  • Thanks 1

Share this post


Link to post

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.

×
×
  • Create New...