Jump to content

Recommended Posts

Posted (edited)

I am trying to add a new class to Xcom2. I have followed a youtube tutorial and also managed to get the custom class into the game just as the video describes.

Now I have done this again, just with another modname and classname and it worked too. Since this prototype only had one single ability I started to add additional ones.

 

I did this by adding the soldier ranks to XComClassData.ini (config folder) and adding static functions to X2Ability_JedaiiMod.uc in my classes folder.

Since I continuously got errors I plainly copied the whole text from the original XCom 2 file for the Ranger (still from the XCom SDK directory, not the actual game) so I could be sure it worked. For some reason I am still getting error messages. Now this is something I really don't understand because I have just copied from the original files...

 

Warning/Error Summary
---------------------
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(707) : Error, Unknown Property 'RAPIDFIRE_AIM' in 'Function JedaiiMod.X2Ability_JedaiiMod:RapidFire2'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(653) : Error, Unknown Property 'RAPIDFIRE_AIM' in 'Function JedaiiMod.X2Ability_JedaiiMod:RapidFire'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(419) : Error, Unknown Property 'SHADOWSTRIKE_AIM' in 'Function JedaiiMod.X2Ability_JedaiiMod:Shadowstrike'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(267) : Error, Unknown Property 'REAPER_COOLDOWN' in 'Function JedaiiMod.X2Ability_JedaiiMod:Reaper'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(131) : Error, Unknown Property 'SwordSliceName' in 'Function JedaiiMod.X2Ability_JedaiiMod:AddSwordSliceAbility'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(120) : Error, Unknown Property 'INSTINCT_DMG' in 'Function JedaiiMod.X2Ability_JedaiiMod:AddHuntersInstinctAbility'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(91) : Error, Unknown Property 'BLADEMASTER_DMG' in 'Function JedaiiMod.X2Ability_JedaiiMod:Blademaster'


Failure - 7 error(s), 0 warning(s) (7 Unique Errors, 0 Unique Warnings)

X2Ability_JedaiiMod.uc

 

 

  Reveal hidden contents

 

 

Can you please help my understanding where the errors are?

Edited by DreizehnX
Posted

In the future please either use spoiler tags, or put the whole code file in another location such as pastebin and put the link here.

 

This is a problem of "extending". There is X2Ability. Then X2Ability_RangerAbilityset "extends" that and adds more stuff. What you think you are doing (I believe) is extending X2Ability_RangerAbilitySet, so that anything defined in that file can be used by yours. Unfortunately what you actually did is extend X2Ability. So, stuff which is defined in the ranger file is not visible to you.

 

Change the line:

class X2Ability_JedaiiMod extends X2Ability

to:

class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet

Posted

You probably didn't copy the "var int" stuff at the beginning of the RangerAbilitySet.uc file, which might be why you're getting those errors.

 

And IIRC, you can just slap the Ranger skills into the ClassData.ini skill tree and remove them from your custom class's ability file.

Posted
  On 4/15/2016 at 8:02 PM, davidlallen said:

In the future please either use spoiler tags, or put the whole code file in another location such as pastebin and put the link here.

 

This is a problem of "extending". There is X2Ability. Then X2Ability_RangerAbilityset "extends" that and adds more stuff. What you think you are doing (I believe) is extending X2Ability_RangerAbilitySet, so that anything defined in that file can be used by yours. Unfortunately what you actually did is extend X2Ability. So, stuff which is defined in the ranger file is not visible to you.

 

Change the line:

class X2Ability_JedaiiMod extends X2Ability

to:

class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet

 

Thank you and sorry - I have edited my post to lessen the wall of text.

From what I understand my new class should do the same as X2Ability_RangerAbilitySet does; extending the original X2Ability.

After I have changed my headline to class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet I get no more errors. It just seems to my as if I now add something to the original ranger calss because I'm extending the RangerAbilitySet. Do I missunderstand this?

The reason why I chose to copy the ranger was because I wanted to have the SwordSlice as automatically unlocked ability after the soldier gets promoted to squaddie. After my custom class was in the game with the ranger-like abilities I wanted to change the skills with those of other soldiers (eventually with alien skills in case that is even possible).

 

For some reason, when I start debugging, my custom soldier now has Reaper has his first/squaddie ability.

 

  On 4/15/2016 at 8:04 PM, swinka6666 said:

This:

// This is an Unreal Scriptclass X2Ability_JedaiiMod extends X2Ability dependson(XComGameStateContext_Ability) config(GameData_JedaiiMod);

into:

// This is an Unreal Script
class X2Ability_JedaiiMod extends X2Ability dependson(XComGameStateContext_Ability) config(GameData_JedaiiMod);

?

This was my fault when coyping the code into my post. The unreal script has the line break.

 

  On 4/15/2016 at 8:29 PM, Kregano said:

You probably didn't copy the "var int" stuff at the beginning of the RangerAbilitySet.uc file, which might be why you're getting those errors.

 

And IIRC, you can just slap the Ranger skills into the ClassData.ini skill tree and remove them from your custom class's ability file.

At first I tried only using the ini files (I followed this guide I have found in davidlallen's signature and copied the steps 1:1) but my custom class never showed up in the game. After using this other guide that involved the uc script I managed to have the custom class visible in the game.

 

Thank you all very much for your help.

 

In case it is important: My XComClassData.ini looks like this.

Posted

Sorry for the doublepost but... yesterday and today I kept trying to edit my uc file to find a solution for my ability-problem.. After not succeeding at all I copied the code I have posted in this topic and changed the headline to

class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet

as davidlallen told in his post. Now I'm getting a new error:

E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(9) : Error, Missing '<' in 'array'

The line 9 is leading to my

static function array CreateTemplates()

...which is the same as it had been before - I just get an error while it was no problem before.

Posted

Many compilers stop upon the first error. So, if you fix one error, you may get a new error, because the compiler stopped before checking for the second error. If you closely compare your line against other similar lines, you will see the problem. A proper line looks like this:

 

static function array<X2DataTemplate> CreateTemplates()

Posted
  On 4/17/2016 at 3:55 PM, davidlallen said:

Many compilers stop upon the first error. So, if you fix one error, you may get a new error, because the compiler stopped before checking for the second error.

Thanks again for helping me understand. ^^

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...