Data Realms Fan Forums
http://45.55.195.193/

Switch weapons?
http://45.55.195.193/viewtopic.php?f=73&t=15186
Page 1 of 1

Author:  whitty [ Fri Jun 05, 2009 4:51 am ]
Post subject:  Switch weapons?

Is it possible to make it so that if you press "1" you have a certain weapon, and if you press "2" you have a different one?

Author:  Grif [ Fri Jun 05, 2009 5:12 am ]
Post subject:  Re: Switch weapons?

Inventory management is ♥♥♥♥, remember? Thought it MIGHT work?

Author:  whitty [ Fri Jun 05, 2009 5:14 am ]
Post subject:  Re: Switch weapons?

Wait... what?

So this won't work?

Code:
function Update(self)
   if(UInputMan:KeyPressed(28)) and (self:IsPlayerControlled()) then
      Pressed1 = 1
   else
      Pressed1 = 0
   end
   if Pressed1 == 1 then
      self.CreateHDFirearm("Annihilator");
   else
      Pressed1 = nil;
   end
   if(UInputMan:KeyPressed(29)) and (self:IsPlayerControlled()) then
      Pressed2 = 1
   else
      Pressed2 = 0
   end
   if Pressed2 == 1 then
      self.CreateHDFirearm("QMG");
   else
      Pressed2 = nil;
   end
end


Is it possible then to switch out the turrets on an ACrab to give the effect that it changed weapons?

Author:  Grif [ Fri Jun 05, 2009 5:37 am ]
Post subject:  Re: Switch weapons?

Well just doing createhdfirearm isn't going to do anything at all; you have to switch out the turrets which would require attachable and/or inventory access, which is as of b23 straight up ♥♥♥♥.

So no you can't do it.

Author:  whitty [ Fri Jun 05, 2009 7:52 pm ]
Post subject:  Re: Switch weapons?

Wait... But maybe... Could you replace every instance of a gun with a different one? So like you press 1 and SMGs turn into Pistols.

Author:  Grif [ Fri Jun 05, 2009 10:07 pm ]
Post subject:  Re: Switch weapons?

Can't access guns while they're held; they're treated as attachables and ignored completely by Lua.

Author:  whitty [ Fri Jun 05, 2009 10:10 pm ]
Post subject:  Re: Switch weapons?

FGJKADFKLHSD565WGHJCN DAMMIT.

Author:  Lizardheim [ Tue Jun 09, 2009 2:39 pm ]
Post subject:  Re: Switch weapons?

You COULD however replace the actor with one that has a different weapon, don't know if it works tho.

Author:  Siric [ Tue Jun 09, 2009 3:32 pm ]
Post subject:  Re: Switch weapons?

Lizard wrote:
You COULD however replace the actor with one that has a different weapon, don't know if it works tho.

then, if it is damaged it will go back to full health/all attachables back/no wounds anymore.

Author:  CrazyMLC [ Tue Jun 09, 2009 4:41 pm ]
Post subject:  Re: Switch weapons?

Meh, who cares?

Just a little.. side affect.
*wink*

Author:  Lizardheim [ Tue Jun 09, 2009 6:48 pm ]
Post subject:  Re: Switch weapons?

Awesome side-effect is awesome.

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