karmacomposer Posted July 2, 2017 Share Posted July 2, 2017 I have animated rats and other varmints. Is there a AI script for pests, like Rats? If not, how would I make it scamper all over the navmesh? It already has all the animations and I don't really them to attack or hurt the player - just be creepy. Thank you. Mike Quote MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 980 GTX with 16gb vram / SSD drives MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1060 GTX with 8gb vram / SSD drives Alienware Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1070 Ti with 16gb vram / SSD drives My Patreon page: https://www.patreon.com/michaelfelkercomposer My music for sale: https://www.tgcstore.net/category/513?format=all&perpage=30&textures=undefined&price=all&order=default&artists[]=87213 Custom synths and sounds - http://www.supersynths.com Link to comment Share on other sites More sharing options...
nick.ace Posted July 2, 2017 Share Posted July 2, 2017 You have two practical options IMO: Option 1 Use one character controllers per group of rats. Option 2 Create you own pathfinding system just for rats. Obviously, this requires some setup, but depending on what you want to accomplish here, this might be an option. With option 1, you would basically add a bunch of rats to a character controller. If you look at the AI script that comes with Leadwerks, you should see that it follows the player. Instead, you will need to set up a bunch of points that will be "hiding" spots for the rats. When the player gets close enough to the rats ("GetDistance()"), then need to use "GoToPoint()" to go to one of those hiding spots. Which hiding spot you go to depends on how you want the AI to behave (is the closest point OK, or do the rats need to get as far as possible from the player?). Quote Link to comment Share on other sites More sharing options...
karmacomposer Posted July 2, 2017 Author Share Posted July 2, 2017 I just want a bunch of rats scurrying around - very creepy. I do have to figure out the animation frames, but in the end, I just want them upsetting the player but not hurting them. Right now, the zombie ai script works but hurts the player and anything I attach that script to attacks once and then stops and just rotates around the player when you walk by an entity that already attacked you. Very weird. I was able to lower the amount of hurt to 1 and I assume a value of 0 will not hurt the player at all - but the rats (and spiders) just stop after - never to attack again. I want them to stop for a moment or two and then come after you if you are close enough for them to 'see' you. Mike Quote MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 980 GTX with 16gb vram / SSD drives MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1060 GTX with 8gb vram / SSD drives Alienware Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1070 Ti with 16gb vram / SSD drives My Patreon page: https://www.patreon.com/michaelfelkercomposer My music for sale: https://www.tgcstore.net/category/513?format=all&perpage=30&textures=undefined&price=all&order=default&artists[]=87213 Custom synths and sounds - http://www.supersynths.com Link to comment Share on other sites More sharing options...
nick.ace Posted July 2, 2017 Share Posted July 2, 2017 You'll need to modify that script and have them not chase the player. There should be a "GoToPoint()" or "Follow()" command within that script. You need to change that to a hiding spot. 5 minutes ago, karmacomposer said: I was able to lower the amount of hurt to 1 and I assume a value of 0 will not hurt the player at all - but the rats (and spiders) just stop after - never to attack again. I want them to stop for a moment or two and then come after you if you are close enough for them to 'see' you. I thought that you wanted them to move away from the player (according to your original post)? Quote Link to comment Share on other sites More sharing options...
karmacomposer Posted July 2, 2017 Author Share Posted July 2, 2017 No, I want them to go TO the player and keep following them. Mike Quote MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 980 GTX with 16gb vram / SSD drives MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1060 GTX with 8gb vram / SSD drives Alienware Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1070 Ti with 16gb vram / SSD drives My Patreon page: https://www.patreon.com/michaelfelkercomposer My music for sale: https://www.tgcstore.net/category/513?format=all&perpage=30&textures=undefined&price=all&order=default&artists[]=87213 Custom synths and sounds - http://www.supersynths.com Link to comment Share on other sites More sharing options...
nick.ace Posted July 2, 2017 Share Posted July 2, 2017 Ok, then just set a max distance from the player. For example, have them "Follow()" until they reach a certain distance from the player, then call "Stop()". 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.