Sign in to follow this  
Petrenko

Crashlog Editing Stuff

Recommended Posts

Petrenko    10

Heyho,

i decompiled the .lua files and played a bit with them.

I deleted the traits, making tools a finite tool and also added a new drop to the grass.

(It's just a proof on concept so please don't critizise what i'm doing)

local dig_up = function(inst, chopper)  if inst.components.pickable and inst.components.pickable:CanBePicked() then    inst.components.lootdropper:SpawnLootPrefab("cutgrass") and inst.components.lootdropper:SpawnLootPrefab("seeds")  end  inst:Remove()

After this i get the following crashlog at booting of the game

LOADING LUA SUCCESS...e_Make_Steam_Package\workspace\data\scripts\main.lua:152: Prefab file doesn't return a callable chunk data/scripts/prefabs/grass.luaLUA ERROR stack traceback:        =[C] in function 'assert'

I did not recompile, since it did not work for me, also they told on the forum, you don't have to.

Thanks in advance for any usefull hints etc.

Erast P.

Share this post


Link to post
Share on other sites
Kevin    3944

The clause within the then/end block isn't valid, syntactically.Replace it with:inst.components.lootdropper:SpawnLootPrefab("cutgrass")inst.components.lootdropper:SpawnLootPrefab("seeds")

Share this post


Link to post
Share on other sites
Petrenko    10

You mean like this?

if inst.components.pickable and inst.components.pickable:CanBePicked() theninst.components.lootdropper:SpawnLootPrefab("cutgrass") inst.components.lootdropper:SpawnLootPrefab("seeds") end  inst:Remove()

This did not work.

Edited by Petrenko

Share this post


Link to post
Share on other sites
Yello    10

You mean like this?

if inst.components.pickable and inst.components.pickable:CanBePicked() theninst.components.lootdropper:SpawnLootPrefab("cutgrass") inst.components.lootdropper:SpawnLootPrefab("seeds") end  inst:Remove()
This did not work.
Are those item scripts? If so where are they?

Share this post


Link to post
Share on other sites
Starvation    50

local prefabs = {"cutgrass", "dug_grass"}

it's about the fifth line from the top (in the actual file) U must define the prefabs first. Don't forget to add a comma after each word. I figured this out by modding the rocks.lua to drop spears and bee-mines and random stuff, as a mod (based on a story that pigmen hide your stuff under rocks when you die)

----

----

So....

local prefabs = {"cutgrass", "dug_grass, [The prefab goes here]"}

then....

inst.components.lootdropper:SpawnLootPrefab("cutgrass")

inst.components.lootdropper:SpawnLootPrefab("[The prefab goes here]")

[][][]

So if were to make the grass give butter muffins.

i would type 'butterflymuffin' where [The prefab goes here] is, as that is it's prefab name.

----

Hoped that helped :D

Edited by Starvation

Share this post


Link to post
Share on other sites

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
Sign in to follow this