Search the Community

Showing results for tags 'script'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
  • Don't Starve Together
    • Don't Starve Together FAQ
    • [Don't Starve Together] Developer log
    • [Don't Starve Together] General Discussion
    • [Don't Starve Together] Return of Them
    • [Don't Starve Together] PS4
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Bug Tracker
    • [Don't Starve Together] Trading
    • [Don't Starve Together] Server Bulletin
    • [Don't Starve Together] Dedicated Server Discussion
    • [Don't Starve Together] Mods and Tools
    • [Don't Starve Together] Tales of Life and Death
    • [Don't Starve Together] Suggestions and Feedback
    • [Don't Starve Together] The Forge
    • [Don't Starve Together] The Gorge
    • [Archived Bugs]
  • Hot Lava
    • [Hot Lava Beta] - General Discussion
    • [Hot Lava Beta] - Suggestions and Feedback
    • [Hot Lava Beta] - Bug Tracker
    • [Hot Lava Beta] - Strats and Records
    • [Hot Lava Beta] - Developer Log
    • Hot Lava Beta Latest Update
  • Griftlands
    • [Griftlands] - General Discussion
  • Don't Starve
    • Don't Starve FAQ
    • [Don't Starve: Pocket Edition] iOS / Android
    • [Don't Starve] General Discussion
    • [Don't Starve] Mods and tools
    • [Don't Starve] Art, Music & Lore
    • [Don't Starve] Suggestions and Feedback
    • [Don't Starve] Videos
    • [Don't Starve] Bug Tracker
    • [Don't Starve] Trading
    • [Don't Starve] Testing Discussion (archive)
  • Klei Entertainment Games
    • Eets Munchies
    • [Invisible, Inc.] General Discussion and Strategies
    • Mark of the Ninja
    • Shank
  • Other Stuff
    • The Off-Topic Area
    • Forum Upgrade

Categories

  • Don't Starve
    • Custom Character and Skins
    • Game Modifications
    • Language Packs
    • Modding Tools, Tutorials & Examples
    • Custom Maps

Categories

  • Oxygen Not Included - [Early Access]
  • Don't Starve: Hamlet
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • Don't Starve Together: Return of Them
  • Don't Starve Together: The Gorge
  • Don't Starve Together: The Forge
  • Don't Starve Together: The Forge (Archive)
  • [Don't Starve Together] PS4
  • [Don't Starve Together] Xbox One
  • Don't Starve: Shipwrecked
  • Don't Starve: Shipwrecked [archive]
  • [Don't Starve Together] PS4 (archive)
  • [iOS] Don't Starve: Shipwrecked
  • Don't Starve: Hamlet Closed Beta (ARCHIVE)

Categories

  • Oxygen Not Included - [Early Access]
  • Don't Starve: Hamlet
  • Don't Starve Together
  • [PS4] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Shipwrecked
  • Hot Lava - [Open Beta]

Categories

  • Hot Lava - Beta Reports


Biography


Location


Interests


Occupation


Modder


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Klei Featured Artist


Early Supporter


Early Supporter


Don't Starve


Don't Starve Together


Oxygen Not Included

Found 11 results

  1. I create a character and want to give him the opportunity to teleport for hunger, but if I prescribe it, the hunger is not removed, and it turns out only with sanity. please, help.
  2. I'm somewhat new to modding DST, and I haven't dealt much with host-client communications yet since I haven't needed to, but I do now so I've been looking at examples and searching through the forums but the way components and their replicas should be made is still not clear to me. I examined Kzisor's leveler component and its companion exp widget, as well as some standard game components and random things I found in the mods I have installed, but still. Some use classifieds, some use netvars, some reference the replica in the main component, some don't...I could really use a basic rundown of when you use replicable components as opposed to a regular component added in common_postinit(); when you should use player_classified (and what it even is to begin with); when to use netvars (are the instead of the classified thing?) - and if possible, seeing an example of a simple "Hello world" replicable component would be really great. Thanks in advance. =) P.S. If you're interested in the functional context here, I'm trying to create a "transformer" component to manage all character transformations in my mod. It's basically a state machine with forms and triggers that activate the transitions between them. I'd like to give it an AddTransformation() function that lets you define the transitions as well as the trigger, and, for example, I'd like key press to be one of the options. I really want to encapsulate the entirety of the functionality into the component and its replica. Ideally, the user would simply write something such as transformer:AddTransformation("justme", "superme", transformer.Triggers.OnKey(SOME_KEY)) where transformer is the component or its replica and it will simply work. For that end I made registered an RPC call for all transformations that passes along some transformation ID. Now I need to have the code that performs the transformation to be on the server and the code that listens for a key and invokes the RPC to be on the client, but I don't know what to put where, and how to raise an event on the client when the transformation is done. Thus I come seeking the wisdom of the forum elders.
  3. I would like to make to add to my hat mod perk that makes it fogproof, but simply adding inst:AddTag("fogproof") does not work. Could you help me?
  4. I made a new character and I'd like to override a specific state in its stategraph, but nobody else's (namely, I want to change its funnyidle animation to one of the emotes). I managed to override it for everyone,but I don't know how to override it just for him. I'd rather not copy Wilson's stategraph to a new file, make the modification and then assign that stategraph to him, since that would require updating when Wilson's stategraph changes. Thanks in advance. =)
  5. DST has a module called "util" in its scripts bundle which contains various scripting paraphernalia that one may find useful. I'd like to use the weighted_random_choice() function it has, but when I use require "util" to import the code (currently to my modmain file but I plan on moving it out of there shortly) and then use it, I get an error for invoking a nil value. I know I can copy the function, of course but since it's already there and various game scripts use it, I figure there should be a way to import it into a mod environment as well - or am I wrong? Assistance would be appreciated, like always. =)
  6. I'd like to find a way to make a character refuse to equip certain items (based on tags). I've found examples of this in other mods and posts but in all of them the item is equipped, checked and then unequipped if necessary. I got that working, and if I must then I'll keep that, but I would rather have the character refuse to equip it in the first place. I.e.: When right-clicking the equipment (armor) in the inventory, it will not be equipped at all and the character will say something about it - as opposed to what happens now, where it gets equipped, unequipped and then the characters says something about it. When the equipment is picked up and the character's equip slot is empty, it should go into the inventory without being equipped - as opposed to what happens now, where... (same as above) When equipping would cause a currently-equipped item to be unequipped, I'd like for the currently equipped item to remain equipped. In other words, as I said, the character should refuse to equip it, with the behavior you'd expect when that happens. Similarly, rather than using tags, I'd like to make specific items usable only by specific characters. I'm guessing that'll be similar though. Any ideas or leads would be appreciated. =) Edit: Problem solved; see the bottom part of my own reply below.
  7. I have two different components that I activate one after the other. One uses DoTaskInTime to schedule a task for 30 seconds from now. The other uses DoPeriodicTask to schedule a task to run every 0.1 seconds over a total of 30 seconds. For some reason, the second task finishes all its iterations in 20 seconds instead of 30 like the first one. The periodic task increases a number value in every iteration, from 0 to 1, in increments of 0.1 / 30. When it reaches 1 it stops. This should take 300 iterations, so with an interval of 0.1 it should take 30 seconds in total. Even if the calculations in my code are wrong, it doesn't change the fact that the periodic task occurs too quickly. I put debug printouts right before starting the periodic task, printing the interval, and in the tick function printing the progress. The server log shows 15 prints per second, 1.5 times faster than it should be (which corresponds to the total time being 2/3 of what it should be). If I increase the interval to 0.5 the total time for the periodic task increases to about 27 seconds. I really have no idea what's going on here and how to fix it. Here's the code for the component (not much here, really): -- Fake component for enabling usage of the recharge -- item slot animation from The Forge local Rechargeable = Class(function(self, inst) self.inst = inst self.percent = 1 self.recharge_time = 0 self.interval = 0 end) local function do_recharge(inst, self) self:SetPercent(math.min(1, self:GetPercent() + self.interval / self:GetRechargeTime())) print("[Mod] Percentage: " .. tostring(self:GetPercent())) if self:GetPercent() == 1 then self:StopRecharging() end end function Rechargeable:GetPercent() return self.percent end function Rechargeable:GetRechargeTime() return self.recharge_time end function Rechargeable:SetPercent(percent) self.percent = percent self.inst:PushEvent("rechargechange", { percent = self.percent }) end function Rechargeable:SetInterval(interval) self.interval = interval end function Rechargeable:SetRechargeTime(recharge_time) self.recharge_time = recharge_time self.inst:PushEvent("rechargetimechange", { t = self.recharge_time }) end function Rechargeable:StartRecharging(starting_percentage) if starting_percentage then self:SetPercent(starting_percentage) end print("[Mod] Starting percentage: " .. tostring(self:GetPercent()) .. " ; Inteval: " .. tostring(self.interval)) if self.recharge_task == nil then self.recharge_task = self.inst:DoPeriodicTask(self.interval, do_recharge, nil, self) end end function Rechargeable:StopRecharging() if self.recharge_task ~= nil then self.recharge_task:Cancel() self.recharge_task = nil end end return Rechargeable And here is the relevant debug output: Like I said, 15 prints per second. What's the problem here and how do I make DoPeriodicTask work like I expect? I would have suspected server load but it's working faster than it should. Thanks in advance.
  8. I have some code that updates the durability of an armor (repairs it) in a timed task. It works, but the durability percentage only updates if I unequip it or equip it again. How do I get the item slot to refresh its state? ... Well, actually, I did get this to work by piggybacking on the "fueled" component's event: inst:PushEvent("percentusedchange", { percent = inst.components.armor:GetPercent() }) But that looks like an underhanded trick that only works since the ItemTile widget calls the same SetPercent function for both and doesn't look very closely at the inventory item that pushed the event. I'd be happier if I could just call a "refresh inventory bar" function or something of the same ilk. Thanks in advance. =)
  9. ^This. Seriously.
  10. my scribbles

    hello people I follow the forum a long time,but not write much here today decided to post a picture. (sorry for my english)I could not resist....grows a magnificent bearmy dog ​​paints better than me:highly_amused:the b,w versionwilson loves the water
  11. Bug Submission Please choose a category [Gameplay] Platform SteamVersion Number - Issue title Stuck on thw world creation screen Steps to reproduce create a new test world Describe your issue i stared at the screen for maybe 2 minutes until i thought im going restart it, good news it worked and i can play still felt like it needed to be report just in case other players have the same problem