Can i edit the damage of the gun ?

Started by killvn, Feb 19, 2015, 11:18 AM

Previous topic - Next topic

Stormeus

For reference, these are all the field IDs. The values listed in the script may have been broken since they were actually guessed, and no reference was available.

FieldFireType = 1
FieldRange = 2
FieldFiringRate = 3
FieldReload = 4
FieldClipSize = 5
FieldDamage = 6
FieldSpeed = 7
FieldRadius = 8
FieldLifespan = 9
FieldSpread = 10
FieldFireOffsetX = 11
FieldFireOffsetY = 12
FieldFireOffsetZ = 13
FieldAnimGroup = 14
FieldAnimLoopStart = 15
FieldAnimLoopEnd = 16
FieldAnimFirePos = 17
FieldAnimTwoLoopStart = 18
FieldAnimTwoLoopEnd = 19
FieldAnimTwoFirePos = 20
FieldAnimBreakoutPos = 21
FieldModelId = 22
FieldModelTwoId = 23
FieldFlags = 24
FieldWeaponSlot = 25

killvn

#16
well ... my scripts :
SetWeaponDataValue(21, 6, 0.001); // For change damage of Stubby
I try to use alot of change number like that
SetWeaponDataValue(21, 6, 1); // For change damage of Stubby
SetWeaponDataValue(21, 6, 2); // For change damage of Stubby
SetWeaponDataValue(21, 6, 0.5); // For change damage of Stubby
SetWeaponDataValue(21, 6, 0.00005); // For change damage of Stubby
But it's can only make the damage of Stubby Shotgun (ID 21) Strongger ... can't be weaker ...
when i use :
SetWeaponDataValue(21, 6, -1);  .... it's make no damage or negative damage ... is there anything wrong ? I mean i only want to make damage of stubby shotgun lower ... for example original damage of stubby is 120 per shot and i just want to lower down to 50 damage ... but still not work ... can u give me some idea ? Thanks

Gudio

Fixed GetWeaponDataValue in squirrel module. Compiling atm.
* Gudio slaps Stormeus for many copy&paste :D

Sebastian

I just added the needed parameters and examples for all weapon functions, in wiki.
> Weapon Functions <

The last 3 functions doesn't exist in 0.4, but in 0.3. (for creating ammu-nation shops)
Stormeus should remove them. :)

Stormeus

Quote from: Gudio on Feb 20, 2015, 10:29 AMFixed GetWeaponDataValue in squirrel module. Compiling atm.
* Gudio slaps Stormeus for many copy&paste :D

oi

Quote from: sseebbyy on Feb 20, 2015, 12:35 PMI just added the needed parameters and examples for all weapon functions, in wiki.
> Weapon Functions <

The last 3 functions doesn't exist in 0.4, but in 0.3. (for creating ammu-nation shops)
Stormeus should remove them. :)

They are removed; in the current Squirrel module they just yell at you telling you it's not a 0.4 function (in order to make 0.3 scripts more compatible), and in the upcoming Squirrel rewrite it's been removed entirely.

Gulk

Hey, I added:

