CarlZalph

  • Content count

    1,276
  • Joined

  • Last visited

Community Reputation

2,139 Excellent

About CarlZalph

  • Rank
    Mastermind

Badges

Visited by the Title Fairy
  • Visited by the Title Fairy
    Mastermind

Recent Profile Visitors

9,184 profile views
  1. Common items are turned into chests, anything above it aren't.
  2. After a great length of a game of chess against the computer, it has been determined that: Servers using a modified tick rate variable of 30 may result in some players being unable to move when the client has movement prediction off. To fix this, change it to the default of 15 or 60. I can personally attest to the server that I tested this on that these values function fine when the value 30 caused things to break on my client's side (100% consistently break). The client will experience weird symptoms on your server such as: Birds floating in the air Butterflies not leaving their spawn flowers Players not moving at all Huge "desync" from their player and anything that moves No movement at all if prediction is disabled This may be a result of the client also having netbook mode on which locks their framerate to 30- I suspect it's locking the tick rate somewhere. I have notified PeterA on this in a Steam PM, so perhaps he or someone there at Klei will check into it. In the meantime, I'd highly advise keeping the tick rate away from 30.
  3. Those functions by themselves don't dictate whether or not it must be enforced onto clients. For instance, say your mod adds a component to a prefab via the prefabpostinit. This component would probably only exist on the server side, but not always. There are client only components that shouldn't exist on the server at all. The most important question to determine whether or not everyone needs the mod or if it's just server or just client is the data transference. If the thing being changed exists only on the server, then it'd be a server only. If at any point the data is both on the client and server and it's assumed to be the same, then it should be on both to have both sides update. If it's only aesthetical or is a functional thing by sending a series of desired inputs to the server, then it could exist as only a client mod.
  4. In your character's postinit. If you want him to immediately start/spawn with it, also include the night vision thing turning on in the post init. inst:ListenForEvent( "sanitydelta", function(data) if data then if data.newpercent > 0.7 and data.oldpercent <= 0.7 then inst.components.playervision:ForceNightVision(true) elseif data.newpercent <= 0.7 and data.oldpercent > 0.7 then inst.components.playervision:ForceNightVision(false) end end end )
  5. Currently there exists no such function directly. However, the entity's debug string contains the currently running animation and this is one way on how to parse it out: function GetCurrentAnimation(input) return string.match(input.entity:GetDebugString(), "anim: ([^ ]+) ") end This function may return nil if nothing is found.
  6. Double verify that the preview image file path is correct. I believe the uploader defaults to using a .jpg, when a lot of people use .png.
  7. Stopping a inst:ListenForEvent

    From abigail_flower.lua: local function activate(inst) inst.SoundEmitter:PlaySound("dontstarve/common/haunted_flower_LP", "loop") inst:ListenForEvent("entity_death", inst._onentitydeath, TheWorld) end local function deactivate(inst) inst.SoundEmitter:KillAllSounds() inst:RemoveEventCallback("entity_death", inst._onentitydeath, TheWorld) end So for your oneat you would make that function callback a local function somewhere, then listen/remove it. local function event_oneat(inst, data) if data.food and data.food.components.edible and data.food.components.edible.foodtype and data.food.prefab == "poopypill" then inst:ListenForEvent("hungerdelta", onhungerchange) end end inst:ListenForEvent("oneat", event_oneat) inst:RemoveEventCallback("oneat", event_oneat) This is an example, so adapt it to your use case of the other event.
  8. rewrite mainfunction

    @Spanden You've left out function argument parameters. function newSetPause(...) + oldSetPause(...) If you want to know the arguments and to future proof it: function newSetPause(val, reason, ...) + oldSetPause(val, reason, ...) The three dots for an argument means in LUA: "There are any amount of additional arguments here, please handle all of them for me." It can only exist as the last argument in a function declaration.
  9. I got participator :'(

    Asking Wes to inspect anything results in a bicycle motion and some hand waving. It's all code to mean something else entirely. Never trust a clown party, I say.
  10. Formula: UseScale = sqrt(DesiredScale * 300 / TextureSize) For use with: inst.AnimState:SetOrientation(ANIM_ORIENTATION.OnGround); inst.Transform:SetScale(scale, scale, scale) Purpose: Having ground textures centered on an entity scale exactly in size with in-game units rather than a seemingly arbitrary scale factor. Say you have a texture of a circle that is 512x512 pixels for its base image that has a spriter animation of it being centered. You want this to be exactly 28 units in-game. 28 units is 7 turfs side-by-side. sqrt(28 * 300 / 512) = 4.050462936504912 inst.Transform:SetScale(4.050462936504912, 4.050462936504912, 4.050462936504912) The firesuppressor_placer has an internal texture size of 1900x1900 pixels, so use 1900 for its TextureSize as an example. Note that the scale done will make it render the edge of the texture to that scale setting, so if you have a dotted line and you wanted the dot to be over the radius, add a small fluff factor to your DesiredScale to include it. Double note that if the texture is parented to an entity then you must remove the parent's scale factor from the desired as all parent scales are inherited to its children. local s1, s2, s3 = parent.Transform:GetScale() child.Transform:SetScale(scale/s1, scale/s2, scale/s3)
  11. Carry over strings from DST I think. In DST items smoulder before catching fire, and you can extinguish them before they do by taking some damage. The character says these strings then.