Kotaros Posted February 5, 2015 Share Posted February 5, 2015 hi leadwerks support and members i am a noob sorry i testing many situations in leadwerks and blender before i know what i want first 1.i created an animated model with many sequences melee attacks and hurt animations with blender 2. what i want to explain how i write the hurt animations to the in commng attack animations 3 example if i hit the oponnent or the oponent hits me on the head ,or stomatch or legs that i place in that animation for 4.--- example script ...1 headbutt = if this attacks hit player in the near get =2 head hurt nimation 4 jab = if this attacks hit player in the near get =2 head hurt animation 9 roundhouse kick =if this attacks hit player in the near get =2 head hurt animation 10 jump side kick = if this attacks hit player in the near get =2 head hurt animation 3 low kick = if this attacks hit player in the near get =6 leg hurt animation 5 foot sweep = if this attacks hit player in the near get =6 leg hurt animation same with grab judo wrestling throw animations grip the next nearly and throw how it be connected please write me an example script how i can handle it or is there a another option to make that work with a hit line in wich way and line the attack comes in so that make that animation automaticly a video of overgroth an example game i preffer the key attacks more than an random attacks they talking abbout transferring force from watkins to ragdoll based on squared distance from the line if the weapon or attack incentive a specific point , is there 2 ways or more and wich is the best and easyest way to made it work with smallest capacities Quote Link to comment Share on other sites More sharing options...
Kotaros Posted February 5, 2015 Author Share Posted February 5, 2015 http://www.leadwerks.com/werkspace/topic/5879-how-do-you-handle-tasks/ 5) Play hit animation on the target Quote Link to comment Share on other sites More sharing options...
Josh Posted February 12, 2015 Share Posted February 12, 2015 I would add an extra parameter to the Hurt() function and pass in the type of attack. Then you choose which animation to play based on what type of attack it was. Quote 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 More sharing options...
Kotaros Posted February 13, 2015 Author Share Posted February 13, 2015 thank you josh and members,developers for that fast help, know i see is better for me to learn more about c++ and lua by aggrors and roland turtorials ,later i understand the funktions of the scripts better Quote Link to comment Share on other sites More sharing options...
Kotaros Posted March 4, 2015 Author Share Posted March 4, 2015 this is from another forum and a another option if its possible It's pretty simple when you break it down. Do all of your attacks in Montages (Preferably with Root Motion), Have capsules over the fists / legs. When the montage is playing, set a bool that will change the collision of the capsules to something that will collide with the enemy. When the montage is over, set the bool back so it no longer collides. If the fists / legs collide with enemy while active, add damage. If health = 0, then kill the enemy and what not. Quote Link to comment Share on other sites More sharing options...
Kotaros Posted March 14, 2015 Author Share Posted March 14, 2015 hallo community i find this one more and an idea complicated but for wrestling moves maybee usual my english not so good too explain and im a noob in the developement cases first to undestand 3 main lines to follow leadwerks engine ,c++ and blender //for animation for funeral tests ,its mixed and also complex work on 3 things together but i learn slow ,but in my gamecase usually thanks for reply Quote Link to comment Share on other sites More sharing options...
Kotaros Posted April 18, 2015 Author Share Posted April 18, 2015 here is a funny mdl with mocap bvh to see the function of all and its works fine i must working on it fix the directions impossible make self animations better i use the barbarian mat texture its funny but works ..2nd blnd.mdl by blender i make my own animatins but sometimes see not good like the last sequence on the model but for all good to see how its works you can load any animations inside the model and set it for an coding in c++ ,my eqperience is low but maybee soon we will see if i can take it on 2nd blnd.mdl thx for support #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } Model*blnd; Vec3 camRot; Pivot*camPivot; float timer; enum blndAnimation { walk = 0, run = 1, slowboxc = 2, kickbasupi = 3, frun = 4, sprungknie = 5, kickc3 = 6 }; blndAnimation blndanim = blndAnimation::run; float blend; //Timers float startTime; float frameTime; bool playAnimation; bool App::Start() { //Initialize Steamworks (optional) /*if (!Steamworks::Initialize()) { System::Print("Error: Failed to initialize Steam."); return false; }*/ //Create a window window = Window::Create("_mas_", 100, 100, 1024, 768); //Create a context context = Context::Create(window); //Create a world world = World::Create(); Light * light = DirectionalLight::Create(); light -> SetRotation(45, 45, 0); //Create a camera camera = Camera::Create(); camera->Move(0,2,-5); camPivot = Pivot::Create(); window->HideMouse(); //load a model blnd = Model::Load("Models/2nd blnd.mdl"); blnd->SetRotation(0,45,0); camRot = (0,0,-4); blnd->SetPosition(1, 3, 4); timer = 0; blend = 0; //play once variables startTime = 0; frameTime = 0; playAnimation = false; return true; } bool App::Loop() { //close the window to end of program if (window->Closed()||window->KeyHit(Key::Escape)) return false; //mouse controls if (window->MouseDown(1)) { camRot.y += (window->MouseX() - (window->GetWidth() / 2)) *Time::GetSpeed()*0.2; camRot.x += (window->MouseY() - (window->GetWidth() / 2)) *Time::GetSpeed()*0.2; } if (window->MouseDown(2)) camRot.z += (window->MouseY() - (window->GetHeight() / 2)) *Time::GetSpeed()*0.1; //Position camera at model Vec3 pos = blnd->GetPosition(); camera->SetPosition(pos.x, pos.y + 1, pos.z); camera->SetRotation(camRot.x, camRot.y, 0); camera->Move(0, 0, camRot.z); window->SetMousePosition(window->GetWidth() / 2, window->GetHeight()/ 2); //keyhits if (window->KeyHit(Key:)) { if (blndanim -1 < 0) blndanim = blndAnimation::walk; else blndanim = static_cast<blndAnimation>(blndanim - 1); blend = 0; } if (window->KeyHit(Key:)) { if (blndanim +1 > 40) blndanim = blndAnimation::run; else blndanim = static_cast<blndAnimation>(blndanim + 1); blend = 0; } timer = Time::GetCurrent() / 100; blend += 0.01*Time::GetSpeed(); if (blend > 1) blend = 1; float move = window->KeyDown(Key::K); float attacking = window->KeyDown(Key::L); if (move == 1 && attacking == 1) { //running and attacking blnd->SetAnimationFrame(timer, blend, blndAnimation::walk, true); Entity*hip = blnd->FindChild("hip"); hip->SetAnimationFrame(timer, blend, blndAnimation::kickc3, true); } else if (move == 1) { //just run blnd->SetAnimationFrame(timer, blend, blndAnimation::walk, true); } else if (attacking == 1) { //just attack blnd->SetAnimationFrame(timer, blend, blndAnimation::kickc3, true); } blnd->SetAnimationFrame(timer, blend, blndanim, true); Leadwerks::Time::Update(); world->Update(); world->Render(); context->Sync(false); return true; } -------------------------------------------------------------------------------------------------------------------------------------------- #pragma once #include "Leadwerks.h" using namespace Leadwerks; class App { public: Leadwerks::Window* window; Context* context; World* world; Camera* camera; App(); virtual ~App(); virtual bool Start(); virtual bool Loop(); }; -------------------------------------------------------------------------------------------------------------------------------------------------- #ifndef OS_IOS #ifndef _DLL #ifndef BUILD_STATICLIB #include "App.h" #endif #endif using namespace Leadwerks; void DebugErrorHook(char* c) { Leadwerks::System::Print©; //========================================================================================= //========================================================================================= exit(1);//<--------------------------- Add a breakpoint here to catch errors //========================================================================================= //========================================================================================= } #ifdef __APPLE__ int main_(int argc,const char *argv[]) { #else int main(int argc,const char *argv[]) { #endif //Load saved settings std::string settingsfile = std::string(argv[0]); settingsfile = FileSystem::StripAll(settingsfile); if (String::Right(settingsfile, 6) == ".debug") settingsfile = String::Left(settingsfile, settingsfile.length() - 6); std::string settingsdir = FileSystem::GetAppDataPath(); #ifdef __linux__ #ifndef __ANDROID__ settingsdir = settingsdir + "/." + String::Lower(settingsfile); #else settingsdir = settingsdir + "/" + settingsfile; #endif #else settingsdir = settingsdir + "/" + settingsfile; #endif if (FileSystem::GetFileType(settingsdir) == 0) FileSystem::CreateDir(settingsdir); settingsfile = settingsdir + "/" + settingsfile + ".cfg"; System::LoadSettings(settingsfile); //Load command-line parameters System::ParseCommandLine(argc, argv); //Add debug hook for catching errors Leadwerks::System::AddHook(System::DebugErrorHook,(void*)DebugErrorHook); //Load any zip files in main directory Leadwerks::Directory* dir = Leadwerks::FileSystem::LoadDir("."); if (dir) { for (int i=0; i<dir->files.size(); i++) { std::string file = dir->files; if (Leadwerks::String::Lower(Leadwerks::FileSystem::ExtractExt(file))=="zip") { Leadwerks::Package::Load(file); } } delete dir; } #ifdef DEBUG std::string debuggerhostname = System::GetProperty("debuggerhostname"); if (debuggerhostname!="") { //Connect to the debugger int debuggerport = String::Int(System::GetProperty("debuggerport")); if (!Interpreter::Connect(debuggerhostname,debuggerport)) { Print("Error: Failed to connect to debugger with hostname \""+debuggerhostname+"\" and port "+String(debuggerport)+"."); return false; } Print("Successfully connected to debugger."); std::string breakpointsfile = System::GetProperty("breakpointsfile"); if (breakpointsfile!="") { if (!Interpreter::LoadBreakpoints(breakpointsfile)) { Print("Error: Failed to load breakpoints file \""+breakpointsfile+"\"."); } } } else { // Print("No debugger hostname supplied in command line."); } #endif App* app = new App; if (app->Start()) { while (app->Loop()) {} #ifdef DEBUG Interpreter::Disconnect(); #endif //Save settings delete app; System::SaveSettings(settingsfile); System::Shutdown(); return 0; } else { #ifdef DEBUG Interpreter::Disconnect(); #endif return 1; } } #endif i use blnd2 is better import a model without numbers because the vs find blnd not blnd2 Select a media type to choose what to share.here 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.