BakaSchwarz

  • Content Count

    52
  • Joined

  • Last visited

Community Reputation

32 Excellent

About BakaSchwarz

  • Rank
    Junior Member
...

Recent Profile Visitors

1002 profile views
  1. Ah, okay. In that case you may want to look at playercontroller.lua. You could add your code to the OnLeftClick function like so: AddClassPostConstruct("components/playercontroller", function(self) local oldleftclickfn = self.OnLeftClick self.OnLeftClick = function(self, down) -- Your code here oldleftclickfn(self, down) end end) In your code you check that the currently played character is your character. Get yourself the ThePlayer variable and check its prefab. Does this go in the direction you intended? I am not sure the playercontroller is networked as is though. Never needed to do stuff with it. Maybe someone else can say more about this.
  2. Yeah, seems like a typo. What really grinds my gears is that you always need to restart the whole game when something crashes. A debug mode would be awesome...
  3. With target object, do you mean something like a staff? Not sure i understand your main problem. Could you rephrase?
  4. I wish you the best of luck and don't give up! You can do it if you try long enough. A lot of DST modding (and programming in general) is trying over and over again and debugging errors. It can be frustrating, but it will pay off in the end.
  5. I kinda solved my problem by bypassing it i guess. I had a backup from 12 hours prior to the updates that came in the last 24 hours. Using it made the server show up again. This is strange, though, because no one was on the server in that time until i needed to restart it because of the updates. So is it possible that an update corrupted the save somehow?
  6. Can confirm, i have the same problem. My server is dedicated and runs on linux, mods enabled, caves enabled and mode is endless. If i may add: The server only doesn't show up. It still accepts commands from the console like before.
  7. I also have this exact same problem. Worked yesterday, restarted the server today and now users can not access the caves anymore. The server is modded, though. My log looks mostly the same. Right after a user tries to migrate, the server states CloseConnectionWithReason: ID_DST_SHARD_SILENT_DISCONNECT Host is a Debian Jessie system (64bit) and the server is endless.
  8. I meant changing the mode of an existing world from endless to survival.
  9. When you have clicked on Account in the main menu you select Games in the opening window. There you should see DST listed and a "Servers" Button. There you can generate your tokens.
  10. It's also worth pointing out, that no player can join the server if he/she was in the caves before logging out. My friend could join the server, but i could not, since my last location was in the caves. Some people seem to report that the cave entrance is blocked. This wasn't the case on our server. The entrance was open, but upon trying to use it, the player gets kicked.
  11. This happens with and without any mods. Changing the game mode to survival did not help.
  12. Greetings! I try to get the following to work: I have an item that should have an effect around it. It's an orb and wherever it is, a fog should surround it. So if a player takes the orb, the fog is around the player, if the orb is in a chest, it should surround the chest, etc. I get the entity that has the orb (if any) by calling inst.inventoryitem:GetGrandOwner() In the case of nil, there simply is no owner and i use the coordinates of the orb itself instead. A workaround for backpacks is in the works (as they do not count as GrandOwner when placed on the ground), but that's not the issue here. My problem is, that i do not know how to bind the location of the fog to another entity. As of now, i know the following (not ideal) solutions: 1. Use SetParent to attach the fog to the relevant entity (player, chest, orb, etc.). This is not ideal, because the fog changes directions, when a player turns around, which looks stupid. Also if the player scales (like wolfgang getting mighty) then the fog increases in size as well, which is problematic, because the fog indicates the range in which the orb functions. 2. Use a DoPeriodicTask(0, function) and make use of Transform:SetPosition to set the fog coordinates. This works well if nothing is going on in the world, but if you play with lots of entities, it is often the case, that the fog lags behind the holder of the orb. I don't know of any other way to solve the problem at hand. In the best case it works like SetParent, but it does not scale and changes direction, when the parent does so. Any ideas?
  13. inst is the item to which this code belongs. A void gem. It checks if it is placed inside a container and then tells the container in which it was placed to drop it. owner is the container in which the gem was placed. It is also strange that the code seems to work just fine for guests, but not the host of a server.
  14. Of course. The following contains the code in which the function is called. I cut out some really unnecessary stuff: require "prefabutil" local assets = { Asset("ANIM", "anim/voidgem_build.zip"), Asset("ATLAS", "images/inventoryimages/voidgem_normal.xml"), Asset("IMAGE", "images/inventoryimages/voidgem_normal.tex"), Asset("ATLAS", "images/inventoryimages/voidgem_refined.xml"), Asset("IMAGE", "images/inventoryimages/voidgem_refined.tex"), Asset("ATLAS", "images/inventoryimages/voidgem_purified.xml"), Asset("IMAGE", "images/inventoryimages/voidgem_purified.tex"), } local function buildvoidgem(version) local current_owner = nil local range_indicator = nil local PLACER_SCALE = 1 local function CheckVoidAmount(inst) local amount = 0 return amount end local function TryInsert(inst, item) end local function IsEntityACandidate(owner, candidate) return false end local function RangeIndicator(inst, active) end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("voidgem") inst.AnimState:SetBuild("voidgem_build") if version == "normal" then inst.AnimState:PlayAnimation("idle_normal", true) elseif version == "refined" then inst.AnimState:PlayAnimation("idle_refined", true) elseif version == "purified" then inst.AnimState:PlayAnimation("idle_purified", true) end inst:AddTag("molebait") inst:AddTag("voidresist") inst.entity:SetPristine() RangeIndicator(inst, true) if not TheWorld.ismastersim then return inst end inst:AddComponent("inventoryitem") if version == "normal" then inst.components.inventoryitem.atlasname = "images/inventoryimages/voidgem_normal.xml" elseif version == "refined" then inst.components.inventoryitem.atlasname = "images/inventoryimages/voidgem_refined.xml" inst:AddComponent("container") inst.components.container:WidgetSetup("voidgem_refined") inst.components.container.onopenfn = function () inst.components.inventoryitem.cangoincontainer = false end inst.components.container.onclosefn = function() inst.components.inventoryitem.cangoincontainer = true end elseif version == "purified" then inst.components.inventoryitem.atlasname = "images/inventoryimages/voidgem_purified.xml" inst:AddComponent("container") inst.components.container:WidgetSetup("voidgem_purified") inst.components.container.onopenfn = function () inst.components.inventoryitem.cangoincontainer = false end inst.components.container.onclosefn = function() inst.components.inventoryitem.cangoincontainer = true end end inst.components.inventoryitem:SetOnPutInInventoryFn(function(_, owner) if not owner:HasTag("voidresist") then RangeIndicator(current_owner, false) RangeIndicator(owner, true) current_owner = owner else owner.components.container:DropItem(inst) -- HERE!!! end end) inst.components.inventoryitem:SetOnDroppedFn(function(_, owner) RangeIndicator(current_owner, false) current_owner = nil end) inst:AddComponent("tradable") inst:AddComponent("inspectable") MakeHauntableLaunchAndSmash(inst) return inst end return Prefab("voidgem_"..version, fn, assets) end return buildvoidgem("normal"), buildvoidgem("refined"), buildvoidgem("purified") The widget setup gets overriden in the modmain.lua, where i define my own container: local RECIPETABS = GLOBAL.RECIPETABS local Vector3 = GLOBAL.Vector3 local TECH = GLOBAL.TECH local require = GLOBAL.require containers = require "containers" Assets = { Asset("ATLAS", "images/inventoryimages/voidgem_normal.xml"), Asset("IMAGE", "images/inventoryimages/voidgem_normal.tex"), Asset("ATLAS", "images/inventoryimages/voidgem_refined.xml"), Asset("IMAGE", "images/inventoryimages/voidgem_refined.tex"), Asset("ATLAS", "images/inventoryimages/voidgem_purified.xml"), Asset("IMAGE", "images/inventoryimages/voidgem_purified.tex"), Asset("ANIM", "anim/ui_chest_3x3.zip"), } PrefabFiles = { "voidgem", } -- Container -- local params = {} local old_widgetsetup = containers.widgetsetup function containers.widgetsetup(container, prefab, ...) local t = params[prefab or container.inst.prefab] if t ~= nil then for k, v in pairs(t) do container[k] = v end container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) else old_widgetsetup(container, prefab, ...) end end local function makeVoidGem() container = { widget = { slotpos = {}, animbank = "ui_chest_3x3", animbuild = "ui_chest_3x3", pos = Vector3(0, 200, 0), side_align_tip = 160, }, acceptsstacks = false, type = "chest", } for y = 2, 0, -1 do for x = 0, 2 do table.insert(container.widget.slotpos, Vector3(80 * x - 80 * 2 + 80, 80 * y - 80 * 2 + 80, 0)) end end return container end params.voidgem_refined = makeVoidGem() params.voidgem_purified = makeVoidGem() for k, v in pairs(params) do containers.MAXITEMSLOTS = math.max(containers.MAXITEMSLOTS, v.widget.slotpos ~= nil and #v.widget.slotpos or 0) end AddRecipe("voidgem_normal", {Ingredient("purplegem", 1), Ingredient("nightmarefuel", 2)}, RECIPETABS.MAGIC, TECH.SCIENCE_ONE, nil, nil, nil, nil, nil, "images/inventoryimages/voidgem_normal.xml") AddRecipe("voidgem_refined", {Ingredient("voidgem_normal", 1, "images/inventoryimages/voidgem_normal.xml", "voidgem_normal.tex"), Ingredient("goldnugget", 20)}, RECIPETABS.MAGIC, TECH.SCIENCE_ONE, nil, nil, nil, nil, nil, "images/inventoryimages/voidgem_refined.xml") AddRecipe("voidgem_purified", {Ingredient("voidgem_normal", 1, "images/inventoryimages/voidgem_normal.xml", "voidgem_normal.tex"), Ingredient("opalpreciousgem", 1)}, RECIPETABS.MAGIC, TECH.SCIENCE_ONE, nil, nil, nil, nil, nil, "images/inventoryimages/voidgem_purified.xml")