I'm sure this has been asked many times, and I don't mean to be a burden. But I was wondering how to make weapons dual weildable. It has something to do with with shields correct? And I already know that the weapon must be one handed. If anyone has a line a code I can just stick into the weapons code to make it dual weildable you would have my gratitude. :)
Mon Mar 23, 2009 6:39 am
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
Re: Dual Weilding
Change AddToGroup = Weapons to AddToGroup = Shields
Of course if you still want a version in the weapons category just copy the code for the HDFirearm and make a new one with a different instancename and the above change.
Mon Mar 23, 2009 6:49 am
Spiritlol
Joined: Mon Mar 23, 2009 6:24 am Posts: 8
Re: Dual Weilding
Ah didn't think it would be that easy. Thank you
Mon Mar 23, 2009 8:42 pm
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
Re: Dual Weilding
Aug2012 I'm just gonna redo this whole post. So anyways.
Using just the shield category weapons means any combination of the weapons can be dual wielded with each other, which is good, but AI won't actually shoot then, so that's not good. Using a separate shield weapon and weapons weapon means AI can use it, but they're not all interchangeable.
A bit of Lua can give you the best of both worlds, though, proper AI usage and interchangeability. plop a unique gib on your gun plop this on your gun, change names accordingly
Code:
function Update(self)
--determine the root object. if self.RootID ~= 255 then self.y = MovableMan:GetMOFromID(self.RootID) if self.y then if self.y:IsActor() then self.z = ToActor(MovableMan:GetMOFromID(self.RootID))
--OFFHAND REVERSION back to a regular gun if there is no regular gun if self.PresetName == "Old Faithful Offhand" and not self.z:HasObject("Old Faithful") and self.Sharpness > 0 then self.k = CreateHDFirearm("Old Faithful","Shadow Echelon.rte") self.k.Sharpness = self.Sharpness self.z:AddInventoryItem(self.k) self.Lifetime = 1 self.Sharpness = 0 self.PresetName = "Nope" self.z:GetController():SetState(Controller.WEAPON_CHANGE_PREV,true) --EQUIP OFFHAND elseif self.PresetName == "Old Faithful" and self.z:HasObject("Old Faithful Offhand") and self.Sharpness > 0 then --self.z:EquipShieldInBGArm() makes sure they equip the offhand one too, but this seems broken or something end
end
end end end
function Destroy(self) self.found = 4 for particle in MovableMan.Particles do if particle.PresetName == "SE Device Gibbed" then if self.found > (particle.Pos - self.Pos).Magnitude then if self.ToDelete == true then self.partList = {} for i = 1, math.ceil(self.Sharpness/self.roundsperbox) do if self.Sharpness > self.roundsperbox then self.Sharpness = self.Sharpness - self.roundsperbox self.partList[i] = CreateHeldDevice(self.ammobox,"Shadow Echelon.rte") self.partList[i].Vel = self.Vel self.partList[i].Pos = self.Pos MovableMan:AddParticle(self.partList[i]) end end end end end end end
plop this on a dual wielding pie menu option on the primary hand weapon, change the name accordingly
Code:
function GoOffhand(actor) local gun = ToAHuman(actor).EquippedItem; if gun ~= nil then actor.k = CreateHDFirearm("Old Faithful Offhand","Shadow Echelon.rte") actor.k.Sharpness = gun.Sharpness actor:AddInventoryItem(actor.k) gun.Lifetime = 1 gun.Sharpness = 0 actor:GetController():SetState(Controller.WEAPON_CHANGE_PREV,true) end end
Last edited by Azukki on Wed Aug 08, 2012 5:04 pm, edited 2 times in total.
Tue Mar 24, 2009 11:59 pm
olo
Joined: Sun Feb 20, 2011 7:31 pm Posts: 21
Re: Dual Weilding
Hi , I have problems with Dual weilding in B27 , can some one post instruction how to do it? I have tried "OneHanded = 1" and copied the hdfirearm code with chaged "AddToGroup = Shields" thanks.
Are Azukki commands still used?
Tue Aug 07, 2012 2:56 pm
Miggles
Data Realms Elite
Joined: Mon Jul 12, 2010 5:39 am Posts: 4558
Re: Dual Weilding
Ok, 3 year bump, cool. Regardless, I'll answer your question: 1) Azukki's commands there were only suggestion, not actual commands. 2) Could you give me the mod? I don't see whats wrong. Make sure you buy the primary one from "Guns" and the offhand from "Shields".
Tue Aug 07, 2012 4:42 pm
p3lb0x
Forum Moderator
Joined: Fri Feb 02, 2007 3:53 pm Posts: 1896 Location: in my little gay bunker
Re: Dual Weilding
You wouldn't even need dual wield shake range. There's already a one-handed variable.
Tue Aug 07, 2012 5:21 pm
olo
Joined: Sun Feb 20, 2011 7:31 pm Posts: 21
Re: Dual Weilding
Miggles wrote:
Ok, 3 year bump, cool. Regardless, I'll answer your question: 1) Azukki's commands there were only suggestion, not actual commands. 2) Could you give me the mod? I don't see whats wrong. Make sure you buy the primary one from "Guns" and the offhand from "Shields".
Sorry I used search and fogot this is in making section, I'm trying with different mods , Unitec etc. I have error when I try "one handed = 1 "
ok here is what I do I am copying the changed code below the original code in the same file , first the orginal code
Last edited by olo on Tue Aug 07, 2012 6:57 pm, edited 2 times in total.
Tue Aug 07, 2012 5:22 pm
Joseh123
Joined: Wed Feb 08, 2012 10:12 pm Posts: 611 Location: Brazil
Re: Dual Weilding
Put that in a spoiler, it is too big. And I think the weapon itself shouldn't be inside the Shields section, only the Offhand version. Is that what you are trying to do? A Dual Wielding weapon?
Tue Aug 07, 2012 6:34 pm
olo
Joined: Sun Feb 20, 2011 7:31 pm Posts: 21
Re: Dual Weilding
Joseh123 wrote:
Put that in a spoiler, it is too big. And I think the weapon itself shouldn't be inside the Shields section, only the Offhand version. Is that what you are trying to do? A Dual Wielding weapon?
what do you mnan offhand version? I am copying the changed code below the original code.
Tue Aug 07, 2012 6:54 pm
Miggles
Data Realms Elite
Joined: Mon Jul 12, 2010 5:39 am Posts: 4558
Re: Dual Weilding
1st of all, what error do you get? Secondly, if you want to dual wield, you have to make the normal gun one handed too.
Wed Aug 08, 2012 5:15 am
olo
Joined: Sun Feb 20, 2011 7:31 pm Posts: 21
Re: Dual Weilding
Miggles wrote:
1st of all, what error do you get? Secondly, if you want to dual wield, you have to make the normal gun one handed too.
I mean cc crashes when loading "weapons.ini" file from unitec folder , ok I will try this.
Ok... still fails. This started to be frustrating lol I tried another few options
Wed Aug 08, 2012 6:45 pm
olo
Joined: Sun Feb 20, 2011 7:31 pm Posts: 21
Re: Dual Weilding
Ok guys lmao the problem was not using "TAB" but "space" no I can weild everything.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum