Sha256: c941ac5a5240273c92d87a211069f7b66a7de283fc6306c02829c76ce7b65ce2

Contents?: true

Size: 841 Bytes

Versions: 5

Compression:

Stored size: 841 Bytes

Contents

require 'sso/elements/fmk'

# Creates a new collection
collection = SSO::Elements::Collection.new

# Loads a custom config
collection.load_config!(150)

# Load all elements from file
collection.load_elements!('./lib/sso/elements/samples/elements.data')

# Gets Npc Essence table
npc_essence = collection.table('NpcEssence')

# Gets a random NPC
some_random_npc = npc_essence.find_element_by_id 4850

# Clones the npc into a new one
npc = some_random_npc.clone

# Set new npc custom properties
npc.id = 120031
npc.name = 'Donovan'
npc.item_exchange_service = 0
npc.file_model = 2023
npc.file_icon = 4713
npc.name_prof_prefix = 'Just someone'

# Adds the new npc to the collection
npc_essence.add_element(npc)

# Persists elements into a new file
collection.save!('./lib/sso/elements/samples/new_elements.data')

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sso-elements-fmk-0.1.6 examples/npc_creation.rb
sso-elements-fmk-0.1.5 examples/npc_creation.rb
sso-elements-fmk-0.1.4 examples/npc_creation.rb
sso-elements-fmk-0.1.3 examples/npc_creation.rb
sso-elements-fmk-0.1.2 examples/npc_creation.rb