blackhat91 Posted January 12, 2015 Share Posted January 12, 2015 Thank you for taking the time to read this. I am trying to add new traits via a mod and am trying to find the default traits for reference. I found that they are added via MainCreationMethods, but I cannot find where they are called for their function, such as Agoraphobic's panic-inducing function while outdoors. Could anyone point me in the right direction? Thank you. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted January 12, 2015 Share Posted January 12, 2015 Trait effects (for the built in traits) are all hard-coded in Java, unfortunately. Link to comment Share on other sites More sharing options...
RoboMat Posted January 12, 2015 Share Posted January 12, 2015 Thank you for taking the time to read this. I am trying to add new traits via a mod and am trying to find the default traits for reference. I found that they are added via MainCreationMethods, but I cannot find where they are called for their function, such as Agoraphobic's panic-inducing function while outdoors. Could anyone point me in the right direction? Thank you. You can take a look at my lockpicking mod. It uses traits on the lua side. Creating a new trait is pretty simple:----- Create custom traits.--local function initTraits()TraitFactory.addTrait("nimblefingers", Lockpicking_Text.traitNimbleFingers, 0, Lockpicking_Text.traitNimbleFingersDescription, true);end ----- Create custom professions.--local function initProfessions()local burglar = ProfessionFactory.addProfession("rm_Burglar", Lockpicking_Text.professionBurglar, "Prof_nk_Burglar");burglar:addFreeTrait("nimblefingers");burglar:addFreeTrait("NightOwl");end Using it in your code can be tricky depending on what you want to do, but here is a simple example:-- Lower the chance for success for players with the nimblefingers trait.if player:HasTrait("nimblefingers") then chance = 12;else chance = 8;end Link to comment Share on other sites More sharing options...
blackhat91 Posted January 12, 2015 Author Share Posted January 12, 2015 Thank you for your replies. @RoboMat: I actually have used your mod, as well as others, as source material for creating my own. It has been very helpful. The issue I'm running into now is not knowing how to call certain functions. For instance, I wish to know how to call a trait when outdoors, when inside, when it is raining, etc. I was hoping to look at the vanilla traits for this, but if @EnigmaGrey is right and they are in Java, I may have issues figuring out those commands. Link to comment Share on other sites More sharing options...
RoboMat Posted January 12, 2015 Share Posted January 12, 2015 You can look at the java code with software like JD-GUI. Link to comment Share on other sites More sharing options...
blackhat91 Posted January 12, 2015 Author Share Posted January 12, 2015 Thank you, I will look at that if I have any more confusion. Also, I found this on these forums: http://theindiestone.com/forums/index.php/topic/8090-references-luamethods-events-exposed-classes/ Are those still current, or have they been modified if newer builds? Link to comment Share on other sites More sharing options...
RoboMat Posted January 12, 2015 Share Posted January 12, 2015 Most of it should be up to date. Link to comment Share on other sites More sharing options...
blackhat91 Posted January 12, 2015 Author Share Posted January 12, 2015 Thank you. I'll work with that reference sheet and what I can find in Java. Hopefully I can piece it all together. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now