Data Realms Fan Forums

Forcing the AI to go full auto [SOLVED]
Page 1 of 1

Author:  Visage [ Tue Jun 09, 2015 11:44 am ]
Post subject:  Forcing the AI to go full auto [SOLVED]

I have a script that reloads a gun (instantly) between the first few shots to enable the ability to change the magazine of the gun.

The gun works perfectly well as intended, until you let an AI try to shoot it.

The AI simply fires the first shot repeatedly at the lowest fire rate available. Is there any way to get the AI to actually do the equivalent of holding down the trigger even through reloads?

Would it be possible to attach such an AI change to a gun?

More reasonably, is there a way to change the magazine without reloading?

I've included the relevant code here for your perusal if you care to.

Author:  Arcalane [ Tue Jun 09, 2015 1:43 pm ]
Post subject:  Re: Forcing the AI to go full auto

You're probably better off using a dummy mag+ammo and spawning the projectiles as a function of the script itself. That way the AI should behave itself and you don't need to do weird stuff with reloading.

Author:  Visage [ Wed Jun 10, 2015 9:25 am ]
Post subject:  Re: Forcing the AI to go full auto


After derping around a bit, I managed to get it to work, so I think I'll mark it as solved.

On a related note, though, how do I credit Lua stolen from vanilla content?

Author:  TheLastBanana [ Thu Jun 11, 2015 8:04 pm ]
Post subject:  Re: Forcing the AI to go full auto [SOLVED]

You could include a comment that says what file it came from.
Personally I've never really cared if people steal my scripts from vanilla content, though like 95% of the Lua scripts in the game probably aren't mine anymore, so take that with a grain of salt.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group