Re: AHuman Weapon Restrictions
Make the weapon settle/delete instantly on drop. I think it's doable with ini but if not:
Code:
function Update(self)
if not (self.IsAttached()) then
self.ToDelete = true;
end
end
You have two choices for making sure no one else picks it up. Either a script for the actor (you'll need to redirect his ai to a new one which has this bit included on top of the base ai stuff) or for the gun (you'll still want the previous stuff if you do it for the gun).
For the actor:
Code:
function Update(self)
if self.EquippedItem ~= nil and self.EquippedItem.PresetName == "Item I don't want picked up's preset name here" then
self:GetController():SetState(Controller.WEAPON_DROP, true);
end
end
For the gun:
Code:
function Update(self)
if self:IsAttached() and MovableMan:GetMOFromID(self.RootID).PresetName ~= "The only actor who can hold the gun's preset name here" then
MovableMan:GetMOFromID(self.RootID):GetController():SetState(Controller.WEAPON_DROP, true);
end
end
They're basically the same thing, just the second one has to find the actor holding the gun. Note that you can make both of these check happen infrequently (probably every 100 or 1000 MS is fine) with timers if you want to make it slightly less expensive. It's probably pretty insignificant though, since each of those is just a couple lines to be executed.
Also keep in mind that, in theory, if the item is deleted whenever it's dropped, you should never run into the issue of someone else picking it up so the second stuff is probably unnecessary.