Not sure if I exactly understand, what you mean.
You want to have the definition and/or the list of available shop items in a seperate file?
It will probably be easier if you tell us what your intention is.
Well, my intension is this: If I can put shop table outside of main dat file, then I can probably manage it for more then one player.
I'm not sure, if there is a way to include an external file into a running game. And your idea would mean in addition, that the game makes an online connection to look into a file somewhere in a cloud or so. I doubt, that this is possible.Cerv wrote: ↑Mon Feb 22, 2021 9:50 am Well, my intension is this: If I can put shop table outside of main dat file, then I can probably manage it for more then one player.
for example if more players will buy or sell one thing frequentaly then price will come up or down, and more plain example if some one sell item then it can appear in all others shop, till someone else buy it again...
well very simple economics...
Code: Select all
defineObject{
name = "machinegun",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/repeater.fbx",
material = "machinegun",
},
{
class = "Item",
uiName = "Machine Gun MK1",
description = "A crude but effective Dwarvish firearm. Also known as the \"Dwarvish Nightmare\" for its ability to fire bullets in very quick bursts.",
gfxAtlas = "mod_assets/textures/oliveitem.tga",
gfxIndex = 25,
gfxIndexPowerAttack = 97,
impactSound = "impact_blunt",
weight = 4.0,
secondaryAction = "reload_weapon",
traits = { "firearm", "rifle", "modern" },
onUnequipItem = function(self,champion,slot)
party.riflemanScript.weaponUnequip(self,champion,slot)
end,
},
{
class = "FirearmAttack",
attackPower = 40,
pierce = 30,
cooldown = 6,
-- attackSound = "gun_shot_small",
attackSound = "machinegun2",
clipSize = 80,
ammo = "bullet",
repeatCount = 10,
repeatDelay = 0.08,
jamChance = 15,
requirements = { "firearms", 3 , "modernweapon", 1},
range = 20,
},
{
class = "ReloadFirearm",
uiName = "Reload",
name = "reload_weapon",
requirements = { "modernweapon", 1 },
gameEffect = "Reloads the weapon with 80 bullets."
},
},
}
Code: Select all
defineObject{
name = "ghost_blocker_party",
components = {
{
class = "Obstacle",
hitSound = "impact_punch",
hitEffect = "hit_wood",
blockParty = true,
blockItems = true,
blockMonsters = false,
},
{
class = "ProjectileCollider",
size = vec(3, 3, 3),
},
-- {
-- class = "Controller",
-- onActivate = function(self)
-- self.go.obstacle:enable()
-- self.go.projectilecollider:enable()
-- end,
-- onDeactivate = function(self)
-- self.go.projectilecollider:disable()
-- self.go.obstacle:disable()
-- end,
-- onToggle = function(self)
-- if self.go.obstacle:isEnabled() then
-- self.go.obstacle:disable()
-- else
-- self.go.obstacle:enable()
-- end
-- end,
-- },
},
tags = { "scripting" },
placement = "floor",
editorIcon = 96,
minimalSaveState = true,
}