SetWeaponDataValue( 21 , 24, 200 ) - This should make jumping with the Stubby Shotgun impossible,  instead it acts weird.
Did I somehow get the code wrong? Values were Copy&pasted from weapon.mta (mta0.5's) weapon data.

Sebastian

Quote from: Gulk on Mar 29, 2015, 07:17 AMHey, I added:

SetWeaponDataValue( 21 , 24, 200 ) - This should make jumping with the Stubby Shotgun impossible,  instead it acts weird.
Did I somehow get the code wrong? Values were Copy&pasted from weapon.mta (mta0.5's) weapon data.

Just disable/enable the jump switch. That should disable/enable the ability to jump with shotguns as far as I remember.

You can set the jump switch in server.conf, there is such a line:
<JumpSwitch>true</JumpSwitch>
or you can do it by script, using SetJumpSwitch( bool )

Stormeus

Quote from: Gulk on Mar 29, 2015, 07:17 AMHey, I added:

SetWeaponDataValue( 21 , 24, 200 ) - This should make jumping with the Stubby Shotgun impossible,  instead it acts weird.
Did I somehow get the code wrong? Values were Copy&pasted from weapon.mta (mta0.5's) weapon data.

It should be 0x200 as the weapon flags are stored in hexadecimal and not decimal. Other than that, you should be correct; judging from the flags you're marking the stubby as "Heavy" to make it harder to break out of the animation.

It looks like you might've cleared other flags on the stubby so if that doesn't work, try 0x20240.

Stormeus

Bump @Gulk since I wasn't sure if you saw this.

Quote from: stormeus on Mar 29, 2015, 08:07 PM
Quote from: Gulk on Mar 29, 2015, 07:17 AMHey, I added:

SetWeaponDataValue( 21 , 24, 200 ) - This should make jumping with the Stubby Shotgun impossible,  instead it acts weird.
Did I somehow get the code wrong? Values were Copy&pasted from weapon.mta (mta0.5's) weapon data.

It should be 0x200 as the weapon flags are stored in hexadecimal and not decimal. Other than that, you should be correct; judging from the flags you're marking the stubby as "Heavy" to make it harder to break out of the animation.

It looks like you might've cleared other flags on the stubby so if that doesn't work, try 0x20240.

Gulk

#24
@sseebbyy JumpSwitch didnt change a thing. I'm sure JumpSwitch & FastSwitch are broken because I dont notice them changing anything. @stormeus What weapon stats do they change under the hood?

@stormeus I tried [ SetWeaponDataValue( 21 , 24, 0x200 ) //Stubby no crouch ] and as it says, it only disables crouching while shooting, forces the player to stand. Maybe theres other changes needed to acheive no jumping. I'm gonna finish all the weapon stat modifications today so I'll see how it goes and report back here. 0x20240 acts very strange

Stormeus

Quote from: Gulk on Apr 13, 2015, 03:02 PM@stormeus What weapon stats do they change under the hood?

@Gulk It's basically the same as editing weapon.dat. Column B is field ID 1, C is field ID 2, and so on. Column Q is omitted since it's a duplicate of P.

If you want to prevent players from jumping while shooting (e.g. breaking out of the shooting anim) I believe that's disabling fast switch.

Kratos_

#26
Quote from: Gulk on Apr 13, 2015, 03:02 PM@stormeus I tried [ SetWeaponDataValue( 21 , 24, 0x200 ) //Stubby no crouch ] and as it says , it only disables crouching while shooting , forces the player to stand .
It's Minigun's flag value which obviously will restrict crouch together with jump .

Quote0x20240 acts very strange

Try 0x020240 .

I'm not sure that jump switch will restrict the weapon shoot . Cuz , we have an entity called player.ShootInAir which will facilitate shooting while jumping ( ofc in air ) by toggling into . Jump Switch will player jump & Fast Switch will reduce the time lag between the weapon switchings . But , I'm not entirely sure about it .
If you're going to set Fast Switch as false then it will block that specific action as Stormeus mentioned above . But , it will get applied to all the weapons . I think only task left before us is to mark stubby as heavy in addition to other existing flags .
In the middle of chaos , lies opportunity.

Gulk

#27
Okay, this is an exact copy of MTA 0.5's weapon.mta
Still cant get the anti-jump for stub, grenades & molotovs enabled.

Jumpswitch and Fastswitch disabled/enable makes no difference to wheter i can jump or not

//Weapon Settings
 #All Melee weapons left unmodified, because they now work in VCMP 0.4
 
 #Grenade
 SetWeaponDataValue( 12, 24, 0x200) //HEAVY flags
 
 #Molotov
 SetWeaponDataValue( 15, 24, 0x200) //HEAVY flags
 
 #Colt45
 SetWeaponDataValue( 17, 24, 0x480C0) //Unknown flags
 
 #Python
 SetWeaponDataValue( 18, 24, 0x0040) //Unknown flags
 
 #Shotgun
 SetWeaponDataValue( 19, 24, 0x200) //Unknown flags
 
 #StubbyShotgun
 SetWeaponDataValue( 21, 24, 0x200 ) //No crouch
 SetWeaponDataValue( 21, 21, 11 ) //point in anim where we can breakout of anim/attack and run away
 SetWeaponDataValue( 21, 6, 60 ) //Damage
 
 #Tec9
 SetWeaponDataValue( 22, 24, 0x80C0) //Unknown flags
 
 #Uzi
 SetWeaponDataValue( 23, 24, 0x8840) //Unknown flags
 
 #SilencedIngram
 SetWeaponDataValue( 24, 24, 0x80C0) //Unknown flags
 
 #Mp5
 SetWeaponDataValue( 25, 24, 0x8840) //Unknown flags
 
 #M4
 SetWeaponDataValue( 26, 24, 0x8050) //Unknown flags
 
 #Ruger
 SetWeaponDataValue( 27, 24, 0x8040) //Unknown flags
 
 #M60
 SetWeaponDataValue( 32, 6, 45 ) //Damage

EDIT: @stormeus, since lowering the damage on stubby and m60. now it is higher instead. ;s (blowing up cars with 1 bullet)

Gulk

Any idea on how to modify the damage correctly @stormeus ?

Gulk

info on a bugfix for the damage settings? or possible workaround?