seronis Posted November 17, 2013 Share Posted November 17, 2013 Im looking into exactly how customizable the response messages from doing a custom action can be so that the player can get more info than merely 'i cant do that' depending on which condition of an action failed. But im having issues tracing everything and I would prefer not to make bad assumptions about what the return values from a given ACTION.fn actually do. Someone point me in the right direction or is this part called from the engine and not another script file? Link to comment https://forums.kleientertainment.com/forums/topic/29778-where-is-a-custom-actionfn-called-from/ Share on other sites More sharing options...
Malacath Posted November 17, 2013 Share Posted November 17, 2013 Take a look at bufferedaction.luaThe function Do() is the part which will eventually call the ACTION.fn. I don't know what exactly you want to accomplish so I don't know what else to say : P Link to comment https://forums.kleientertainment.com/forums/topic/29778-where-is-a-custom-actionfn-called-from/#findComment-372474 Share on other sites More sharing options...
seronis Posted November 17, 2013 Author Share Posted November 17, 2013 (edited) For my rabbit holes, im wanting the msg to specificaclly mention "Ground is too hard here" or "Maybe i should equip a shovel" as appropriate and not just "I cant do that" which is too generic and doesnt actually tell the player WHY. I just want the interface of the few mods im making to be intuitive. greping for "GetActionFailString" only found where the function was defined in stringutil.lua and not where it was called from. To me the return value from action.fn seems to indicate whether the fail msg needs to be displayed so I was hoping to find where I could offer more detailed failure response by tracing it. I just hadnt been able to. Looking at buffered action now Edited November 17, 2013 by seronis Link to comment https://forums.kleientertainment.com/forums/topic/29778-where-is-a-custom-actionfn-called-from/#findComment-372482 Share on other sites More sharing options...
Malacath Posted November 17, 2013 Share Posted November 17, 2013 (edited) Well, you can put the automatic equip of a shovel directly into the fn, before any return statement of course ; )And as for the string you can addSTRINGS.CHARACTER.GENERIC.ACTIONFAIL.WHATEVERYOURACTIONISCALLED = "The ground is to hard here."Should do the trick. Edited November 17, 2013 by Malacath Link to comment https://forums.kleientertainment.com/forums/topic/29778-where-is-a-custom-actionfn-called-from/#findComment-372493 Share on other sites More sharing options...
seronis Posted November 17, 2013 Author Share Posted November 17, 2013 I see an empty quote box on my end. Can you edit and repost ? Link to comment https://forums.kleientertainment.com/forums/topic/29778-where-is-a-custom-actionfn-called-from/#findComment-372495 Share on other sites More sharing options...
Heavenfall Posted November 17, 2013 Share Posted November 17, 2013 (edited) The fail reason is passed from ACTION.testfn. For an example check out ACTION.SHAVE, shaver component, beard component and speech_wilson.lua for the custom fail reasons. Edited November 17, 2013 by Heavenfall 1 Link to comment https://forums.kleientertainment.com/forums/topic/29778-where-is-a-custom-actionfn-called-from/#findComment-372496 Share on other sites More sharing options...
seronis Posted November 17, 2013 Author Share Posted November 17, 2013 Thanks guys. I dont play as wilson hardly ever so forgot about the shave stuff. Between the two advices I should be able to get it working Link to comment https://forums.kleientertainment.com/forums/topic/29778-where-is-a-custom-actionfn-called-from/#findComment-372499 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