Jump to content

[Help] Socketable Sword


Recommended Posts

With the addition of the Cratered Moonrock and the ability to socket in gems I thought it would be cool to implement a similar system for a sword, however, I get an error upon inserting a gem in my item—All I did was copy the code and rename the corresponding data. It left no log.

If you know anything about it and could point me in the right direction I could really use the help!
Thank you for your time.

Edited by Zeklo
Added Help in Title
Link to comment
Share on other sites

I've now went and made a setup like the amulets to keep multiple prefabs in a single file, but can't seem to cross the build socketing function on over. So basically I either got one where I can socket in gems and I got on with specific isolated abilities, but not both at the same time and I can't seem to merge them into one properly.

Link to comment
Share on other sites

Alright I managed to figure out it out! My only two remaining questions are:

How can I allow the inputting of Opal? Done, but very inefficient 

How can I refund the particular gem upon changing? - Unlike the moon eyes you can change whenever you'd like.

Edited by Zeklo
Link to comment
Share on other sites

16 minutes ago, Zeklo said:

I guess another question for the sake of not making another thread.

How can I get the drain arrow to appear on the health badge?

the DoDelta function in the health component contains an argument to drain health over time. I guess this will also trigger the arrow ;)

Link to comment
Share on other sites

16 minutes ago, Serpens said:

the DoDelta function in the health component contains an argument to drain health over time. I guess this will also trigger the arrow ;)

local function Suffocate(inst)
	local wetness = inst.components.moisture:GetMoisture()
	if wetness == 0 then
		inst.components.health:DoDelta(-.15, true, "suffocation")

	end
end
inst:DoPeriodicTask (1, Suffocate)

This is the current way I'm trying to do it. Bare with me since I'm quite inexperienced.

Link to comment
Share on other sites

24 minutes ago, Zeklo said:

local function Suffocate(inst)
	local wetness = inst.components.moisture:GetMoisture()
	if wetness == 0 then
		inst.components.health:DoDelta(-.15, true, "suffocation")

	end
end

inst:DoPeriodicTask (1, Suffocate)

This is the current way I'm trying to do it. Bare with me since I'm quite inexperienced.

hm... you are right, this does not help... the only diffrence I noticed is that if this value is true, there will be no "hurt" sound...

I searched the game scripts, but did not find out how to do it, sry =/

Link to comment
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
 Share

×
  • Create New...