Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. Yeah, that's cool. I'll post it when I'm done.
  2. That might be possible. You would have to make it jump also. The down side to that is you have to manage that over multiple frames. If it worked like other forces we can just make 1 function call to apply the force and be done with it. Having to do it over multiple frames could make the code more cumbersome to work with. Let's say I want to do this knock back to a controller. I would need to set the controllers rotation to the direction I want it to go, then supply a jump value to get it in the air and a move value to start it moving. Then I have to change the move value being passed to UpdateController() at some given point in time. Or we could just use ApplyForce() on the controller and not have to worry about it anymore. I just think this would be easier. What I did to get around this was to create a cone body and apply my force to that, then just set the controllers position to the cones position until the velocity of the cone was all 0's. The downside to that is that the controller doesn't register collisions when PositionEntity() is used on it, but in my example it doesn't matter as it's following the collisions of the cone, and it doesn't need to worry about bullets or anything while it's in the air. I think your way would work also, but managing the move value or multiple frames might prove tricky depending on your code setup.
  3. Yeah, I think I'll just turn your name tag code into a class and use that. All the code is there already and I'll just use that. Thanks Lum!
  4. I was looking at that. Could I used Coronas for that instead of the plane you create? I don't know if something special needs to be in the mat for Coronas to work but I tried the below and I don't see it. TEntity cor = CreateCorona(); SetCoronaRadius(cor, 10, 20); PaintEntity(cor, LoadMaterial("abstract::RedIndicator.mat")); PositionEntity(cor, Vec3(0, 4, 0));
  5. So I want to have rising numbers that represent damage or healing above the heads of the units. Currently I use DrawText() with CameraUnproject(), but that doesn't work because I only do the CameraUnproject() once time so when I move the camera the text isn't draw correctly above the unit. Is there a way to do this where the text would be in 3D? I would assume http://www.leadwerks.com/wiki/index.php?title=Coronas but how do I put my numbers on this?
  6. Rick

    Warlords

    This will be my dev blog for Warlords. It's coming along very nicely and I'm very proud of what I have so far. This is a game that has been in my head for a long time. I've made past attempts to make this game but they all failed because when I would find a "bug" in Leadwerks that would set me back I would just stop. This time I'm determined to complete this game. Players don't care about if you had to hack something together and now either will I. If Leadwerks has a bug or doesn't do something and there is a way to hack around it I will use that. I can't let these little things stop my dream of completing this game. I think this game will bring many hours of enjoyment to many people and I want to be able to give them that. So about the development. The first ability is up and working. The Protector class has a Shield Slam ability that knocks back their target. I'm very excited about it because it works really nice. It'll play into the Protectors role of, well, protecting their teammates. Here is a brief description of each class in the game. Protector : Protectors use their one-handed sword and shield to help protect their teammates. They have a ton of hit points and a ton of armor but don't do much damage. The Protector lives for the front line. They have abilities that will transfer damage to them when done to their teammates, to force the enemy to attack it, & to give their teammates a chance to retreat for help. Cleric : Clerics are healers and buffers. They have the ability to heal their teammates directly or over turns. They are pretty squishy though. It doesn't take many hits to bring the Cleric to it's knees. Because of this they also have buffs that they can put on themselves or their teammates to help ease the damage. Clerics generally like to sit in the back away from danger and heal their teammates. They also have the ability to bring fallen enemies back to life, although at a great cost to themselves. Archer : Archers sit in the back also. They like to pick away at people from a distance. They don't have much armor, but can do a ton of damage. If you get close to an archer though, they don't have many defenses to protect themselves. Assassin : Assassin are sneaky and sly. They have the ability to go into the shadows and become invisible. They can strike at any time and when they do strike it's with great power. Once exposed the assassin has very little defenses which make it an easy target. Wizard : Wizards are great magicians that strike down the enemy with magic power from a distance. They also have powerful debuffs at their disposal to weaken the enemy over turns. Like Clerics, Wizards are very squishy, so it doesn't take much to bring one down. With these 5 classes and all their abilities the battle is on. Knowing your abilities and when to use them is huge in this tactical battle of Warlords!
  7. Is there any sort of parent to the controller? I guess I'd need to see the code to know why. I'm using PositionEntity() myself on the controller and it works.
  8. Let me know if you can get that For now I'm making ways to only update them when needed, which for my game will only be 1 at a time.
  9. I have 10 of these planes and if I update them all each cycle I get a drop of 72 frames! I assume it should be faster than that.
  10. Everything I have read and tested we can't apply forces on controllers since version 2.20. I need to do knock backs on controllers. Currently I'm hacking around this by applying the force to a body box and then using PositionEntity() on the controller to the body box position (tried a fixed joint between them, but that didn't work either). This method I'm using is kind of hacky and not ideal.
  11. Rick

    force on a body

    Can't do it every frame since that would stop physics, but I was able to do it before applying the force and that works. I just have a feeling this is going to be buggy.
  12. Rick

    force on a body

    OK, so it seems we can't apply forces on the controller. So I'm working on a work around. This works, BUT the body box rotates in the air which messes its orientation up so multiple force applying doesn't always produce the same result. It would be ideal if it didn't spin. Any ideas? // ==================================================================== // This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard // Written by Rimfrost Software // http://www.rimfrost.com // ==================================================================== #include "engine.h" int main( int argn, char* argv[] ) { Initialize() ; RegisterAbstractPath("C:/Leadwerks Engine SDK"); SetAppTitle( "Test02" ) ; Graphics( 800, 600 ) ; AFilter() ; TFilter() ; TWorld world; TBuffer gbuffer; TCamera camera; TMesh mesh; TLight light; TMesh ground; TMaterial material; world = CreateWorld() ; if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); return Terminate(); } gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); camera=CreateCamera(); PositionEntity(camera,Vec3(0, 5, -9)); RotateEntity(camera, Vec3(45, 0, 0)); material=LoadMaterial("abstract::cobblestones.mat"); //mesh=CreateCube(); //TBody meshBody = CreateBodyBox(); //EntityParent(mesh, meshBody); //PositionEntity(meshBody, Vec3(2, 1, 0)); //PaintEntity(mesh,material); //EntityType(meshBody, 2); //SetBodyMass(meshBody, 1); TController controller = CreateController(); EntityType(controller, 3); SetBodyMass(controller, 1); //CreateJointFixed(meshBody, controller); ground=CreateCube(); ScaleEntity(ground,Vec3(10,1,10)); TBody groundBody = CreateBodyBox(10, 1, 10); EntityParent(ground, groundBody); PositionEntity(groundBody,Vec3(0,-2,0)); EntityType(groundBody, 1); PaintEntity(ground,material); Collisions(1, 2, 1); Collisions(1, 3, 1); light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); DebugPhysics(1); TBody meshBody = CreateBodyBox(); RotateEntity(meshBody, Vec3(0, 45, 0)); EntityType(meshBody, 2); SetBodyMass(meshBody, 1); // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { // Rotate cube if(KeyHit(KEY_SPACE)) { PositionEntity(meshBody, EntityPosition(controller, 1), 1); AddBodyForce(meshBody, Vec3(0, 250, 250), 0); } // This is how we tell if we should be following the body box TVec3 vel = GetBodyVelocity(meshBody); if(vel.X != 0 || vel.Y != 0 || vel.Z != 0) { TVec3 pos = EntityPosition(meshBody, 1); pos.Y -= .5; PositionEntity(controller, pos, 1); } else { UpdateController(controller); } /*if(meshBody != 0) { TVec3 vel = GetBodyVelocity(meshBody); DrawText(10, 10, "Body Velocity %d, %d, %d", vel.X, vel.Y, vel.Z);*/ /*if(ControllerAirborne(meshBody)) { TVec3 pos = EntityPosition(meshBody, 1); pos.Y -= .5; PositionEntity(controller, pos, 1); }*/ //} // Would only need to do this for the ability. Could stop once the body box is at rest //TVec3 pos = EntityPosition(meshBody, 1); //pos.Y -= .5; //PositionEntity(controller, pos, 1); //else // UpdateController(controller); // Update timing and world UpdateAppTime(); UpdateWorld(AppSpeed()) ; // Render SetBuffer(gbuffer); RenderWorld(); SetBuffer(BackBuffer()); RenderLights(gbuffer); vel = GetBodyVelocity(meshBody); DrawText(10, 10, "Body Velocity %d, %d, %d", vel.X, vel.Y, vel.Z); if(ControllerAirborne(controller) && (vel.X != 0 || vel.Y != 0 || vel.Z != 0)) { DrawText(10, 50, "I am in the air"); } // Send to screen Flip(0) ; } } // Done return Terminate() ; }
  13. How does the force Vec3 work for the force methods? I'm trying to visualize how this would work. Let's say we have a human standing and we wanted to make that human fly upwards and back would the Vec3 be below it's midsection? But wouldn't it need an angle also? Like at it's midsection and pointing slight up so the human would fly back and up? Imagine the human is the character controller. I want to make the controller fly up and "back".
  14. As you said you can control when it gets created so it's not the same. I find this needed when using LE because if your class has any sort of LE commands you want to make sure LE is initialized before you can do anything in the constructor of your global class. I actually agree that the syntax is kind of crappy but it's a small price to pay for the benefits it gives. Would be better if you could override the dot operator to return the static instance. Would look better and the compiler should be able to know the difference between a class name and a class instance, but I don't think you can override the dot operator. But yeah, I notice this must be a bug.
  15. Use a singleton to replace a global object variable. This creates itself and destroys itself automatically and only the one method is static. class MyClass { private: MyClass(void){} public: static MyClass& Instance() { static MyClass myClass; return myClass; } void RunMe(){} }; MyClass::Instance().RunMe();
  16. Does the character require a controller when in the car? I wouldn't think it would, so I would just hide the controller (if that's possible) when the character gets in and unhide it when it gets out. Generally when your character gets into a vehicle the vehicle now becomes the controller.
  17. The overlay and zsort are set to 1 in the mat but how would I flip the depth buffer?
  18. I seem to get "z fighting" when the camera is at a certain distance away from the plane. Any thoughts?
  19. Why am I calling you Max btw lol. Master. Master. Master.
  20. Chedder! Thanks Max. Will fix when I get home. You are just full of help today!
  21. Or an accurate TerrainElevation() like what Max has created also in that same post!
  22. Ah ok. So this is the drop down list when you first create a terrain in the editor. Cool! I'm excited to get this to work. If only I can figure out why UpdateMesh is bombing now.
  23. Very nice. That's actually acceptable in my eyes (as in the game I'm working on) as you would only have to do it when it moves, although I'll use Max's version since it'll be faster. Thanks Masterxilo, Josh should know about this I would think. Also what is meant by terrain resolution?
  24. I'd be interested to see the y value difference returned from a raycast colliding with the terrain vs TerrainElevation for a given vertex on your decal. Can you try that whisper? You should be able to do that in that same loop you have. After you load your gmf position it below the terrain and raycast up to the terrain and see what the collision y value is.
×
×
  • Create New...