Jump to content

Recommended Posts

  • Developer

@Cheerio Two question:

First: What I wrote in the post above this  : P

Second: 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.

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 by Malacath

I added Wendy's skirt  :-).

 

attachicon.gifsample_dude.zip

 

attachicon.gifwinter_skirt.jpg

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)

6918bb.png

Edited by Stealthic

I have another question about adding a custom action, those are my bane... I have the following code

ACTIONS = _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 = 10

Now 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...

@Malacath

Try

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 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 by simplex

@Malacath

Try

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?

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 exactly

function Shopkeeper:CollectSceneActions(doer, actions)	if doer == GetPlayer() then 		table.insert(actions, ACTIONS.TRADE)	endend

But 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 Ipsquiggle

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...

Edited by Malacath

 

 

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 

So this code still doesn't work

local 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.

  • Developer

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)

6918bb.png

Would it be possible to upload what you have so far?

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)	endend

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.

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 so

GetPlayer().components.sanity:DoDelta(-TUNING.SANITY_TINY)

You get a like for using 7z compression. ;P

Yippie  :D

@Malacath

It 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 call

inst: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.

  • Like 2

@Malacath

It 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 call

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.

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 by Malacath

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 by CycloneSP

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

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 by CycloneSP
  • Developer

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

Lpsquiggle 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 :).

  • Developer

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 :(.

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.

  • Developer

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 :).

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...