Raised This Month: $ Target: $400
 0% 

Custom Weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 03-21-2017 , 20:05   Re: Custom Weapon
Reply With Quote #1

It is not possible to add a completely new weapon to the game, because the number of weapons in the game is hard coded...

What you can actually do is is create a new weapon over an existing one...

The simplest way to do this is to change the damage, models, attack speed etc of an existing weapon and use a bool to tell who has the weapon ( to who these changes should apply )
__________________

Last edited by Depresie; 03-21-2017 at 20:06.
Depresie is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 03-21-2017 , 20:56   Re: Custom Weapon
Reply With Quote #2

Quote:
Originally Posted by Depresie View Post
use a bool to tell who has the weapon ( to who these changes should apply )
Storing it for player is a bad way, better store it inside weapon entity.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
PartialCloning
Senior Member
Join Date: Dec 2015
Old 03-21-2017 , 21:42   Re: Custom Weapon
Reply With Quote #3

Quote:
Originally Posted by PRoSToTeM@ View Post
Storing it for player is a bad way, better store it inside weapon entity.
Are weapon entities destroyed at any point other than being killed? When you pickup a weapon is the weapon inside the weaponbox destroyed and a new one created or is it the same entity but set to follow you? Likewise when you drop a weapon or at any point after the creation of the weapon entity.
PartialCloning is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 03-21-2017 , 22:34   Re: Custom Weapon
Reply With Quote #4

Quote:
Originally Posted by PRoSToTeM@ View Post
Storing it for player is a bad way, better store it inside weapon entity.
That doesn't look like a bad idea, but still, pev_iuser fields aren't that many, tho i don't think it should be called "a bad way" using a simple Array =/

Btw, pev_iuser fields are cleared when the entity is deleted right ?

@PartialCloning

From what i remember, if i am not mistaken, the weaponbox entity (1) is holding an entity inside (2) but the player recieves a new entity (3) - the weapon... and entity (1 and 2 are getting removed )

Or the weaponbox entity (1) when picked is removed and creates another entity (2) - the weapon

Either way, the weaponbox entity is not the same with the weapon entity the player recieves...
__________________

Last edited by Depresie; 03-21-2017 at 22:40.
Depresie is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 03-22-2017 , 16:12   Re: Custom Weapon
Reply With Quote #5

Quote:
Originally Posted by Depresie View Post
Either way, the weaponbox entity is not the same with the weapon entity the player recieves...
The weapon entity stored in the weaponbox entity is the same with the weapon entity the player receives (or drops).
Quote:
Originally Posted by Depresie View Post
That doesn't look like a bad idea, but still, pev_iuser fields aren't that many, tho i don't think it should be called "a bad way" using a simple Array =/
You can also use array for weapon entity or use Klippy's module https://forums.alliedmods.net/showthread.php?t=294188. The main idea is to associate it with weapon entity, not with player.
__________________

Last edited by PRoSToTeM@; 03-22-2017 at 16:22.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode