lxFirebal69xl Posted March 17, 2015 Share Posted March 17, 2015 So, today I finally got an animated model in leadwerks. It looks good and the animations play without a problem. So I thought, "I'll just put the MonsterAI.lua script on him and see what happens". Well what happens is that he does the Idle animation on an infinite loop. And I for the life of me cannot figure out how to fix this. Yes, I've extracted the animations and everything, it's just that I can't wrap my head around this. Any help would be greatly appreciated! Both monsters in this video have the same script unchanged. I also remember that the Monster AI script needs to have the animation names set in correctly, but I have no clue how to see if they're right or not, I just named the model's animations exactly like the "Crawler" animations and hoped for the best. Quote Link to comment Share on other sites More sharing options...
cassius Posted March 17, 2015 Share Posted March 17, 2015 I don't use lua, but can't you just change the sequence to the one you want Or do you need a one shot animation? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
xtom Posted March 17, 2015 Share Posted March 17, 2015 I think even without the animations something should happen. In the script dropdowns is he set to Team Bad? It looks like he might be set to neutral or same as player Good. Quote Check out my games: One More Day / Halloween Pumpkin Run Link to comment Share on other sites More sharing options...
lxFirebal69xl Posted March 17, 2015 Author Share Posted March 17, 2015 I think even without the animations something should happen. In the script dropdowns is he set to Team Bad? It looks like he might be set to neutral or same as player Good. He is in team bad. I don't use lua, but can't you just change the sequence to the one you want Or do you need a one shot animation? That's not the issue, the issue is that his animations aren't changing because he isn't recognizing the player. In the video, both monsters have the same script, so why do they behave differently? Quote Link to comment Share on other sites More sharing options...
shadmar Posted March 17, 2015 Share Posted March 17, 2015 mosterai.lua calls animations by name, like "Run", "Idle", "Death" and "Attack" I think you might have to rename your sequences or edit the script to match the sequences. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Thirsty Panther Posted March 18, 2015 Share Posted March 18, 2015 Have you built a nav mesh? Quote Link to comment Share on other sites More sharing options...
lxFirebal69xl Posted March 18, 2015 Author Share Posted March 18, 2015 Have you built a nav mesh? If I hadn't, the crawler woulnd't chase me on the video mosterai.lua calls animations by name, like "Run", "Idle", "Death" and "Attack" I think you might have to rename your sequences or edit the script to match the sequences. Most of the animations already have that name, check the picture. But the real issue is that NOTHING happens, even if the animations don't play, the monster should chase me, but he doesn't. That's the real issue here. Quote Link to comment Share on other sites More sharing options...
macklebee Posted March 18, 2015 Share Posted March 18, 2015 Looking at the picture, he has renamed the animations to Run/Idle/Death - but the attack animations are named 'Attack 1' whereas the crawler's attack animations are named like 'Attack1' without the space. Looking at the video, he has built a navmesh or the crawler would have never tracked him down. Animation has nothing to do with navmesh navigating. There are several things that have to be performed to make sure the character can navigate through the scene. So a couple of things that need to be set up: Character's Physics property tab: - The Physics Mode needs to be Character Controller. - The Mass has to be greater than 0. - Also, make sure the character is pointing the right direction - need to be facing the model's +Z direction. Use the Character Angle to make adjustments if this is not the case. If character is faced the wrong direction, it will chase backwards and sometimes not react until you are behind the character. Without seeing a picture of your Physics tab I can't say which one you didn't do. Other than that, you also have to make sure that the character is actually on the navmesh. Without a screenshot with the navmesh visible, I can't tell but the character is placed close to the edge of the ground box. When a navmesh is built, there will be a deadband around the edges of the ground. If the character is not located in the navmesh then it will not move. And just a comment on the animations shown in that picture: Remove the first animation that you extracted all of the other animations from. This will cut that model's file size by half and its not really needed anymore if you are going to use the extracted named sequences. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
nl2012 Posted March 18, 2015 Share Posted March 18, 2015 Even doing everthing right the way,in this case like macklebee has written down. LW (or me)seem to have some problems with rigs differ that from the crawler (bones structure?,mesh binding?, mass settings? after rescaling?) My problem is the same and i posted some questions too with no replies/solutions so far. I've tried the characters another engine and they worked just fine. I spend many hours figuring it out myself. So i hope my question helps to solve lxFirebal69xl's problem as well. Has anyone succeeded in letting a non crawler character (diffent bones,meshbinding) move animated from point to point over a navmesh, if yes...how? (-: I don't think it can be bone related because an animation is "baked" into a character, and just calling the animation sequence /track/name should does the trick in every engine. I seems that your/mine chars have a navmesh<<>> custom character issue? So maybey Josh can help out here. Hope this helps Quote HP Z820 workstation / 2 x Intel Xeon Processor E5-2650 v2 8c / 64GB / Geforce 980 gtx / MODO801 / MARI / ZBrush 4R7 / UU3D / Substance Designer / PS Link to comment Share on other sites More sharing options...
macklebee Posted March 18, 2015 Share Posted March 18, 2015 Has anyone succeeded in letting a non crawler character (diffent bones,meshbinding) move animated from point to point over a navmesh, if yes...how? (-: Yes, repeatedly, by doing the above steps. First you have to narrow down the actual problem. Is it an animation or navigation problem? The default monsterAI script handles both but they are separate issues. If you have done everything as mentioned above then you need to provide the actual character and/or map for people to look at or we are all just guessing at what the issue could be. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
josk Posted March 18, 2015 Share Posted March 18, 2015 I have set up a simple scene and apart from needing to set the animatoins correctly and make the model turn the right way it is working fine. Sorry no time to set up all animations at moment. Using monster ai script. Have you ticked the Enabled box? 1 Quote Elite Cobra Squad Link to comment Share on other sites More sharing options...
lxFirebal69xl Posted March 18, 2015 Author Share Posted March 18, 2015 Allright, I got him running at me correctly, thank Macklebee for the help! But there's another thing, whenever the monster touches the player the game freezes and I have to terminate it. What's up with that? 1 Quote Link to comment Share on other sites More sharing options...
macklebee Posted March 18, 2015 Share Posted March 18, 2015 Allright, I got him running at me correctly, thank Macklebee for the help! But there's another thing, whenever the monster touches the player the game freezes and I have to terminate it. What's up with that? That is caused by the fact that the script is trying to run the "Attack1" animation and your animation is named "Attack 1". So it doesn't find the animation and just hangs. Also the default script will randomly choose between multiple attacks, so rename all of the attack animations as "Attack1", "Attack2", etc... This updated script that uses the sequence name is a great improvement over the previous one that used the sequence number in my opinion because I think this makes it obvious what animation you are trying to set, but perhaps the default script needs a way to perform a check to see if the animation actually exists prior to setting it. 1 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
lxFirebal69xl Posted March 18, 2015 Author Share Posted March 18, 2015 That is caused by the fact that the script is trying to run the "Attack1" animation and your animation is named "Attack 1". So it doesn't find the animation and just hangs. Also the default script will randomly choose between multiple attacks, so rename all of the attack animations as "Attack1", "Attack2", etc... This updated script that uses the sequence name is a great improvement over the previous one that used the sequence number in my opinion because I think this makes it obvious what animation you are trying to set, but perhaps the default script needs a way to perform a check to see if the animation actually exists prior to setting it. Thank you very much, that fixed it! 1 Quote Link to comment Share on other sites More sharing options...
Firebringer4 Posted March 7, 2018 Share Posted March 7, 2018 On 3/17/2015 at 9:09 PM, macklebee said: - Also, make sure the character is pointing the right direction - need to be facing the model's +Z direction. Use the Character Angle to make adjustments if this is not the case. If character is faced the wrong direction, it will chase backwards and sometimes not react until you are behind the character. Without seeing a picture of your Physics tab I can't say which one you didn't do. how do we check this? what line is it at? im having this issue and i fixed everything else.. it just likes moving backwards.. (yes the navmesh works and yes the physics are set right i just need this tid bit of info on this one..) UPDATE: i figured it out.. some days im pretty sure im blind.. thanks mackle 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted March 7, 2018 Share Posted March 7, 2018 Awesome job helping everyone! 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...
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.