Jump to content

SpiderPig

Members
  • Posts

    2,411
  • Joined

  • Last visited

Posts posted by SpiderPig

  1. 1 hour ago, wadaltmon said:

    I'm surprised there isn't a simple bool IsColliding (Entity* e1, Entity* e2) or something of that sort in Leadwerks. That seems like something that would be pretty fundamental for a 3D engine.

    You could implement that in the Actor system, but I think why it's not there is because, unless it's a trigger, the collision is over and done with once the objects bounces.  It would only return true for an instant and it could be missed.

  2. 35 minutes ago, TheConceptBoy said:

    Can we use an alternative to VS? Do we have to use VS? 

    VS has a lot of good debugging tools.  Personally, despite some of the things that can go wrong with it, I would use it over the internal editor.

    29 minutes ago, TheConceptBoy said:

    Thank you for the help and patience btw

    Welcome :D

    29 minutes ago, TheConceptBoy said:

    Now that I've gotten a single instance of the zombie class spawned, which, now that I've gotten a hang of it, was pretty damn straight forward.

    Thank you for the help and patience btw

    1) Creating a proverbial horder of zombie instances would require creating an array based on the actor entity class and storing all the zombies in that array?

    How I would go about it is load 100 zombies in an Entity* array.  Then assign each entity a ZombieActor class.  Inside your ZombieActor class you make it control each entity.  E.g. In UpdateWorld() you would check the distance to the player, if the payer is close you make it attack.

  3. I'd say it was VS.  A few years ago I had a similar issue.  I think how I solved it was I just deleted all the white spaces between the functions and the error was solved.  Luckily it wasn't a big class.  Another thing I've noticed with VS, sometimes it will say you have an error but it will compile and run fine.  I think this is the intellisense kicking the bucket - the only way I've found to fix that is to restart VS.

     

  4. Yeah if they are being referenced by any headers/source files in the Source directory, then they have to be there too.  I just moved all my source and header files to the Solution directory so every time I created a new file through VS I didn't have to manually move it to the Source folder.

  5. You can iterate through them but it may just be easier to setup the collisions with the Leadwerks ones;

    const int HELDITEM = 10
    
    Collision::SetResponse(COLLISION_PROP, HELDITEM, Collision::Collide);

    And then just call SetCollsionType() for the heldItem.

    • Like 1
  6. Yeah there's not.  After setting up those collisions, you then have to assign them to which ever entity you want.  E.g.  All the boxes you create;

    SetCollisionType(PROP)

    On the player;

    SetCollisionType(CHARACTER)

    When you right click and pick the object up;

    HeldItem->SetCollisionType(HELDITEM)

    When you right click and release the object;

    HeldItem->SetCollisionType(PROP)

     

  7. Ah they can be any constant.  These are some that come with Leadwerks;

    const int COLLISION_NONE = 0;
    const int COLLISION_PROP = 1;
    const int COLLISION_SCENE = 2;
    const int COLLISION_CHARACTER = 3;
    const int COLLISION_TRIGGER = 4;
    const int COLLISION_DEBRIS = 5;

    I'd create my own;

    const int PROP = 10;
    const int HELDITEM = 11;
    const int CHARACTER = 12;

    I think the max number is 100.  Based on this variable in PhysicsDriver.h;

    int collisionresponse[100][100];

     

  8. If you want to still collide the heldobject with other entities in your scene you may have to set something up like this;

    Collision::SetResponse(PROP, CHARACTER, Collision::Collide);
    Collision::SetResponse(PROP, PROP, Collision::Collide);
    Collision::SetResponse(PROP, HELDITEM, Collision::Collide);
    Collision::SetResponse(HELDITEM, CHARACTER, Collision::None);

     

  9. That looks to be the character controller colliding with the box, your setting the target position of the cube which is forcing its way under the controller.  Try disabling collision between the prop you grab and the character controller.

    Collsion::SetResponse(int type1, int type2, int response)

     

  10. I have had errors like that before, saying I need to insert a semicolon but it has never been the case.  Usually there was a semicolon missed somewhere either in the cpp or header files.

    he only difference I see between my actor code and yours is mine has a private member, and the functions derived from Actor are declared as virtual.

    class BaseActor : public Actor {
    private:
    public:
      BaseActor();
      ~BaseActor();
    
      virtual void UpdateWorld();
    };

    Not sure if it will make a difference though.

     

     

    • virtual void Attach() Single event possible when a script is attached?
    • virtual void Detach() As above but when removed?
    • virtual void UpdateWorld()  Per game loop
    • virtual void UpdatePhysics() Per physics loop
    • virtual void UpdateMatrix() Called when the rotation, translation and scale of an entity is changed (i.e. its matrix).
    • virtual void Collision(Entity* entity, const Vec3& position, const Vec3& normal, float speed) On a collision.
    • virtual void PostRender(Context* context)  Place drawing commands here (DrawImage etc.)
    • virtual void DrawEach(Camera* camera)  Not sure, but could be if the object has been rendered by more than one camera, this may be called for each camera
    • virtual void Draw() I think this is called when the entity is rendered.

     

    • Like 1
×
×
  • Create New...