Developer Cheerio Posted November 9, 2013 Developer Share Posted November 9, 2013 @Cheerio Two question:First: What I wrote in the post above this : PSecond: Is there any workaround to the unclickable entities when compiled from Spriter. I'm currently dealing with an entity that has no clickable area whatsoever, not even a small one. And that makes it whole unhealthy to troubleshoot for what I want to do. I'm fine with it having a rectangular clickable area around the bounding box or so of that is a possiblity at all.Right now the Spriter exporter only gives the same small clickable area no matter what it exports. This is something I'm going to fix once the port is done. If you can't click your object at all, it might actually be because you're missing a component, but if you upload something for me to check out, I can take a look. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-365398 Share on other sites More sharing options...
Malacath Posted November 9, 2013 Share Posted November 9, 2013 (edited) Right now the Spriter exporter only gives the same small clickable area no matter what it exports. This is something I'm going to fix once the port is done. If you can't click your object at all, it might actually be because you're missing a component, but if you upload something for me to check out, I can take a look.Here you go. The prefab in question is "merchant" and it has multiple components which should add an action (one of which is the thing I'm trying to troubleshoot)Thanks ^^EDIT: Woah, I actually managed right now to activate it. It is only a single pixel which I so easily missed. That would add another question. How can I make my custom action activatable by the spacebar? 'cause that would make troubleshooting a lot easier. Edited November 9, 2013 by Malacath Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-365408 Share on other sites More sharing options...
Stealthic Posted November 10, 2013 Share Posted November 10, 2013 (edited) I added Wendy's skirt . sample_dude.zip winter_skirt.jpgThank you so much, Cheerio. I got everything working now, but I just have a few questions.Is it too late to ask if you can include Wilson's hair again? I'd love to make the bow bounce seperate so everything on her head doesn't look so stationary. And now when I decrease the resolution down to 512x256, everything is smaller than before. If it's something that can't be really changed after Wilson's hair is included, that is totally fine! I'm just trying to polish this all up as much as possible. After this, everything should be done as far as in game art goes. Edit: Actually, one more thing..Is it possible to make the hair from the back overlap everything else? (except bow) Edited November 10, 2013 by Stealthic Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-365936 Share on other sites More sharing options...
Malacath Posted November 10, 2013 Share Posted November 10, 2013 I have another question about adding a custom action, those are my bane... I have the following codeACTIONS = _G.ACTIONSACTIONS.TRADE = _G.Action(3)ACTIONS.TRADE.str = "Trade with"ACTIONS.TRADE.id = "TRADE"ACTIONS.TRADE.fn = function(act) print("Check target") if act.target.components.shopkeeper and act.target.components.shopkeeper.doestrade then print("Do trading") act.doer.components.talker:Say(_G.GetString(act.doer.prefab, "INTRODUCE_SHOP")) act.target.components.shopkeeper:InitiateTrade(act.doer) end return trueendACTIONS.TRADE.distance = 10Now there's a few problems. First off the custom String doesn't work, it just says "Action". Secondly the function(act) never fires. But I know at least that this action works in so far as I can use an ActionHandler to put the player into the desired state.AddStategraphActionHandler("wilson", _G.ActionHandler(ACTIONS.TRADE, "trade"))I'm 90% sure that I'm once again missing something obvious but I can't crack it... Edit: Actually, one more thing..Is it possible to make the hair from the back overlap everything else? (except bow)Maybe you could try putting her hair instead of Wilsons hair. I believe it should overlap the reat as you like and might also add a bit more of a dynamic feel. Or it will go horribly wrong... Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366017 Share on other sites More sharing options...
simplex Posted November 10, 2013 Share Posted November 10, 2013 (edited) @MalacathTrylocal TradeAction = _G.Action(3)TradeAction.str = "Trade with"TradeAction.id = "TRADE"TradeAction.fn = function(act) print("Check target") if act.target.components.shopkeeper and act.target.components.shopkeeper.doestrade then print("Do trading") act.doer.components.talker:Say(_G.GetString(act.doer.prefab, "INTRODUCE_SHOP")) act.target.components.shopkeeper:InitiateTrade(act.doer) end return trueendTradeAction.distance = 10AddAction(TradeAction)I wrote a simpe action for the link mod (DropSingle), which may be useful for comparison, but I did precisely the above.You are returning the action in the shopkeeper component, within one of the Collect*Actions methods, right? Edited November 10, 2013 by simplex Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366039 Share on other sites More sharing options...
Neosaurus Posted November 10, 2013 Share Posted November 10, 2013 This may seems off-topic, but is Ipsquiggle dead or something? Cheerio, you're great and theres nothign wrong with you but I'm just wondering what happened to Ipsquiggle Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366057 Share on other sites More sharing options...
Malacath Posted November 10, 2013 Share Posted November 10, 2013 (edited) @MalacathTryI wrote a simpe action for the link mod (DropSingle), which may be useful for comparison, but I did precisely the above.You are returning the action in the shopkeeper component, within one of the Collect*Actions methods, right?local TradeAction = _G.Action(3)TradeAction.str = "Trade with"TradeAction.id = "TRADE"TradeAction.fn = function(act) print("Check target") if act.target.components.shopkeeper and act.target.components.shopkeeper.doestrade then print("Do trading") act.doer.components.talker:Say(_G.GetString(act.doer.prefab, "INTRODUCE_SHOP")) act.target.components.shopkeeper:InitiateTrade(act.doer) end return trueendTradeAction.distance = 10AddAction(TradeAction)I didn't know there was a function to add actions. This fixed the naming issue but the fn never fires anyways.And yes (and no) I'm not returning the action exactlyfunction Shopkeeper:CollectSceneActions(doer, actions) if doer == GetPlayer() then table.insert(actions, ACTIONS.TRADE) endendBut that's not the problem anyways. I get the String "Trade with Shopkeeper" just like I want so there's a definit difference from my attempt. I'll go and tak a look at Link now. This may seems off-topic, but is Ipsquiggle dead or something? Cheerio, you're great and theres nothign wrong with you but I'm just wondering what happened to IpsquiggleThey just switched. Ipsqiggle was in charge of the modding community and it is understandable that he wanted to take a break and get back to full time development. He didn't actually say something like that but I just guess that it was the motivation behind the change. And sometime in the future we will probably loose Cheerio as well... Edited November 10, 2013 by Malacath Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366068 Share on other sites More sharing options...
Neosaurus Posted November 10, 2013 Share Posted November 10, 2013 They just switched. Ipsqiggle was in charge of the modding community and it is understandable that he wanted to take a break and get back to full time development. He didn't actually say something like that but I just guess that it was the motivation behind the change. And sometime in the future we will probably loose Cheerio as well... Then there will be eternal sadness Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366069 Share on other sites More sharing options...
Malacath Posted November 10, 2013 Share Posted November 10, 2013 So this code still doesn't worklocal Trade = _G.Action(3)Trade.str = "Trade with"Trade.id = "TRADE"Trade.distance = 10Trade.fn = function(act) print("Check target") if act.target.components.shopkeeper and act.target.components.shopkeeper.doestrade then print("Do trading") act.doer.components.talker:Say(_G.GetString(act.doer.prefab, "INTRODUCE_SHOP")) act.target.components.shopkeeper:InitiateTrade(act.doer) end return trueendAddAction(Trade)Any help would be appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366213 Share on other sites More sharing options...
Developer Cheerio Posted November 10, 2013 Developer Share Posted November 10, 2013 Thank you so much, Cheerio. I got everything working now, but I just have a few questions.Is it too late to ask if you can include Wilson's hair again? I'd love to make the bow bounce seperate so everything on her head doesn't look so stationary. And now when I decrease the resolution down to 512x256, everything is smaller than before. If it's something that can't be really changed after Wilson's hair is included, that is totally fine! I'm just trying to polish this all up as much as possible. After this, everything should be done as far as in game art goes. Edit: Actually, one more thing..Is it possible to make the hair from the back overlap everything else? (except bow)Would it be possible to upload what you have so far? Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366256 Share on other sites More sharing options...
simplex Posted November 10, 2013 Share Posted November 10, 2013 And sometime in the future we will probably loose Cheerio as well... Could you upload the mod? Because the snippet itself seems fine. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366259 Share on other sites More sharing options...
Malacath Posted November 10, 2013 Share Posted November 10, 2013 Could you upload the mod? Because the snippet itself seems fine.Sure thing sir, here you go. 1 Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366267 Share on other sites More sharing options...
simplex Posted November 10, 2013 Share Posted November 10, 2013 Sure thing sir, here you go. You get a like for using 7z compression. ;P I'll take a look at it. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366272 Share on other sites More sharing options...
CycloneSP Posted November 10, 2013 Share Posted November 10, 2013 hey guys, I've just recently started working on a mod to modify NightLights, and after some successful experiments, I've run into a problem. See, I current have it so that when I approach the nightlight when it is off, it will fuel itself. But I want to make it cost some sanity to do so. how would I do that? Here is the snippet that causes the nightlight to turn on:local function updatelight(inst) if inst.components.playerprox:IsPlayerClose() and inst.components.fueled:IsEmpty() then inst.components.fueled:InitializeFuelLevel(120) endendI tried using observer.components.sanity:DoDelta(-TUNING.SMALL_SANITY) but it came up with an error. I'm still really new to all this so I've just been feeling my way through for the moment. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366394 Share on other sites More sharing options...
Malacath Posted November 10, 2013 Share Posted November 10, 2013 I tried using observer.components.sanity:DoDelta(-TUNING.SMALL_SANITY) but it came up with an error. I'm still really new to all this so I've just been feeling my way through for the moment.The problem is, that there is no observer variable defined. But sinde it's only dealing with the player coming close you can simply take the sanity off the player like soGetPlayer().components.sanity:DoDelta(-TUNING.SANITY_TINY)You get a like for using 7z compression. ;PYippie Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366398 Share on other sites More sharing options...
simplex Posted November 10, 2013 Share Posted November 10, 2013 @MalacathIt took quite a bit of tracking how things get juggled around among playeractionpicker.lua, playercontroller.lua, locomotor.lua, entityscript.lua and stategraph.lua, but I figured out the issue (which is quite simple): an action is not performed by default, the stategraph handler has to callinst:PerformBufferedAction()somewhere. So it's up to you to put this inside the onenter callback, in the timeout or in a time frame, but it must be there somewhere.Also, consider referring to the action as TradeAction in the AddStategraphActionHandler call, to make it easier to tweak its id. And consider changing its id, since TRADE is way too common of a name, so you may clash with other mods along the way ;P. 2 Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366411 Share on other sites More sharing options...
Malacath Posted November 10, 2013 Share Posted November 10, 2013 (edited) @MalacathIt took quite a bit of tracking how things get juggled around among playeractionpicker.lua, playercontroller.lua, locomotor.lua, entityscript.lua and stategraph.lua, but I figured out the issue (which is quite simple): an action is not performed by default, the stategraph handler has to callsomewhere. So it's up to you to put this inside the onenter callback, in the timeout or in a time frame, but it must be there somewhere.Also, consider referring to the action as TradeAction in the AddStategraphActionHandler call, to make it easier to tweak its id. And consider changing its id, since TRADE is way too common of a name, so you may clash with other mods along the way ;P.inst:PerformBufferedAction()Oh my god -_- Thank you a giant bunch for tracking down this problem! I should've notice when looking through all the stategraphs I just didn't consider the stategraph was involved in calling that function. But it actually makes things a lot easier for me this way ^^You're the best! And yes, I'll probably change a bunch of names later on. But it's early in development and I'm not yet thinking about implications with other mods.Thank you! Edited November 10, 2013 by Malacath Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366415 Share on other sites More sharing options...
CycloneSP Posted November 10, 2013 Share Posted November 10, 2013 (edited) Ah, thx malacath. I'll be sure to try that out as soon as I am able. And yeah, I know the sample I gave you doesn't have observer defined, but I did try(poorly most likely) to define it in one of my attempts. I think it looked something like: local function updatelight(inst, observer) but I still ran into problems. perhaps observer was just the wrong approach? EDIT: okay, so I was able to try out your suggestion, and it works perfectly. Thanks a lot man. Edited November 11, 2013 by CycloneSP Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366540 Share on other sites More sharing options...
seronis Posted November 11, 2013 Share Posted November 11, 2013 Just wanna say that even though I havent gotten around to doing anything nearly as complex as you guys do, being able to read these discussions and solutions has really helped me with following the code flow and to understand LUA itself. So thanks Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366775 Share on other sites More sharing options...
CycloneSP Posted November 11, 2013 Share Posted November 11, 2013 (edited) sigh, with one problem solved, another takes it's place. I'm trying to set it up so I have a mod icon in the mod screen. I have a tex file and an xml file. I even have icon_atlas = "Insanillumination.xml"icon = "Insanillumination.tex"in my modinfo.lua file. But every time I try to access the mod screen, it crashes. What am I doing wrong? EDIT: Never mind! I found out what the problem was. apparently xml files are much like html files in that they don't seem to want to work right if you don't close out all your tags properly with '/'. Well, now don't I feel stupid. Edited November 11, 2013 by CycloneSP Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366822 Share on other sites More sharing options...
Stealthic Posted November 11, 2013 Share Posted November 11, 2013 Would it be possible to upload what you have so far?The only things I really changed were the atlas. D: But no problem.sample_dude.zip Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366851 Share on other sites More sharing options...
Developer Cheerio Posted November 11, 2013 Developer Share Posted November 11, 2013 This may seems off-topic, but is Ipsquiggle dead or something? Cheerio, you're great and theres nothign wrong with you but I'm just wondering what happened to IpsquiggleLpsquiggle is still at Klei and I often consult with him on how he intended the modding framework to work. Since finishing the Screecher mod, he's moved on to some cool new stuff I can't really talk about . And even if one day I do move on, I know that Simplex is a lifer and that you're all in good hands . Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366871 Share on other sites More sharing options...
Developer Cheerio Posted November 11, 2013 Developer Share Posted November 11, 2013 Here you go. The prefab in question is "merchant" and it has multiple components which should add an action (one of which is the thing I'm trying to troubleshoot)Thanks ^^EDIT: Woah, I actually managed right now to activate it. It is only a single pixel which I so easily missed. That would add another question. How can I make my custom action activatable by the spacebar? 'cause that would make troubleshooting a lot easier.I was about to look into your problem but the link seems to now be invalid . Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366875 Share on other sites More sharing options...
Malacath Posted November 11, 2013 Share Posted November 11, 2013 I was about to look into your problem but the link seems to now be invalid .Sry, simplex helped me out with it, validating your above post ^^But actually the problem of doing the action with the spacebar remains. I think the most recent versions link is in my last post on the previous pag if you want to take a look. Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366898 Share on other sites More sharing options...
Developer Cheerio Posted November 11, 2013 Developer Share Posted November 11, 2013 Sry, simplex helped me out with it, validating your above post ^^But actually the problem of doing the action with the spacebar remains. I think the most recent versions link is in my last post on the previous pag if you want to take a look. That's the one I was looking at that didn't work . Link to comment https://forums.kleientertainment.com/forums/topic/18801-modders-your-new-friend-at-klei/page/35/#findComment-366963 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now