• Content Count

  • Joined

  • Last visited

Community Reputation

555 Excellent

About Serpens

  • Rank
    Senior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Unfortunately I often do not test code I write on the fly for the forum, sry (while I did test this one, but not in every single situation, eg the one that the character has no eater component already) Of course it must be: inst:AddComponent("eater")
  2. The brain file is not there, because you should never alter orignal game files, if there is another way to achieve the same goal. Most often you only should use modmain.lua, so you will find my changes to the brain within modmain. Simply search for "ShouldKite" in my modmain.lua and you will find that I used the mod-function "AddBrainPostInit("shadowwaxwellbrain", function(brain) ... end) . This is the best way to change an existing brain. I admit, the brain logic is quite complicated to understand, but if you already know how the brain works, you also should be able to change it. Read and try to understand my code for the shadowduelist. (it was my first time dealing with brains, so the code might not be optimal unfortunately, but it works)
  3. do not alter gamefiles directly. Always search for a way to achieve your goal with new files or within modmain.lua. But you can use game files to inform yourself how things work. So in the original woode.lua you will find this code: local start_inv = {} for k, v in pairs(TUNING.GAMEMODE_STARTING_ITEMS) do start_inv[string.lower(k)] = v.WOODIE end This means, that the start inventory is used from TUNING. Which means all you need to do is changing the TUNING value within your modmain.lua. Open the tuning.lua from the gamefiles. Search for GAMEMODE_STARTING_ITEMS and WOODIE (in the DEFAULT section, if you want it for normal games). Now you see how this looks and what is in there (currently only lucy). TUNING is an array/list and it is globally accessable (it is a convention that global variables are writte in capital letters). That means you can access and change it within your modmain.lua. So the following simple line in your modmain.lua should do it: TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.WOODIE = {"lucy","wereitem_beaver","wereitem_goose","wereitem_moose"} -- or even better, use only the following line: GLOBAL.ArrayUnion( TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.WOODIE , {"wereitem_beaver","wereitem_goose","wereitem_moose"} ) The first line directly overwrites the old list with the new list. The other line with ArrayUnion is merging the old list with your new list. The second way is more compatible to changes by the devs, eg. if they decide to add another start item to woodie.
  4. if you can understand written mod code, you could take a look at my mod and the modsetting which is refering to kiting: By default they are kiting if they wear no armor and not kiting if they wear armor.
  5. see here, but expect it to be not working correctly: I already tried to make the house fully working and spent over 500 hours on it (no camparison to what "vagnerdarochasantos" spent on Tropical mod, that is really heavy). But finally I gave up because I even though I already spent that much time, there is still at least twice this time needed to finish it. This is mostly because of the differences between DS and DST. Especially the interior, which is in fact outside of the map, is the most difficult. I tried to rewrite it, to adjust it to DST, but it is a horrible task. (the interior component) So right now I gave up on this and are waiting for the devs of DST to add something similar, so I don't have to "invent the wheel from scratch." edit: If you just need the house, without interior, then it is easy of course and you should find what you are looking for in bakus mod.
  6. look at the script, or is there none? read and understand the script and what function is making him active. You can also take a look at the forge mod in workshop, if/how they made him do sth.
  7. 1) write what the problem was so other with the same problem can read it. 2) Don't overwerite the whole mole prefab file, unless you want your mod be broken everytime the devs change sth within that file. Use AddPrefabPostInit("mole"function(inst) yourcode end) within modmain instead.
  8. see my comment here for an example: but try to think carefully, how you could make your mod compatible to game updates and also other mods (since foodtpye seems to exclusive). Unfortunately, as written in my comment there, I don't have a good idea for that right now.
  9. I will write here some stuff I explained via PM: sceanrio within static_layout, goal is to connect a blocker object for example with an enemy to remove the blocker after the enemy died. Both are placed within a static_layout file: ok, this will make it alot easier. Because within such a layout, you can use so called "scenarios", which are functions, bound to an entity you placed in the layout. I already did this within this mod: There we have in the scrpts/scenarios folder a scenario file called chest_totalrandom.lua, that add random loot to a chest, that was placed via a static_layout. within the static_layout file you use sth like this: objects = { { name = "", type = "chest", shape = "rectangle", x = 312, y = 232, width = 0, height = 0, visible = true, properties = { ["scenario"] = "chest_totalrandom" } }, -- ... The chest_totalrandom.lua need to return 3 functions: return { OnCreate = OnCreate, OnLoad = OnLoad, OnDestroy = OnDestroy } You can define these function within that file. So you can tell the game what should happen with that chest, when it is first created, what happens when the game is loaded and what happens when the chest is destroyed. We should be able to apply the same to eg. "basalt" blocker right now I don't know a really good way how to connect the blocker with the enemy... You could create a global list within modmain (make sure you name it unique) and in OnLoad of the enemy and the blockers you can add their inst to that global list. And OnDestroy of enemy (not sure if this is also called on death, you have to find out. if not you need to do ListenForEvent), you then could look in this global list to find out which blockers are linked to that enemy and do blocket:Remove(), to remove them. Or you could add tags to enemy and blokcer to identify them and use TheSim:FindEntities(x, y, z, radius, nil, nil, {"Tag"}) to find the entities of blockers after the enemy was destroyed. Event Listeners and how to use them: You dont need eventhandler. You only need PushEvent, if you want to create your own event, most of the time this is not needed. ListeForEvent listens for any PushEvent. Simply search the game code for "PushEvent" and you will find plenty results. These commands are always executed on an instance, so eg. inst:ListenForEvent("death",OnDeath). This Listener will call the local OnDeath function that you define within your script, as soon anyone does inst:PushEvent("death") for this inst. When you search for inst:PushEvent("death" (without the closing paranthese) you will find it most likely within the health component I guess. And you also will see what information is passed along for example: inst:PushEvent("death", { cause = cause, afflicter = afflicter }). Your OnDeath function, that is called from your ListenForEvent, will always get the inst, and any additional data that was given to Pushevent, usually all within one table. So your OnDeath funciton could look like this: local function OnDeath(inst,data) if data~=nil then local killer = data.afflicter print(tostring(killer).." killed "..tostring(inst)) end end The same applies to all other events. So first of all clarify on what kind of event you want to be notified. Then either search the relevant component or any other code for PushEvent, if there is already such a PushEvent, you could use. or use the script-wide notepad++ search for all PushEvent and see if you find one you can use. In 99% of the cases you will find one and then you only need to add a listener inst:ListenForEvent for this within your modmain (or scenario).
  10. yes.... but I think AddPrefabPostInit is only executed at server... So maybe try PlayerPostInit instead and check for inst.prefab=="wathgrithr". Please test if it works
  11. guess like this: inst.AnimState:AddOverrideBuild("wathgrithr_sing") inst.AnimState:AddOverrideBuild("player_idles_wathgrithr") inst.customidleanim = "idle_wathgrithr" (see wigrfid game file)
  12. when I look at the stategraphs , it seems it should be enough to do "inst.customidleanim = nil" within AddPrefabPostInit("wathgrithr"... Unless the devs deleted their old animation.
  13. ask the mod author. most likeyl that mod is not functional anymore. (or incompatible to other mods you use)
  14. just skimmed through these old comments: My adventure mod meanwhile a sort of a framework, you can add your own worlds to it easily (at least if you know how to create a custom world, rooms,tasks,set_peices...)