Jump to content

online battle players vs players connect attack with hurt animations


Kotaros
 Share

Recommended Posts

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

 

 

Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 1 month later...

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:ohmy.png))

{

if (blndanim -1 < 0)

blndanim = blndAnimation::walk;

else

blndanim = static_cast<blndAnimation>(blndanim - 1);

 

blend = 0;

}

 

if (window->KeyHit(Key:tongue.png))

{

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...