Jump to content

Recommended Posts

Alright, simple thing that I cannot due to lack of knowledge. Basically, I am just trying to reduce and or remove sanity drain on the night sword for a custom character without it doing the same for every other character in the game. Also will be using this for some of the staffs.

 

Thanks for the help, (if given)

  • Developer

I would reading the Scripting with Sublime Guide. Once you've done that, you can look for the 'nightsword.lua' file and see how it works. You will probably just want to set it's dapperness to none which you can do by replacing the night sword or by adding a postinit call.

New character mod? I would totally download a  'Simplex' character mod :-).

That's actually Wilson's face, by Willette. ;]

But anyway, to the OPer: what you want is to set up a prefab post init for the nightsword which changes its dapperness, as Cheerio said. For the character-specific part, you want to enclose that change with an "if" block which tests if the player (GLOBAL.GetPlayer()) has your character's prefab (GLOBAL.GetPlayer().prefab == "mycharacter").

Edited by simplex

 you want to enclose that change with an "if" block which tests if the player (GLOBAL.GetPlayer()) has your character's prefab (GLOBAL.GetPlayer().prefab == "mycharacter").

Been playing around with 'if' statements and 'else', but as said, rather clueless here. This is basically what I have been tossing around and fiddling with for a while.

Trying to make a test to test for the character, but keeps giving errors no matter where I place things.

 inst:AddComponent(GLOBAL.GetPlayer().prefab == "mycharacter") if owner.prefab == "character" 	then  inst.components.dapperness.dapperness = TUNING.CRAZINESS_TINY,  	else  inst.components.dapperness.dapperness = TUNING.CRAZINESS_MED, end

inst:AddComponent(GLOBAL.GetPlayer().prefab == "mycharacter") 

 

Invalid line of code. AddComponent expects the argument you supply to be the name of a component. You didnt give it the name of anything, you put a boolean expression where a string was expected.

 

What component are you trying to add to 'inst' here ?

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