[EngiN33R] Custom Weapons 
140 comments Finally, I'm uploading the long-awaited (or not so much so now) script that is the custom weapons mod!
This modification allows you to add your very own weapons to the game. Naturally, owing to CS2D's limitations, it doesn't simulate real weapons to the fullest extent, but it's the first step toward that, and dare I say, quite a big one. Hopefully now all the whiners will stop whining as much.
To-do list:
Make custom weapons hurt buildings
Implement support for projectile-based custom weapons
Implement support for melee custom weapons
Remove the bufferimg workaround and do the bloody thing properly
If you have the need to edit the script, the code is commented in the most part; if you do not understand something - let me know in PM. If you have, for some reason, the intention to upload your modified script - I do not prohibit that, just be so kind as to mention what you based your edit on.
This is, of course, a beta version, and its features are quite limited. I will continue developing it further, the next thing to do is to add projectile-based custom weapon functionality. Please do leave feedback and report bugs if such are found.
EDIT: My apologies, I've now uploaded the missing files. The archive should be complete now and the script should work properly.
Another missing sprite has been added for the ammo box.
This modification allows you to add your very own weapons to the game. Naturally, owing to CS2D's limitations, it doesn't simulate real weapons to the fullest extent, but it's the first step toward that, and dare I say, quite a big one. Hopefully now all the whiners will stop whining as much.
To-do list:




If you have the need to edit the script, the code is commented in the most part; if you do not understand something - let me know in PM. If you have, for some reason, the intention to upload your modified script - I do not prohibit that, just be so kind as to mention what you based your edit on.
This is, of course, a beta version, and its features are quite limited. I will continue developing it further, the next thing to do is to add projectile-based custom weapon functionality. Please do leave feedback and report bugs if such are found.
EDIT: My apologies, I've now uploaded the missing files. The archive should be complete now and the script should work properly.
Another missing sprite has been added for the ammo box.
edited 4×, last 05.07.12 05:57:14 pm

Comments
140 commentsLog in!
You need to log in to be able to write comments!Log in
not working, i copied all files and i was edit custom_weapons.lua
weapons = {
[1] = {
name = "M134 Minigun", --name
sprite = "gfx/weapons/m134.bmp", --hold sprite
sprited = "gfx/weapons/m134_d.bmp", --drop sprite
snd = "weapons/m134.wav", --sound
range = 500, --range of bullet
ammo = 800, --ammo in clip
maxammo = 9000, --carried ammo
reloadt = 5000, --reload time
sndrad = 400, --sound radius
dmg = 21, --damage
rid = 90, --real id; the actual weapon the player will have equipped
disp = 4, --bullet dispersion
burstmode = true, --burst mode available
brf = 15, --burst fire bullets dispersion
},
[2] = {
name = "M249", --name
sprite = "gfx/weapons/m249.bmp", --hold sprite
sprited = "gfx/weapons/m249_d.bmp", --drop sprite
snd = "weapons/m249.wav", --sound
range = 300, --range of bullet
ammo = 800, --ammo in clip
maxammo = 100, --carried ammo
reloadt = 3000, --reload time
sndrad = 400, --sound radius
dmg = 17, --damage
rid = 40, --real id; the actual weapon the player will have equipped
disp = 3, --bullet dispersion
burstmode = true, --burst mode available
brf = 15, --burst fire bullets dispersion
},
}
weapons = {
[1] = {
name = "M134 Minigun", --name
sprite = "gfx/weapons/m134.bmp", --hold sprite
sprited = "gfx/weapons/m134_d.bmp", --drop sprite
snd = "weapons/m134.wav", --sound
range = 500, --range of bullet
ammo = 800, --ammo in clip
maxammo = 9000, --carried ammo
reloadt = 5000, --reload time
sndrad = 400, --sound radius
dmg = 21, --damage
rid = 90, --real id; the actual weapon the player will have equipped
disp = 4, --bullet dispersion
burstmode = true, --burst mode available
brf = 15, --burst fire bullets dispersion
},
[2] = {
name = "M249", --name
sprite = "gfx/weapons/m249.bmp", --hold sprite
sprited = "gfx/weapons/m249_d.bmp", --drop sprite
snd = "weapons/m249.wav", --sound
range = 300, --range of bullet
ammo = 800, --ammo in clip
maxammo = 100, --carried ammo
reloadt = 3000, --reload time
sndrad = 400, --sound radius
dmg = 17, --damage
rid = 40, --real id; the actual weapon the player will have equipped
disp = 3, --bullet dispersion
burstmode = true, --burst mode available
brf = 15, --burst fire bullets dispersion
},
}

Its too bad it doesnt works for me, copied every file in the zip file but it gives the error:EXCEPTION ACCESS VIOLATION
Edit:I saw your edit and re-downloaded it, it looks it is working.

Edit:I saw your edit and re-downloaded it, it looks it is working.
@
EngiN33R:
http://www.unrealsoftware.de/files_show.php?file=11747&start=60#com120390
That was a suggestion

http://www.unrealsoftware.de/files_show.php?file=11747&start=60#com120390
That was a suggestion
Code:
1
2
3
4
5
6
2
3
4
5
6
function always()
frame=frame+1
if frame==2 then --every 2nd frame etc.
--update images, etc.
end
end
frame=frame+1
if frame==2 then --every 2nd frame etc.
--update images, etc.
end
end

aww Bug :
When you choose ASR-2 and you are dead and you are dead when you used scope, that scope won't remove itself. also i can scooping with glock btw.
When you choose ASR-2 and you are dead and you are dead when you used scope, that scope won't remove itself. also i can scooping with glock btw.


That means cequip 1 1
Lol i tested but i had claws skin, but it's okay.
No, CS2D doesn't provide that kind of integration with itself. You can create a map script and use the cspawn Lua function to spawn cweapons on certain positions.
@
Infinite Rain: Because it would involve more trickery and CPU cycles.
Thank you everyone for your words of praise.
@
XTripleJaxX: Open the Console commands box in the description and see for yourself.

Thank you everyone for your words of praise.
@
