$Hidden:

From GECK
Jump to: navigation, search

Weapon Smith

Description

This trait will set the Attachment to hidden, with two modes. Mode 1: the attachment will be hidden at the menu unless it's in the players inventory. Mode 2: the attachment will be hidden unless changed by a script. With Mode 2, you can essentially make an unlock system. Unlocking attachments when the player meets certain milestones.

Syntax

  $Hidden: mode:int

Example

;Inside "WeaponAttachments\WeapNV9mmPistol\BarrelDevice\BarrelDevice_Config.ini"

   $EditorID: MySilencer
   $Name: Silencer Mod
   $Hidden: 2

MySilencerAttachment won't show up in game until the hidden flag is changed by a script.

scn MyScript

string_var sAux
string_var sWeapID

Begin Function {}

        let sWeapID := GetEditorID WeapNV9mmPistol                   ;Get the editorID of the weapon.
	let sAux := "*_Hidden_" + $sWeapID                           ;Create the aux path.
	AuxiliaryVariableSetFloat $sAux 1 0 MySilencerAttachment     ;Changes the Hidden flag to 1 for MySilencer on WeapNV9mmPistol.        

end

When MyScript is called, the hidden flag for MySilencer will be set to mode 1.

Notes

See Also