-
Posts
2,411 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Posts posted by SpiderPig
-
-
How does one cheat in a game? If you protect your files and don't provide a console and don't make cheat codes... how can it be done?
-
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
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.
-
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.
-
Yeah you could make an algorithm that gets the size of the object (probably the AABB) and won't let it get too close to the player. You would have to experiment a bit.
-
Obviously the text editors couldn't see it, but the compiler could.
-
-
Ah sorry it's how I name my class as sometimes I want a class that conflicts with Leadwerks classes.
Did it work?
-
I just got mine to compile... see if they work for you
-
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.
-
I don't get it, it doesn't compile for me either. Maybe there is something wrong with those files somehow. Try deleting the files completely then start again.
-
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.
- 1
-
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)
-
Can you upload your .h and .cpp files?
-
Interesting. Does it compile and run at all?
-
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];
-
Yeah I'll post it. I just had a thought, are you calling #pragma once at the top of your header file?
-
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);
-
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)
-
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.
- 1
-
Sorry, Model::Box().
- 1
-
You need to create an entity object first;
Entity* entity = Entity::Box(); entity->SetActor(zombie_001);
-
No I'm not sure about that one. I can't see anything obviously wrong with it. Have you tried moving it back beneath Attach() function after you made the zombie class drive from Actor?
-
Also to use the Actor system your class needs to derive from it;
class zombie : public Actor { ...
- 1
-
Have you defined zombie_001 and entity somewhere? like;
zombie* zombie_001 = nullptr; Entity* entity = nullptr;
- 1
Picking Up Objects
in Programming
Posted
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.