FOnline Development > General Discussion

How to edit/add new weapon perks?

(1/2) > >>

Krupniok:
Is there any way to edit or add new weapon perks (Penetrate, Knockback etc.)? I've searched over every file that I thought it can be coded - and nothing. I'm not talking about adding existing ones to the weapon, that's clear - but where can I increase/decrease effects of weapon perks or code new such special abilities?

Skycast:
Combat.fos

JovankaB:
For a new perk:

1. Define new perk name in _defines.fos. Value must be unique number (not taken by any other weapon perk) in a range 1-255. 0 means no perk.


--- Code: ---// Item perks
#define WEAPON_PERK_LONG_RANGE                   ( 1 )
#define WEAPON_PERK_ACCURATE                     ( 2 )
#define WEAPON_PERK_PENETRATE                    ( 3 )
#define WEAPON_PERK_KNOCKBACK                    ( 4 )
#define WEAPON_PERK_SCOPE_RANGE                  ( 5 )
#define WEAPON_PERK_FAST_RELOAD                  ( 6 )
#define WEAPON_PERK_NIGHT_SIGHT                  ( 7 )
#define WEAPON_PERK_FLAMEBOY                     ( 8 )
#define WEAPON_PERK_ENHANCED_KNOCKOUT            ( 9 )
--- End code ---

The name should start with "WEAPON_PERK_" just like those above, because that's where the Object Editor takes them from. Then you can use the Object Editor to set the new weapon perk. In scripts you should also use the name. For the existing effects, search for "Weapon_Perk" in fos files. These things aren't in one place but most should be in combat.fos.

Krupniok:
Ach, thanks. I thought it works different, but now it's quite clear. I've seen and understood that _defines & proto part, but it seems that if I'd like to edit anything it's time to seriously start learning ASC ;)

JovankaB:
Just to edit effects of existing perks, like changing


--- Code: ---if( weaponPerk == WEAPON_PERK_ACCURATE )
            baseToHit += 20;
--- End code ---
to

--- Code: ---if( weaponPerk == WEAPON_PERK_ACCURATE )
            baseToHit += 50;
--- End code ---

you don't need any serious AngelScript knowledge, only a searching skill and
understanding basics of any scripting. I use "find in files" option in Notepad++ :)

Navigation

[0] Message Index

[#] Next page

Go to full version