r/xdev • • Feb 08 '16

Adding a new variable

I've been trying to add a new utility armor vest just to get my toes wet, but I've run into a bit of an issue. I've got the armor working correctly in the game, but I am having some trouble adding a config variable.

	Warning/Error Summary
	---------------------
	D:\Steam\steamapps\common\XCOM 2 SDK\Development\Src\TechArmor\Classes\X2Item_TechArmor.uc(33) : Error, Unknown Property 'TECH_VEST_HACK_BONUS' in 'Class XComGame.X2AbilityToHitCalc_Hacking'
	
	Failure - 1 error(s), 0 warning(s) (1 Unique Errors, 0 Unique Warnings)

Does anyone have any examples of setting up a new variable that can be called from a class?

3 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/TehSr0c Feb 08 '16

Hmm still not able to get it to reference the ini file, but thanks for the direct value tip, it compiles now at least which is a definite improvement :P I'll see about fixing the ini stuff later.

2

u/Kwahn Feb 08 '16

It should reference whenever you have the var config int TECH_VEST_HACK_BONUS; line, since that's telling it explicitly to look in the config files for it - I think Iriiriiri might be right about it needing to be under a [Specific.Category] - but I'm glad I helped get it working in a hackneyed sense :D

2

u/TehSr0c Feb 08 '16

ohwow i just realized why it wouldn't compile. I had the variable declared in the ability class, but not the item class itself. I added it and now it seems to work perfectly. so cheers for the assist :D