Willowson Posted February 21, 2015 Share Posted February 21, 2015 As the title states, I need a little help making my character hurt, a.k.a. "do_rain_sparks" much like wx78. I have an idea where the code goes and where it comes from but even still the game crashes upon opening. This is what I've got: willowson.luawillowson_smoke.lua both of which I have placed within the "scripts, prefabs" folder. Any ideas as to why this isn't working? Link to comment Share on other sites More sharing options...
pikafan8 Posted February 22, 2015 Share Posted February 22, 2015 Could you upload your log.txt? Link to comment Share on other sites More sharing options...
Corrosive Posted February 22, 2015 Share Posted February 22, 2015 @Willowson,return MakePlayerCharacter("willowson", prefabs, assets, fn, start_inv, dt)You are passing 1 too many arguments there, but dt hasn't even been defined when its getting passed there. Try removing dt in that line. Link to comment Share on other sites More sharing options...
Mobbstar Posted February 22, 2015 Share Posted February 22, 2015 Making custom characters hurts when you haven't modded before. Feel the pain. Feel it. Okay you can stop. Link to comment Share on other sites More sharing options...
Corrosive Posted February 22, 2015 Share Posted February 22, 2015 You also seem to have copied code from DST, which generally won't play well with DS. Link to comment Share on other sites More sharing options...
Willowson Posted February 24, 2015 Author Share Posted February 24, 2015 Could you upload your log.txt? 0_0 am I supposed to have one of those cause if so, I don't have it? Link to comment Share on other sites More sharing options...
Willowson Posted February 24, 2015 Author Share Posted February 24, 2015 You also seem to have copied code from DST, which generally won't play well with DS.so i would need to find code from DS in order for this to work? Link to comment Share on other sites More sharing options...
Blueberrys Posted February 24, 2015 Share Posted February 24, 2015 0_0 am I supposed to have one of those cause if so, I don't have it? Yes, you do. Link to comment Share on other sites More sharing options...
Willowson Posted February 24, 2015 Author Share Posted February 24, 2015 Could you upload your log.txt? Yes, you do. Ah ok... well I don't see why anyone would want such a long drawn out document but here it islog.txt Link to comment Share on other sites More sharing options...
Blueberrys Posted February 24, 2015 Share Posted February 24, 2015 @Willowson This is why. :b Edit: In your log.willowson/modmain.lua:3: '}' expected (to close '{' at line 1) near '"willowson_smoke"'Check line 3-4, you're missing a closing bracket. Link to comment Share on other sites More sharing options...
Willowson Posted February 24, 2015 Author Share Posted February 24, 2015 @Willowson This is why. :b Edit: In your log.willowson/modmain.lua:3: '}' expected (to close '{' at line 1) near '"willowson_smoke"'Check line 3-4, you're missing a closing bracket.doing that only seems to have crashed the game ;3; maybe I did something wrong? Link to comment Share on other sites More sharing options...
Corrosive Posted February 24, 2015 Share Posted February 24, 2015 so i would need to find code from DS in order for this to work? Yes. Although it's not as simple as just copy/pasting code. Just having a function called "dorainsparks" dosen't actually mean that your character will spark in the rain. That would be like carving a wooden boat and then expecting it to find a body of water and float across it by itself. You'll notice that in the DS version of WX's prefab file, it sets up a PeriodicTask to constantly check for rain:inst:DoPeriodicTask(1/10, function() dorainsparks(inst, 1/10) end)The DST version handles this completely differently in ways that DS doesn't support at all. On a similar note, in willowson_smoke.lua, the code...if not TheWorld.ismastersim then return instendis very DST specific. There is no TheWorld.ismastersim in DS, because all sims are master sims. There's not even a TheWorld. You only have to deal with TheSim. This also has no meaning in DS:inst.entity:AddNetwork() Link to comment Share on other sites More sharing options...
Mobbstar Posted February 24, 2015 Share Posted February 24, 2015 doing that only seems to have crashed the game ;3; maybe I did something wrong? are you missing a comma? , Link to comment Share on other sites More sharing options...
Willowson Posted February 24, 2015 Author Share Posted February 24, 2015 Yes. Although it's not as simple as just copy/pasting code. Just having a function called "dorainsparks" dosen't actually mean that your character will spark in the rain. That would be like carving a wooden boat and then expecting it to find a body of water and float across it by itself. You'll notice that in the DS version of WX's prefab file, it sets up a PeriodicTask to constantly check for rain:inst:DoPeriodicTask(1/10, function() dorainsparks(inst, 1/10) end)The DST version handles this completely differently in ways that DS doesn't support at all. On a similar note, in willowson_smoke.lua, the code...if not TheWorld.ismastersim then return instendis very DST specific. There is no TheWorld.ismastersim in DS, because all sims are master sims. There's not even a TheWorld. You only have to deal with TheSim. This also has no meaning in DS:inst.entity:AddNetwork() Hmm I get your point. For now, I've removed both codes and moved the files until I can find the correct coding for don't starve. I think when I was looking through game files I was maybe in DST folder rather than the DS folder. I'll give my lines another check and see how they turn out. Thanks for letting me know about those, had no clue they were so different. are you missing a comma? ,yes I was. That seemed to have fixed it. I can at least run the mod now. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.