Files

> > CS2D > Lua Scripts > [EngiN33R] Custom Weapons
Files overviewCS2D overviewLua Scripts overview

English [EngiN33R] Custom Weapons >

140 comments155 kb, 1,828 Downloads

old [EngiN33R] Custom Weapons

EngiN33R
Moderator Off Offline

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.

Console commands >


To-do list:
flame Make custom weapons hurt buildings
flame Implement support for projectile-based custom weapons
flame 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.
edited 4×, last 05.07.12 05:57:14 pm
Approved by Yates

Download Download

155 kb, 1,828 Downloads

Comments

140 comments
Page
To the start Previous 1 2 3 4 5 6 7 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

J4x
User Off Offline

just epic!
I like it!

old

Infinite Rain
Reviewer Off Offline

Cool but why didn't you use the original equip/strip/spawn commands?
I like it!

old

MikuAuahDark
User Off Offline

bug found: equip a asr-2 weapon(ID 2) then drop the claw, after you equip the claw again the weapon image not showed but the effects is still work and show this on console:
LUA ERROR: sys/lua/custom_weapons.lua:300: bad argument #1 to 'image' (string expected, got nil)
.. bdw nice
I like it!

old

Seekay
Reviewer Off Offline

@user Jela331: You can't destroy breakable walls and buildings either, just sayin'.
I like it!

old

Jela331
User Off Offline

@user EngiN33R:
By the way, you can't kill NPCs with custom weapons, please fix it.
I like it!

old

SkullzOrig
User Off Offline

@user EngiN33R: Sorry, that was mistake of sentencing on my behalf. I meant add a option to change the weight of the gun, so that we may rearrange the weight of the gun. And if that is not possible. Then maybe add a speed mod to it. Try to add speed = 1 -- 1 = light, 2 = average, 3 = heavy. Hope this makes more sense.
I like it!

old

EngiN33R
Moderator Off Offline

@user Seekay: It may be an image bug, when some image overlaps another one - in this case, some image may have overlapped the pistol's skin. I had the same one with bullets, and I fixed it by using the buffer images (a few block.bmp images created outside of the player's view). Until we have better control over images, by their ID or something, all I can do is try creating more buffer images or some other nasty workarounds.

And no, I put the P250 skin on the M9 by design, since it was really just a demonstration of silencer functionality.

@People having EAV errors: can't help you with that, I never had one with this script. Have you downloaded the latest version of CS2D? I remember it was a frequently encountered bug until a hotfix was released.

@user SkullzOrig: What do you mean 'add the edit for the weapon'? And by your setspeed suggestion, do you suggest having speeds between speedmod 0 and 1? About bullets - I'm quite sure that since it's scalable, it would look weird. Try it yourself - the bullet image is completely editable and you can easily modify it yourself.

old

Seekay
Reviewer Off Offline

@user EngiN33R:

Here I'm holding the P250, but it doesn't have a skin. But it is in my gfx folder. The M9 is using that skin.
1
2
3
name = "M9",
		sprite = "gfx/weapons/p250.png",
		sprited = "gfx/weapons/p250_d.png",
You wrote P250 instead of M9. How I said, I don't even have the M9 skins either.
I like it!

old

Suprise
BANNED Off Offline

EXCEPTION_ACCES_VIOLATION when i tried to spawn a weapon. (p250) (And when equip)
I like it!

old

EpicCrisis
User Off Offline

Time to make a weapon that can fire OVER 9000!!!
I like it!

old

_Sub-Z3ro_
User Off Offline

when I try to spawn weapon I get this error
EXCEPTON_ACCEPT_VIOLATION
I like it!

old

Jynxxx
User Off Offline

@user SkullzOrig: You can edit the weapons functions. Setspeed, if you mean how fast the gun shoots add some like this to the weapon table
1
ht = 1--time unit for shots, in milliseconds
this will make the weapons firing speed more faster. He commented everything needed to know about the lua. You just didn't even read it.
I like it!

old

SkullzOrig
User Off Offline

In next update, try to add the edit for the weapon. If not possible, try to add a setspeed to the player. In a min and max of 0.1-1.0 or something like that. So the speed could be changed but not to some freakishly high speed. And is there any chance of improving the bullet image. I know it already is at a width of 1 pixel, but if you can try to make it skip a 1 pixel length so it would appear as tho it has a more accurate look when it fires. Just some suggestion/opinions. Good job by the way. But the script does remind me of CS2D Tibia rpg items.lua but running itself individual.
I like it!

old

Sparty
Reviewer Off Offline

"Grab somebody sexy and tell them hey"
Your Lua is fucking awesome whats next your on list?
I like it!

old

Pirtyu
User Off Offline

Wtf? Nice script
I like it!

old

buraxia3
User Off Offline

Magnificent!
I like it!

old

EndDead
User Off Offline

Oops i found a small bug, Damage has no effects on NPCs. But np its still beta.
Still good job
I like it!

old

EngiN33R
Moderator Off Offline

Gentlemen, please.

@user Seekay: I've just checked, all weapons have their skins in the archive - I'm not sure what you mean. The ammo box custom 'item' didn't have its sprite though, so I've fixed that, thank you - other than that, all weapons either have their sprites uploaded or use default ones.
To the start Previous 1 2 3 4 5 6 7 Next To the start