Deathlord Avon

Quick/Small Modding help with Durability

14 posts in this topic

Evening DST community, i have a little question and help request. I know that there alot of stuff out to look up and i also can just look on the vanilla files, but until i figured it out im probably 20 years older :P. So im asking kindly if somehow willing to quick help.

I want simply edit the durability of the compass for me and my friends in a small seperate mod.I assume that i probably need to just change an singel entry but from previous long ago experience it never worked out how i imaged when i tried to edit stuff in the DST code.

 

Best Regards.

Share this post


Link to post
Share on other sites

The line is :


        COMPASS_FUEL = day_time * 4,

Maybe you could simply set an higher number for this line in a modmain.lua and see if it works ?

Share this post


Link to post
Share on other sites
19 minutes ago, Lumina said:

The line is :



        COMPASS_FUEL = day_time * 4,

Maybe you could simply set an higher number for this line in a modmain.lua and see if it works ?

Sure will test it out thank u Lumina =)

Share this post


Link to post
Share on other sites
2 hours ago, Lumina said:

The line is :



        COMPASS_FUEL = day_time * 4,

Maybe you could simply set an higher number for this line in a modmain.lua and see if it works ?

Seems to crash for me when i try :p

Share this post


Link to post
Share on other sites

 

See there how to obtain a log and post it. There is probably something missing, maybe a local or a global or something like this, but it will help to have the log in any case.

Share this post


Link to post
Share on other sites
23 minutes ago, Lumina said:

 

See there how to obtain a log and post it. There is probably something missing, maybe a local or a global or something like this, but it will help to have the log in any case.

Well apparently it wasnt a crash in usally way it was just a CTD without any logs or crash info, when i tried to pick a charackter.

Edited by Deathlord Avon

Share this post


Link to post
Share on other sites

Here this will make the compass have double the durability, if you want more or less than that then change "2" inside the modmain.lua of the mod, hjaeve fun :D!

durable compass.zip

1 person likes this

Share this post


Link to post
Share on other sites
1 hour ago, SuperDavid said:

Here this will make the compass have double the durability, if you want more or less than that then change "2" inside the modmain.lua of the mod, hjaeve fun :D!

durable compass.zip

Oh my m8 ur a lifesaver when Lumina send me code above i was diggin more into compass and wasnt sure if i should use that line or not but apparently it was right and u proved it. Will testing it in a bit but im sure it will work tho Thanks already :p

Best Regards

1 person likes this

Share this post


Link to post
Share on other sites
On 20.4.2017 at 2:31 PM, SuperDavid said:

Here this will make the compass have double the durability, if you want more or less than that then change "2" inside the modmain.lua of the mod, hjaeve fun :D!

durable compass.zip

@SuperDavid
Suddenly it crashes when i play with more people, playing alone works totally fine but as soon i spawn a compass when 1 more is with me it crashes out wasnt able to read the crash yet to fast faded away, but and rough ideas ? Will reproduce the error later when my friend is up tho.

EDIT : i rechecked now and it seems as soon as i add Caves to the world it crashes me out with this error suddenly.

Best Regards

fannt.png

Edited by Deathlord Avon

Share this post


Link to post
Share on other sites

Sorry, but I don't know how to fix that crash :(... Hopefully someone else can help you fix this :).

1 person likes this

Share this post


Link to post
Share on other sites

The mod is "all_clients_require_mod = true", so the compass function runs on clients (people joining cave servers).

The fueled component doesn't exist on clients, and you end up indexing a nil of a table.

Either turn the client requirement to false, or add a check

AddPrefabPostInit("compass", function(inst)
	if inst.components.fueled then
		-- do fueled thing
	end
end)

to verify that the component exists.

2 people like this

Share this post


Link to post
Share on other sites
1 hour ago, DarkXero said:

The mod is "all_clients_require_mod = true", so the compass function runs on clients (people joining cave servers).

The fueled component doesn't exist on clients, and you end up indexing a nil of a table.

Either turn the client requirement to false, or add a check


AddPrefabPostInit("compass", function(inst)
	if inst.components.fueled then
		-- do fueled thing
	end
end)

to verify that the component exists.

That clears alot up thank u Hero :p

Best regards

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