Jump to content

Script Editing


CarlBar

Recommended Posts

Ok finally got the mod tools installed and setup. I'm primarily interested in doing some class ability balance tweaking, though i've allready messed with some small ini tweaks whilst i waited for the mod tools to download but i haven't found any info on how you override a script file. Is it as simple as putting a copy of the script file's i want to change the code of into my mods appropriate folder and then editing it and hitting build, or do i need to setup a file telling the game which script files to override, or do somthing more complicated as was the case with ini tweaks where i had to specify the code lines to be removed and the code lines to be added?

Link to comment
Share on other sites

I've had a look at both of them allready as well as the LW team's leader class. None of them contain any clues because as far as i can tell none of them are changing anything contained within an existing script file. If i wanted to create a new class or weapon, i'm confident i could use them to do it. But i haven't found a single example mod that edits an existing script file in a way that changes the data contained therein. They're all just adding data for new features, functions, and so on and so forth.

 

EDIT: To be clear i've only edited the kind of script files that XCOM2 uses an handful of times before in other games and always through various tools that simplified the procedure so i admit it's possible there's somthing in those mods that i'm missing because i only understand most of what i'm seeing, and then only in very general terms, (i can see which values and lines set various things but their may be interactions i'm not seeing because they're not very obvious). but if i am missing somthing like that i'd need it pointing out.

Edited by CarlBar
Link to comment
Share on other sites

Sadly all the class mods i can find are flat out replacements or extras, there's none that i can see that actually edit existing class abilities yet.

 

In the end i'm doing it the long way, namely giving the abilities i want to edit new unique names using the existing method or replacing .ini data and the generating new renamed version of the desired abilities with the edited data. Unfortunately when i try that i get a build error and i quite literally have no clue what it means. Included below:

Warning/Error Summary
		---------------------
		H:\Steam\steamapps\common\XCOM 2 SDK\Development\Src\Engine\Classes\XComModOptions.uc(1) : Error, Missing 'Class' definition
Link to comment
Share on other sites

I think that means the .uc script is missing the header

 

You should start all your .uc scripts with something that looks like this:

class XComModOptions extends X2Ability dependson (XComGameStateContext_Ability) config(ModOptions);       // Will read XComModOptions.ini for variables.

the extends and dependson are based off what you're trying to access/change or do.

Link to comment
Share on other sites

Ok after pulling my hair out for quite some time and getting nowhere, (i even tried deleting all the files i created so it only had the ones it created when you first make a new project and got the same error), i re-created the project from scratch copying in the modified files. This time it failed with a diffrent error. I'm guesiing it means a typo mistake of some kind but i'm not sure what sort. Although i at least know which file to look in.

 

The error is:

 

 

 

  Quote
H:\Steam\steamapps\common\XCOM 2 SDK\Development\Src\SharpshooterRework\Classes\X2Ability_SharpshooterAbilitySetRebalance.uc(51) : Error, Type mismatch in '='

 

In case it helps here's the relevant files code:

 

 

  Reveal hidden contents

 

Edited by CarlBar
Link to comment
Share on other sites

Please use spoiler tags if you post a huge code segment. You recognize that the (51) in the message is a line number? Then the problem is that you have a mismatched type in that line. You will have to change the type assignment at line 34. If you have no programming experience, this type of editing is still possible, but it may be more challenging and require more time to learn.

Link to comment
Share on other sites

  Quote
You recognize that the (51) in the message is a line number?

 

No i didn't thank you :smile:.

 

Also sorry about the spoiler tags. I'll go back and change after finishing typing this.

 

And yes i didn't expect this to be easy :smile:. I learn my modding mostly by examining other code, then start with editing that code, then splicing it together in new ways, and so on and so forth till i can create from scratch, but this kind of full on really finicky scripting language is a bit

 

Ok this appears to be the problem code line:

	FireEffect = new class'X2Effect_ReturnFireRebalance';

TBH i had a suspicion this was going to give me trouble doing.

 

I'm guessing from what you just said that this line:

	local X2Effect_ReturnFire                   FireEffect;

Tells the game with other file to pull up to find the effect and the code thereof and my not changing this created the issue?

 

Anyway i'll try it and see what happens. Thank you :smile:. I'm liable to be back with more problems and questions over time i'm afraid till i really get to understand this.

 

EDIT: And build succeeded after i fixed that, (much obliged), so time to jump in game and test it.

Edited by CarlBar
Link to comment
Share on other sites

Ok that sorta fixed it. Turned out there was a couple of improperly edited lines in the big piece of text as well that created in game bugs, (basically the game was looking at two copies of each ability because i hadn't edited a line that defined the template created). Fixed that but then discovered that the edited ClassData file is not being properly used. It's not actually switching the abilities out for the new ones.

 

Here's the code from that file:

 

 

  Reveal hidden contents

 

 

Any clue as to why?

Edited by CarlBar
Link to comment
Share on other sites

  • Recently Browsing   0 members

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