• One weapon equipped multiple times.
    10 replies, posted
Hi, i wonder if its possible to have more than One of the same weapon in his weapon slot. Thanks ^^
What do you mean? Like dual wielding? Passing the mouse at the same spot multiple times cycling through different weapons?
He might not mean duel wielding, just having two of the same weapons. Like having two glocks and using one at a time. The game just gives you more ammo for the weapon if you already have one. Yes, there's a way for sure. The only one off the top of my head is making duplicates of the same weapon, but that's probably terrible on a huge scale.
Thats exactly what i meant. Im searching for an not too hacky method. If its not possible im open to the hacky ones ^^ Dont know If i could use them but it world be interesting.
There actually is a way in the engine to have more than one of the same weapon called a "sub-type" but there are no Lua bindings for it. The best method you'll get is having two separate entity classes with the same properties/implementation.
Hm, but i would need more than 2. IT should be unlimited. Hm i ask google about these "sub-type" mybe its barely usable
That isn't related to what you want. You can copy weapon classes on the fly by doing: weapons.Register(weapons.GetStored("class") .. "_numhere") Where numhere is a unique number for every new class you want.
Good morning by the way xD (or was the time where you living) Haha, how cool is that But why .. and not , And why a _ Just trying to understand
The two dots (..) means 'attach these two strings together'. For example, "a_b_" .. "c_d_e" converts to "a_b_c_d_e". And yes the underscore is cosmetic, I think. That's just how entity classes are typically named and this falls under that standard.
Ah, mobile format didnt showed ne the whole code. Im just confused why weapons.Register(weapons.GetStored("class") .. "_numhere")) It should be weapons.Register(weapons.GetStored("original"),"new" ) ?
Whoops, made a typo on mobile. Edited the code.
Sorry, you need to Log In to post a reply to this thread.