Jump to content

Buttons, buttons, buttons


Recommended Posts

I wrote function, what's wrong with it?
 
local function startmilling(inst)
      inst:PlayAnimation("working",true) --change looping animation
      inst:DoTaskInTime(60, startmilling(inst) --wait a minute, playing animation 
             inst:PushAnimation("idle_ready") --push animation
             end)
end
 
Button
 
local widgetbuttoninfo = {
text = "Start",
position = Vector3(0, -165, 0),
fn = function(inst)
startmilling(inst)   -- my function
end
 
validfn = function(inst) --can it be clicked?
        return inst.components.stewer:CanCook()
    end
}
 

Game crashed

Link to comment
Share on other sites

Kinda reminds me of the electric cutmill from IR C :p<- shameless self-advertisement

 

Try to compare your code to game- and mod-code and if that fails, post the whole prefab file. (assuming you checked your log.txt already)

Link to comment
Share on other sites

There is a syntax error at function startmilling.

local function startmilling(inst)      inst:PlayAnimation("working",true) --change looping animation      inst:DoTaskInTime(60, function()              startmilling(inst) --wait a minute, playing animation              inst:PushAnimation("idle_ready") --push animation      end)end
Link to comment
Share on other sites

Kinda reminds me of the electric cutmill from IR C :razz:<- shameless self-advertisement

 

Try to compare your code to game- and mod-code and if that fails, post the whole prefab file. (assuming you checked your log.txt already)

maybe. My idea: windmill and baking of bread in special oven. It's stupid but i like it. Ears of wheat--> Wheat seeds -- > Flour. And more recipes for bread, cakes, crackers etc.

previously it had an idea about a sawmill (log-->4twigs), but as you said saw already created in IRC. I have not watched, but i download it now and have a look, how you doing.

post-674378-0-97502700-1438179362_thumb.

Link to comment
Share on other sites

maybe. My idea: windmill and baking of bread in special oven. It's stupid but i like it. Ears of wheat--> Wheat seeds -- > Flour. And more recipes for bread, cakes, crackers etc.

previously it had an idea about a sawmill (log-->4twigs), but as you said saw already created in IRC. I have not watched, but i download it now and have a look, how you doing.

attachicon.gif2015-07-29_00002.jpg

That looks cool as hell

Link to comment
Share on other sites

maybe. My idea: windmill and baking of bread in special oven. It's stupid but i like it. Ears of wheat--> Wheat seeds -- > Flour. And more recipes for bread, cakes, crackers etc.

previously it had an idea about a sawmill (log-->4twigs), but as you said saw already created in IRC. I have not watched, but i download it now and have a look, how you doing.

 

That mod should add wheat, since the assets are already in the game. Just saying.

I'm suprised nobody has... Tiny what?

So yeah, as said above, the issue is possibly tied to the fact that you call a function from within that function.

 

turn your screen 180° now

 

.08l uǝǝɹɔs ɹnoʎ uɹnʇ 'spuoɔǝs 09 u!

 

see?

Link to comment
Share on other sites

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.

×
  • Create New...