Jump to content

C++ Tutorial Incorrect about Actor Example


mdgunn
 Share

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. 

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

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

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

Link to comment
Share on other sites

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.

  • Upvote 2
Link to comment
Share on other sites

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. 

  • Like 1
  • Thanks 1

SpEcIeS

Link to comment
Share on other sites

  • 2 years later...

Thank you for point these out. I will get to them.

The new docs system will use markdown files in a Github repo so anyone can propose modifications, and it's also easier for me to edit files there.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

The last couple of years have been...not frustrating, I am not sure what the right word is...because I could never go into the full detail I wanted to with LE4, because I knew everything was going to be replaced. What is really exciting to me about the new engine is I can be completely meticulous about everything, because it is a much stronger foundation that will last for a long time. You will see this in the coming months.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

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.
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.

 Share

×
×
  • Create New...