tipforeveryone Posted May 23, 2019 Share Posted May 23, 2019 I stuck at document tutorial. Quote Link to comment Share on other sites More sharing options...
reepblue Posted May 23, 2019 Share Posted May 23, 2019 I can give you one when I get home. What's the issue you are having? 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Solution GorzenDev Posted May 23, 2019 Solution Share Posted May 23, 2019 The BaseActor class i use to derive actors from. Use it just like you would use a entity script. Attach actor to a entity. baseActor = new BaseActor(); entity->SetActor(baseActor); BaseActor.h #include "Leadwerks.h" using namespace Leadwerks; const enum class ActorType : char { Base, Player, NPC}; class BaseActor : public Actor { //Built-in extendable functions // //virtual void EndAnimation(const int sequence); virtual void Sleep(); //virtual void Wake(); virtual void Attach(); //virtual void Detach(); //virtual void Collision(Entity* entity, const Vec3& position, const Vec3& normal, float speed); virtual void UpdateWorld(); virtual void UpdatePhysics(); //virtual void UpdateMatrix(); virtual void PostRender(Context* context); //virtual void Draw(); //virtual void DrawEach(Camera* camera); //virtual void ReceiveSignal(const std::string& inputname, Entity* sender); public: ActorType actorType = ActorType::Base; BaseActor(); virtual ~BaseActor(); }; BaseActor.cpp #include "BaseActor.h" BaseActor::BaseActor() { } BaseActor::~BaseActor() { } void BaseActor::Attach() { // //System::Print("BaseActor Attached."); } void BaseActor::Sleep() { // //System::Print("BaseActor Sleep."); } void BaseActor::UpdateWorld() { //System::Print("BaseActor UpdateWorld."); } void BaseActor::UpdatePhysics() { //System::Print("BaseActor UpdatePhysics."); } void BaseActor::PostRender(Context* context) { // } 1 Quote Link to comment Share on other sites More sharing options...
tipforeveryone Posted May 23, 2019 Author Share Posted May 23, 2019 1 hour ago, reepblue said: I can give you one when I get home. What's the issue you are having? I return to leadwerks cpp learning process and I did not find any example file like in tutorial, so that I can't learn from it https://www.leadwerks.com/learn?page=Tutorials_CPP_Actors This should be fixed. or the example code should be put into this tutorial page, maybe Josh is too busy to fix this Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.