Jump to content

[Help Request]- An error and an aura


Recommended Posts

As my title states, I have two different issues, and as I am rather new to modding (as of yesterday) I'm having trouble finding an error.

On line 33 of that incredibly helpful template, the game gives me an error if I try to launch it. The code is such :

 

 

STRINGS.CHARACTER_TITLES.brother-chaplain maximus = "Speaker of the word of the Emperor"

 

 

I'd be extremely grateful if someone was to tell me what I'm doing wrong.

Also, I'd like to give him a perk that makes nearby allies  regenerate sanity. Kinda like the opposite of the sanity drain aura.

(for any Warhammer 40k Fans out there, yes, This is a space marine chaplain. A friend and I are also making a Tau Fire caste warrior, and plan on making a representative of each major race from the Wh40K Universe)

 

Again thanks to anyone who took the time to look at this and help me out!

 

 

 

Link to comment
Share on other sites

@ninja0fd00m, Variable names can't have spaces or dashes. Either you remove them, or, if you absolutely want to use that format, put it between brackets and quotation marks: STRINGS.CHARACTER_TITLES["brother-chaplain maximus"].

 

As for the sanity aura, you have to add the sanityaura component to your character, in master_postinit:

inst:AddComponent("sanityaura")

Then, use the aurafn function to give off sanity regen to nearby players if they are allies:

inst.components.sanityaura.aurafn = function(inst, observer)    if [test if the observer is an ally] then        return TUNING.SANITYAURA_SMALL -- small sanity regen    else        return 0    endend

I don't know what's your condition for a player to be an ally, though.

Unless you mean to every player around, in which case, just use inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL.

Edited by Jjmarco
Link to comment
Share on other sites

So, that worked, thanks for the help, but now I get this error screenshotted below.

I even went back reinserted the template version with the new character name, it gave me that error.

I don't quite understand what my problem is.

 


So, that worked, thanks for the help, but now I get this error screenshotted below.

I even went back reinserted the template version with the new character name, it gave me that error.

I don't quite understand what my problem is.

 

Link to comment
Share on other sites

@ninja0fd00m, That's because you put STRINGS.CHARACTER_TITLES["Chaplain Maximus"] without anything else.

The Lua interpreter expected an "=" because it thought you were trying to assign line 35 to line 34.

 

But you can just remove that line, as you've already defined your character's title on line 33.

Edited by Jjmarco
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...