JohnBobSmith Posted September 19, 2014 Share Posted September 19, 2014 Hello all. As I am experimenting with Leadwerks, I have come across a strange issue. My monster runs on the spot, and wont chase the player. I am using all the default scripts and assets. Heres what I have done: -Drag the player prefab into the 3D viewport -Drag the monster prefab into the 3D viewport -Drag the player prefab from the scene view to the target slot of the monster's monsterAI.lua script. -Run the game -Monster runs on spot and doesnt attack the player unless I am really close and even then I need to shoot the monster to initiate the attack... I'm probably missing something obvious, but this is strange nevertheless. The desired result is that the monster(s) will find and run towards the player and attack the player. All help appreciated! Quote I'm an enthusiast developer looking to make games for Linux. Link to comment Share on other sites More sharing options...
cassius Posted September 19, 2014 Share Posted September 19, 2014 Don.t know about lua, but there is a "follow" command in the command reference.It will make enemies follow main character. EDIT; providing you build navmesh. 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...
JohnBobSmith Posted September 19, 2014 Author Share Posted September 19, 2014 Where can I find the command reference? Also, it seems strange that the default monster does not have this feature built in. Whats a navmesh and how do I make one? Again, sorry for sounding stupid. I will google around and post back my answers here if I find any. Thanks for the help! Quote I'm an enthusiast developer looking to make games for Linux. Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 20, 2014 Share Posted September 20, 2014 Command reference and user guide are a good place to start. Quote Link to comment Share on other sites More sharing options...
JohnBobSmith Posted September 20, 2014 Author Share Posted September 20, 2014 Doh! How could I miss something that obvious. Oh well, I will look there now. Quote I'm an enthusiast developer looking to make games for Linux. Link to comment Share on other sites More sharing options...
cassius Posted September 20, 2014 Share Posted September 20, 2014 navmesh tool is in editor\tools. 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...
JohnBobSmith Posted September 20, 2014 Author Share Posted September 20, 2014 Thanks guys it works now. Though building a navmesh with some terrain takes FOREVER with default settings. Is this normal? Quote I'm an enthusiast developer looking to make games for Linux. Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 20, 2014 Share Posted September 20, 2014 If you have terrain then it can take quite some time. Quote Link to comment Share on other sites More sharing options...
JohnBobSmith Posted September 20, 2014 Author Share Posted September 20, 2014 Hm, alright. Now to figure out why I can run through a stock barrel (it appears to have no collision)... I will google that now. Quote I'm an enthusiast developer looking to make games for Linux. Link to comment Share on other sites More sharing options...
Guppy Posted September 20, 2014 Share Posted September 20, 2014 Hm, alright. Now to figure out why I can run through a stock barrel (it appears to have no collision)... I will google that now. Use the prefab barrel it's already set up for physics Quote System: Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k Link to comment Share on other sites More sharing options...
Haydenmango Posted September 20, 2014 Share Posted September 20, 2014 To give entities collision they need a Physics Shape. See the physics tab of the entity. You can choose a collision type for the entity to make it collide with other entities. See collision reference here - http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778 Then if you want the entity to move when it collides it needs a mass above 0. If you want it to stay still (Like the ground, walls, ceilings) give it a mass of 0. Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding 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.