Change "Shootable weapon" damage, clip size etc from script

Grannyboy

Active member
I have an custom made weapons crafting bench were I want to change for example the "Clip size" and "Damage" on my characters Item with Shootable weapon script attached to it.

I read the "Event system" page top to bottom several times but still cant understand how to go on about this.

For example, when I equip my weapon with a bigger clip, I want to change the clip size from original 30 to 40 trough code.
 

Attachments

  • Opsive_clip_size_help.PNG
    Opsive_clip_size_help.PNG
    35.7 KB · Views: 5
To simplyfy the question:
How do I change "Shootable weapon" attributes from my own custom made scripts?
 
You can access these properties directly from the ShootableWeapon class. E.g. the clip size can be changed by setting ShootableWeapon.ClipSize = ... So you'd just need a reference to the ShootableWeapon component, then you can set whatever you want. Take a look through the public properties in ShootableWeapon.cs, but it gives you access to pretty much everything you should need.
 
You can access these properties directly from the ShootableWeapon class. E.g. the clip size can be changed by setting ShootableWeapon.ClipSize = ... So you'd just need a reference to the ShootableWeapon component, then you can set whatever you want. Take a look through the public properties in ShootableWeapon.cs, but it gives you access to pretty much everything you should need.
Omg I over complicated things extremly much. Thank you for this extremly simple yet effective solution! Much appreciated!
 
Top