Yabumi

Registered Users
  • Content count

    19
  • Joined

  • Last visited

Community Reputation

2 Neutral

About Yabumi

  • Rank
    Junior Member
  1. If you try running the autocompiler through command prompt, you can see if there were any errors rather than having it just close instantly. Your anim files shouldn't be .rar; they should be .zip. The autocompiler only compiles things in your exported folder, so you should have everything in folders there similar to this structure: http://prntscr.com/g1wkll
  2. Problem with autocompiler

    I checked my own mod_tools folder and I had an scml.exe in there. You should probably try reinstalling your mod tools.
  3. Better late than never? Where did you put the code for this? It should look something like... local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua") } local start_inv = { "customitem" } local function common_postinint(inst) ... end local function master_postinit(inst) ... end return MakePlayerCharacter("character_name", prefabs, assets, common_postinit, master_postinit, start_inv)
  4. I need help with perks

    I don't know what you mean by being cold all the time. Do you mean they lose heat constantly if not near a fire? Here's a mod that does the sanity thing with players: https://steamcommunity.com/sharedfiles/filedetails/?id=721491336 What I think might work for selective sanity multiplying is to put a sanity aura on your character and have it check whether an observer is a spider (inst:HasTag("spider")).
  5. Are you saying you want it to have an "aura" effect which damages trees within range? If so, the game's aura should be good enough if you make it decrease health on anything with a "tree" tag (I think that's the tag). Just make the chainsaw add the aura on equip and remove it on unequip. If you mean doing it via click action, then you can use a time check (last_damaged or something) with a custom action bound to the mouse. This would involve an action, a component action and a stategraph. The actual behavior for the cutting would then be placed in a component that's assigned to your chainsaw.
  6. The game should automatically recompile all your stuff on loading if you delete the old anim files, so you should be able to get past this problem as long as you're on Windows and delete (or move if you don't want to accidentally be left without a back-up) your old anim files.
  7. Did you delete your character's file in the anim folder before recompiling? Are you absolutely certain you've replaced the files and don't have it open from some other location in your viewer? If, for example, you can delete the anim file and still load, you may be accessing a copy of the mod that you inadvertently made.
  8. [help]how can i understand this code!?

    As I understand it, the function "_Inject" takes 3 parameters: the component to modify, a function name which will be associated with and the function to associate. It then writes the function to Component[function_name]. This works because objects in Lua are in fact tables, meaning that even the functions that comprise them are simply entries in a table. In the code you posted, the _Inject function is overwriting the "GetDisplayName" function which is originally defined in scripts/entityscript.lua. If you were to replace the variables, it looks like this for that single execution: local function _Inject(comp, fn_name, fn) local old = GLOBAL.EntityScript["GetDisplayName"] GLOBAL.EntityScript["GetDisplayName"] = function(self, ...) local res = old(self, ...) return fn(res, self, ...) end end Where "fn" is defined in the call to the function: _Inject(GLOBAL.EntityScript, "GetDisplayName", function(name, self) -- Specifically, this function defined right here ... return name end)
  9. Mod sorunu

    From Google Translate: I'm not sure what he's saying though.
  10. @FashionablyRin If you're using the Extended Sample Character template, then you have the common_postinit and master_postinit functions in the scripts/prefabs/esctemplate.lua file. The former runs for both the client and server BEFORE any of the components are added and the latter runs only for the server AFTER all the components are loaded (see scripts/player_common.lua for the exact code).
  11. Sorry about that. I should've put a disclaimer that I hadn't tested it. This one I did test (attached file). It probably has a __MACOSX folder in it but you can ignore that since it does nothing on Windows. scripts.zip local common_postinit = function(inst) inst.MiniMapEntity:SetIcon( "esctemplate.tex" ) inst:AddTag("pickyeater") end local master_postinit = function(inst) inst.soundsname = "willow" inst.components.health:SetMaxHealth(150) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(200) inst.components.combat.damagemultiplier = 1 inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload inst.components.eater.PrefersToEat = function(self, inst) --V2C: fruitcake hack. see how long this code stays untouched - _-" return not (inst.prefab == "winter_food4" and self.inst:HasTag("player")) and self:TestFood(inst, self.preferseating) and not (self.inst:HasTag("pickyeater") and ((inst.components.perishable:IsStale() or inst.components.perishable:IsSpoiled()) or inst.prefab == "monstermeat" or inst.prefab == "cookedmonstermeat" or inst.prefab == "monsterlasagna" or inst.prefab == "monstermeat_dried" or (inst:HasTag("edible_MEAT") and inst:HasTag("cookable")))) end end
  12. I got the dash working. It had a few weird issues that I didn't notice when I first wrote this thread...and I apparently was really close to having it done correctly at that point. For the record, this is how I did it in the end: -- In modmain.lua local function RPCTeleport(player, x, y, z) player.Physics:Teleport(x, y, z) end AddModRPCHandler(modname, "RPCTeleport", RPCTeleport) local function OnDashed(inst, data) local x, y, z = data.pt:Get() SendModRPCToServer(MOD_RPC[modname]["RPCTeleport"], x, y, z) end AddPlayerPostInit(function(inst) if not TheWorld.ismastersim then inst:ListenForEvent("dashed", OnDashed) end end) -- In dasher.lua self.inst:PushEvent("dashed", { ["pt"] = pt }) It's not said directly, but it would appear that RPCs silently fail (with regards to the in-game console) if you send them a custom data type (Vector3 in this case). A big thank you to ZupaleX for all your help. Now I just have to figure out how to make it work for nightvision.
  13. I did do this before I posted the thread. The problem was that I was getting nothing printed in the server logs that even indicated that the RPC had been run at all. Here is in-game: http://prntscr.com/fwksw8 Here is the server log after disconnecting: [00:00:21]: New incoming connection 127.0.0.1|56980 <13598583758756611349> [00:00:21]: Client connected from [LAN] 127.0.0.1|56980 <13598583758756611349> [00:00:21]: ValidateGameSessionToken pgs-usc^KU_2DNgIYVr^DontStarveTogether^pKP3figVY24xDabhgZExC8/GO4nwxeQugbq5WjWAlSA= for <13598583758756611349> [00:00:21]: Client authenticated: (KU_2DNgIYVr) 保登 心愛 [00:00:21]: [Steam] Authenticated host '76561198057306696' [00:00:22]: [Shard] Read save location file for (KU_2DNgIYVr) [00:00:33]: Resuming user: session/6DA1AAC62AB5194B/A7G8QNL4K9VL/0000000027 [00:00:33]: Spawning player at: [Load] (83.00, 0.00, -73.51) [00:00:33]: Sim unpaused [00:01:15]: [Steam] SendUserDisconnect for '76561198057306696' [00:01:15]: [Shard] (KU_2DNgIYVr) disconnected from [SHDMASTER](1) [00:01:15]: [IPC] Received shutdown signal. [00:01:15]: Serializing user: session/6DA1AAC62AB5194B/A7G8QNL4K9VL/0000000028 [00:01:15]: Serializing world: session/6DA1AAC62AB5194B/0000000028 [00:01:15]: Truncating to snapshot #28... [00:01:15]: - session/6DA1AAC62AB5194B/0000000022 [00:01:15]: - session/6DA1AAC62AB5194B/A7G8QNL4K9VL/0000000022 [00:01:15]: 2 file(s) removed [00:01:15]: unloading prefabs for mod MOD_workshop-375850593 [00:01:15]: unloading prefabs for mod MOD_workshop-709198071 [00:01:15]: unloading prefabs for mod MOD_workshop-347079953 [00:01:15]: unloading prefabs for mod MOD_workshop-666155465 [00:01:15]: unloading prefabs for mod MOD_sendai [00:01:15]: unloading prefabs for mod MOD_workshop-356930882 [00:01:15]: unloading prefabs for mod MOD_workshop-898070061 [00:01:15]: unloading prefabs for mod MOD_workshop-378160973 [00:01:16]: [Shard] Stopping shard mode [00:01:16]: Collecting garbage... [00:01:16]: lua_gc took 0.21 seconds [00:01:16]: ~ShardLuaProxy() [00:01:16]: ~ItemServerLuaProxy() [00:01:16]: ~InventoryLuaProxy() [00:01:16]: ~NetworkLuaProxy() [00:01:16]: ~SimLuaProxy() [00:01:17]: lua_close took 0.47 seconds [00:01:17]: Manager - ORPHANED UNKNOWN RESOURCES: [00:01:17]: shaders/ui_yuv.ksh - 1 [00:01:17]: CurlRequestManager::ClientThread::Main() complete [00:01:17]: HttpClient2 discarded 0 callbacks. [00:01:17]: Shutting down I only included from the connection to the end. Here are the lines I have in the files atm: local function RPCTeleport(player, pt, caster) print("SERVER RECEIVED THE RPC WITH VALUES:") print(player) print(pt) print(caster) caster.Physics:Teleport(pt:Get()) print("SERVER EXECUTED THE TELEPORT") end AddModRPCHandler(modname, "RPCTeleport", RPCTeleport) local function OnDashed(inst, data) print("SENDING RPC TO SERVER WITH DATA:") print(inst) print(data.pt) print(data.caster) SendModRPCToServer(MOD_RPC[modname]["RPCTeleport"], data.pt, data.caster) print("RPC SENT TO SERVER") end EDIT: I popped open the client_log.txt file after expecting it to look the same and instead found a line that's different. I can't find the error anywhere in the networkclientrpc.lua file though (or in any other file for that case). [00:00:50]: SENDING RPC TO SERVER WITH DATA: [00:00:50]: 100035 - sendai [00:00:50]: (80.24, 0.00, -66.70) [00:00:50]: 100035 - sendai [00:00:50]: Invalid RPC data type <--- This right here [00:00:50]: RPC SENT TO SERVER
  14. Hyperactive actions

    If you look at the function that does the work, it does the check for tool effectiveness before the check for the worker effectiveness, which is why you can't use it as a player unless you're slapping stuff barehanded. If your hunch doesn't work out, you could set the tool effectiveness by listening for the "equipped" and "unequipped" events (so you can't just drop the thing after putting it on once and have other people with boosted tools). function Tool:GetEffectiveness(action) return self.actions[action] or 0 end -- So use something like this in your onequip (this is for an axe, for example) local function onequipped(inst, data) inst.components.tool:SetAction(ACTIONS.CHOP, 2) end EDIT: Actually, I think I'm still missing the point, so nevermind me unless I got it right :/
  15. I'll check that out right now. EDIT: It looks like it's all done via the stategraph. I originally skipped over that option because I don't have an action that utilizes any of the 5 (ie. SCENE, USEITEM, POINT, EQUIPPED or INVENTORY), so I don't think I can add to the actions table.