Dzsozi (h03) Posted November 12, 2016 Share Posted November 12, 2016 Hello! I was thinking about how I could make more weapon types or weapons, dayz gamemode could do that, and valhalla gamemode also has these taser guns, but (if I'm not mistaken) they kept the default weapons as well. The taser just had a different look and functionalities done via scripting, but it was a weapon. How I could do similar things, so I could make for example a grenade launcher with custom projectiles, but also keep the rocket launchers or any other weapon and the ability to use them normally. How can dayz have m1911, m9, m9 sd and so much more pistols and other kind of weapons with different sounds, different damage and etc etc? Link to comment
Dimos7 Posted November 12, 2016 Share Posted November 12, 2016 for weapons can use createWeapon() playSound() Link to comment
pa3ck Posted November 12, 2016 Share Posted November 12, 2016 Hide the weapon element using setElementAlpha and use createObject at the position of the hidden weapon. Link to comment
Dzsozi (h03) Posted November 20, 2016 Author Share Posted November 20, 2016 I looked up the DayZ open source files and I found that it is made using setElementData to players, but I can't find how is it being handled, where is it set. I just found the part where the weapons are being replaced and I would like to try doing it that way. Could somebody help me where I can find the handling of this element data? Which lua file? I found these: https://github.com/mtadayz/MTADayZ/blob/master/DayZ/tables/table_general.lua https://github.com/mtadayz/MTADayZ/blob/master/DayZ/models/weaponswitch.lua Link to comment
pa3ck Posted November 20, 2016 Share Posted November 20, 2016 I just remembered how somebody I know did this. He replaced the textures of the guns with an "invisible" texture so you can't see them all. Then whenever a player has a gun in their hands, create an object and attach it to their hand. Link to comment
Dzsozi (h03) Posted November 20, 2016 Author Share Posted November 20, 2016 But I would like to do it in a way like the DayZ gamemode has it, since it is just replacing the models and handles the functions, there is no need to create objects, play around with positions. I am also afraid of objects because I think they wouldn't be steady if I move my camera so fast. 1 Link to comment
pa3ck Posted November 20, 2016 Share Posted November 20, 2016 Just to let you know, I'm pretty sure that in that DayZ gamemode, only the local client sees different weapons. When you replace the TXD, whatever you do, you either change it for every client (so you can have only 1 weapon) or only 1 client and others won't see it. Why do you think you need shaders to replace car paintjobs, CJ skin color, head type etc? Link to comment
Dzsozi (h03) Posted November 20, 2016 Author Share Posted November 20, 2016 I understand that I can replace textures with different ones at the same time more than once, and I cannot do that with models, but I would like to just give it a try and try out the custom added weapons from the dayz mod now. If it doesn't work how I want it to work, then I will try to do it like you said, but I'm just interested about the DayZ method, so I can learn and try it. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now