Data Realms Fan Forums
http://45.55.195.193/

[Help] Two-Legged Turrets
http://45.55.195.193/viewtopic.php?f=1&t=45573
Page 1 of 1

Author:  Insano-Man [ Tue Feb 25, 2014 1:00 am ]
Post subject:  [Help] Two-Legged Turrets

I'm presently working on a relatively unusual actor and I've run into a snag. I'm working off of an AHuman base for bipedal legs and proper jetpack balance. The issue is that I want it set up with turret-like weapons that it can't drop, but can be shot off of it. I had a look at this topic and, while Bad Boy's code helped me whip up a neat little side-function that prevents it from picking up new weapons, I can't quite get the HDFirearm to go back into its inventory when dropped.

So far, the code I've modified is looking like this:


Additionally, the actor has a lot of difficulty aiming the weapon. It usually aims very high, and won't engage with the background weapon (if it's the only weapon available) at all. I'm not sure if this is an inherent problem with background weapons, or if it might be because I'm using fake arms to mount the weapons onto.

What am I doing wrong?

Author:  Bad Boy [ Tue Feb 25, 2014 1:10 am ]
Post subject:  Re: [Help] Two-Legged Turrets

Try changing the weapon drop stuff to
Code:
if not self:HasObject("object name") then
    self:AddInventoryItem(CreateHDFirearm("Gun name", "Gunrte.rte"))
end

This'll make it so if the actor doesn't have the object it'll add one. This won't work for multiples of a weapon for that reason (it could with a bit more code) but otherwise it'll probably do what you want.
I'm not sure why the other one isn't working or if it ever did, it's been a while since I posted that haha

Author:  Insano-Man [ Wed Feb 26, 2014 7:14 am ]
Post subject:  Re: [Help] Two-Legged Turrets

That got the weapon re-affixing itself, now I just need to figure out how to ensure it won't come back after being destroyed. I think I just might be able to jigger something up with some sharpness fiddling. Thanks!

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/