I'm revising a mod favourite including some extra restored content about the Force training for Jedi and want to fine tune it with scripting rather than complicated player instructions.
Kreia frequently triggers a script for the Exile to be granted new Force powers such as Beast Control.
The restored content I'm working with involves some new powers I need to introduce just like these.
I need the script syntax to award a character a restored Force power automatically, dependent upon their Jedi class level. They must have the level requirement in a Jedi class, not in total Character level, but get the power automatically when they do. Jedi Guardians, Jedi Sentinels and Jedi Consulars get different restored powers at certain levels.
Perhaps if someone pointed out the script for the Beast Control power being awarded to the Exile I could figure it out. Or if an experienced aurora scripter wants to walk me through it that'd be fine too.
The mod really is worth it and full credits will be given (TSLRCM compatable).
The script your asking for is a_beast_control in 402DXN_s.rim. The main part of what your looking for is the GrantSpell,it's what awards force powers and LS forms. The number for the power/form corresponds with the list in nwscripts.nss.
void main() {
int nParam1 = GetScriptParameter(1);
switch (nParam1) {
case 0:
ChangeToStandardFaction(GetObjectByTag("boma_young_bc", 0), 1);
break;
case 1:
GrantSpell(182, GetFirstPC());
break;
}
}
A basic script would be this;
void main() {
GrantSpell(182, GetFirstPC());
}
I need the script syntax to award a character a restored Force power automatically, dependent upon their Jedi class level. They must have the level requirement in a Jedi class, not in total Character level, but get the power automatically when they do. Jedi Guardians, Jedi Sentinels and Jedi Consulars get different restored powers at certain levels.
Something like this should check for the highest level the player has in any Jedi class and then grant a force power if it is high enough. You set the level and which power to grant at the top:
const int G_FORCE_POWER = 999; // spells.2da line number of power to grant
const int G_LEVEL_REQ = 10; // the jedi class level to give the power at.
int ST_IsJediClass(int iClass) {
return ((iClass == CLASS_TYPE_JEDIGUARDIAN) || (iClass == CLASS_TYPE_JEDICONSULAR) || (iClass == CLASS_TYPE_JEDISENTINEL) || (iClass == CLASS_TYPE_JEDIWEAPONMASTER) || (iClass == CLASS_TYPE_JEDIMASTER) || (iClass == CLASS_TYPE_JEDIWATCHMAN));
}
void main() {
object oPC = GetFirstPC();
// Player already has the force power. No point in doing anything else.
if (GetSpellAcquired(G_FORCE_POWER, oPC)) {
return;
}
// Get the highest level the player has in a jedi class
int i;
int iJediLvl = 0;
for (i = 1; i <= 2; i++) {
int iClass = GetClassByPosition(i, oPC);
if ((iClass != CLASS_TYPE_INVALID) && ST_IsJediClass(iClass)) {
if (GetLevelByClass(iClass, oPC) > iJediLvl) {
iJediLvl = GetLevelByClass(iClass, oPC);
}
}
}
// Check if the level is high enough. If so give the power.
if (iJediLvl >= G_LEVEL_REQ) {
GrantSpell( G_FORCE_POWER, oPC );
}
}
EDIT: Or you you want to give the power at a specific level for each of the core jedi classes it can be done simply as:
void main() {
object oPC = GetFirstPC();
int iPower = 260; // spells.2da line number/index
if (GetSpellAcquired(iPower, oPC)) {
return;
}
if ((GetLevelByClass(CLASS_TYPE_JEDIGUARDIAN, oPC) >= 2)
|| (GetLevelByClass(CLASS_TYPE_JEDISENTINEL, oPC) >= 6)
|| (GetLevelByClass(CLASS_TYPE_JEDICONSULAR, oPC) >= 12))
{
GrantSpell( iPower, oPC );
}
}
Thankyou thankyou thankyou *wipes tear from eye*
My skills are rudimentary at best but this is enough to work with so I can assign individual level requirements depending on Jedi class type for each power, which is then awarded automatically at the given level/Jedi type.
You've made it much easier for me, I am in your debt.
edit, I have another question I apolegise. I've figured out a simple logical script using Stoffe's above as a template for each individual class and power so they're all learned differently by different classes but wind up learned by all the classes. No prob there.
My question is in naming the compiled script, can I just make up a name like say, a_forcetraining.ncs and then I need to...point to that script somewhere so that at level up for Jedi classes this script is always pointed to and checked. Which would be the game's level up script, so that I presume I'd just add a line at the top that says -> #include "a_forcetraining" ?
My question is in naming the compiled script, can I just make up a name like say, a_forcetraining.ncs and then I need to...point to that script somewhere so that at level up for Jedi classes this script is always pointed to and checked. Which would be the game's level up script, so that I presume I'd just add a line at the top that says -> #include "a_forcetraining" ?
As far as naming the script,yes you can name it whatever you would like to,best to give it a unique name so less compatibiliy issues.
As far a the second part of you question,are you asking ,each time you level up a character/jedi it runs your script? If so I think you would have to add/run it in to the levelup script.
Yes, that's it. But which script is the level-up script? Is c_pc_level.ncs used for all the party, the Exile and companions (I can just add a script reference in there) or do the companions have their own level up script separate from the Exile (where I'd need to add a script reference also)?
For general thread browsers and info, this is the readme description for the mod in its entirety so essentially people know what this is all about.
It is a revision of a much more complicated, but very similar mod I released on kotorfiles a while ago.
Vanir's TSL Tweak Version 2.0
Full credits to Paragon and his magnificent D20 mod without which this mod would not be possible and I'd know a lot less about modding. This mod is based around some restored content and personal touches to make it all work. This mod should be compatable with TSLRCM v1.4d (tested).
Please read the following prior to installation
You must remove/uninstall any previous version of this mod or the Patcher will drive your installation nuts with re-edits.
Description
SWRPG started with tabletop gaming in the old days of West End Games (WEG) sourcebooks and the d6 gaming system. This was when the Force using game system and even the Tales of the Old Republic expansions first hit the scene. This was further developed by Wizards of the Coast (WotC) and their d20 system, from which we get the aurora game shell and both NWN and Kotor games.
Taking up where Paragon left off, this mod which uses no artistic material from him or any other modders but does take advantage of their modding experience and instruction, seeks to take TSL back to its tabletop roots in the Force user gaming system and adds some minor tweaks.
This is all 2da editing, some minor scripts and a few lines in the dialog.tlk file. It's really a simple mod but changes the gameplay a little more in tune with the tabletop RP.
Classes and combat tables (restored and modified)
The attack tables in TSL were originally designed so that different classes used different tables (just like in K1), there is an "average trained combatant" table, an "untrained" table and a "professional soldier" table. The vanilla game uses the same attack tables for all classes (professional soldier table) and thus loses some of its challenge and the character of individual classes, this is one of the single biggest factors which anticlimax K2 so trust me, it greatly improves overall gameplay and forces specific classes to rely upon their class abilities and player skill.
Jedi Guardians have unchanged combat tables. These are epitomised by the Jedi of the OT era and are the most combat specialised of the basic Jedi classes. Their use of the Force is compromised somewhat until achieving Master status. They use Soldier class attack tables and hit die. Comparitively, although unchanged these guys (and the Soldier class) really feel much more powerful to play in the game when facing less professional combatants on the field, there's a noticeable difference when switching to other class types.
Jedi Sentinels are a WEG class-template and were the original Jedi of the Old Republic period. They use the Soldier class attack tables and the Scout class hp tables with mid-range Force ability. They have good skills base and are the all-rounders conceived in a time where there were many Jedi in the galaxy. Sentinels were not supposed to confront enemies, this was for the Jedi Battlemaster class-template, but they could certainly give a good fight if pressed. Their job was to hunt down Sith artefacts so they could not be misused. If need be they could support Jedi Battlemasters on the field or form infiltration strike teams.
In the Old Republic virtually all adventuring Jedi were the Sentinel class type (as described by the WEG and WotC RPG expansions).
Jedi Consulars are a WotC class type to essentially play the role of Jedi Masters before the Prestige classes were invented. New player-characters chose the Jedi Consular class intending to become like Yoda or sit on the Council. They use the Scout class combat tables and Scoundrel class hit die. They can fight if they have to but mostly wear the lightsabre as a sign of their station and authority in the Order, relying upon their mastery of the Force to achieve their aims. Jedi Consulars are the most common type to fall prey to the Dark Side of the Force, because at lower levels when their Force mastery is low and combat abilities neglible the temptation to use the Dark Side of the Force is powerful. A Jedi Consular without his lightsabre isn't very tough in a stand up fight, but no worse than henchman-style standard combatant as far as hit tables go, they're not untrained.
Normal minions, thugs and the like throughout the galaxy no longer use the trained Soldier attack tables because this makes no sense for the advanced combat training of professional Soldiers. There is now an "average combatant" attack table they use which is the same as that of a professional Scout or a Scoundrel. The autobalance.2da however has been tweaked so enemies are tougher all round anyway. Don't neglect minions when they have numbers on side, you'll get creamed.
Professional Scouts and Scoundrels both have the attack tables of "average combatant" and this is better than an untrained civilian, but not as good as a professional Soldier. There is no reason the Scoundrel, which is a class destined to get itself in combat regularly should be completely inept at hitting enemies (in K1 Scoundrels have the "untrained" attack tables). True Scouts are more resilient for taking damage because of their survival training, but Scoundrels are very experienced at blaster duels in cantinas typically, over a bit of cheating or an overdue debt, and generally spending their careers hanging around a violent criminal element and dealing with bounty hunters. Don't underestimate a Scoundrel with a blaster in his hand but don't expect him to go walking through a battlefield untouched.
Tech Specialist is another WotC class and these form all the mundane specialisations of Scientist, Starship Mechanic, Weapons Developer and Surgeon in the Star Wars galaxy. Put simply they are not trained combatants, they use the untrained attack tables but can take a few hits and are brilliant where skill use becomes involved. You don't put one at the front of combat (which would be stupid, who's going to heal your men or modify your weapons if killed), but it's not like they can't armour up and shoot a weapon if jumped...and actually are likely to wear pretty nice suits of armour and play the role of battlefield healer and security specialist or computer slicer.
Expert Droids have no combat programming but their advanced technological nature makes even the average droid as capable at hitting a target as an "average combatant" due to standard multispectral photoreceptors, logic programming and other mundane features. Of course military and Combat Droids of any type have the same attack tables as a professional Soldier due to specialised programming and combat features and are tougher than biological humanoids on hit die.
All Prestige classes of any type advance using the combat tables of professional Soldiers to reflect their extreme development of lightsabre and all combat forms regardless of specialisation in their use of the Force. Their tabletop equivalents are WEG Jedi Battlemaster for the Weapon Master, WotC Jedi Investigator for the Jedi Watchman, WotC Jedi Master for the Jedi Master, WotC Sith Warrior for the Sith Marauder, WotC Sith Adept for the Sith Assassin and WotC Sith Lord for the Sith Lord. It is a severe mistake to get into a combat duel with any of them using any kind of weapon, any of these prestige classes will walk through a battlefield of mere mortals, armed with a wooden tree branch or nothing at all, then Force-something you to bits and crack a one-liner.
Other tabletop classes like Force Adept (typically something like a Baran Do Savant or an Ithorian Healer) and Dark Side Marauder (non-Jedi quixotic Force user with Dark Side leanings) do not appear as selectable classes in TSL. The WEG class-template of Miraluka Jedi Healer would be a specialisation of Jedi Consular or Jedi Sentinel and is mostly about feat/skill/power selection rather than class abilities as such.
Force training (restored and modified)
The Force-feats Control, Sense and Alter have been restored. These are required to learn other Force powers and appear in the Force power tab at the level up screen. They are awarded automatically upon attaining Jedi levels and work to restrict the type of Force powers each Jedi class has available at various levels. These reflect the various mental disciplines involved in Force training, between the different Jedi classes.
Control powers are those which the Jedi uses to manifest the Force within himself. Powers like Burst of Speed and Force Aura are a Control feat. Jedi Guardians learn Control when they start taking Force powers (Jedi begin learning Force powers from 2nd level). Jedi Sentinels learn Control at 6th level. Jedi Consulars learn Control at 12th level.
Sense powers are any which involve telepathic contact or projection through the Force. Precognition and Force Sight are examples of Sense powers although these are Quest powers in the game. The character function of the Sense feat will become clear if you read on. Jedi Consulars learn Sense when they begin taking powers, Jedi Guardians learn Sense at 6th level and Jedi Sentinels learn Sense at 12th level.
Alter powers are the telekinetic use of the Force to manipulate matter. Force Push is an Alter power. Jedi Sentinels learn Alter when they start taking Force powers, Jedi Consulars learn Alter at 6th level and Jedi Guardians learn Alter at 12th level.
Combinations of the Force feats are required for most of the Jedi powers, since they are complicated and almost arcane in nature. It is like requiring math, physics and chemistry to engineer a fuel system, just one of these skills won't do.
Both Control and Sense are required to learn powers like Cure, Force Valor or Drain Life because they affect others near the Jedi but bolster or siphon with the Force rather than altering things as such.
Control and Alter are required to learn powers like Stun Droid or Force Barrier because they require the Jedi to affect either a droid's circuitry or form a telekinetic bubble around himself.
Sense and Alter are required to learn powers like Mind Trick or Force Lightning, because the Jedi must either give someone a false perception or draw upon the Living Force and manifest it electrically.
By 12th level all Jedi classes have the three Force feats and all powers are available to them. Some require Control, Sense and Alter to select and these are powers like Affect Mind, Stun/Stasis and Revitalise because these represent the highest tier of Force use, stopping an enemy cold and immobilising him in his tracks, or influencing the decisions of strangers with overwhelming finality, or bringing a patient back from coma or critical injury, even a mortal wound.
As you can quickly decipher, the different Jedi classes thus have entirely different Force power selections available until they get to 12th level, which forms the character of each class in the way they learn to use the Force.
Force power selection (restored content)
All Force powers which are not Quest powers or Forms are available to Jedi of any alignment during Force power selection, the only restrictions are Jedi level requirements for the power, and Force feat requirements for the power. This is an important feature.
Canonically Jedi knew how to use the Dark Side of the Force (but not necessarily specific powers requiring specialised training), any Jedi who can use telekinetic powers to move an object can also learn to use it to crush an opponent's windpipe. It is simply a choice Lightsiders make never to use the Force in this way, no matter how tempting it might be. Darksiders forego this self-discipline.
Both Lightsiders and Darksiders invariably know how to use several powers of opposing alignment. It simply costs many more Force Points to use powers which are extremely opposed to your current alignment. The Force Point cost for using opposite alignment powers has been increased.
Due to the way TSL was released it was possible to for Lightsider characters to only select Light Side powers during level up and vice versa. This is changed.
Because of the Force feat requirement all Jedi classes will run out of Force powers to select at the lower levels. Once you run out of powers suited to your alignment, you will be forced to begin selecting powers of opposing alignment or else you will not be able to continue from the level up screen. The challenge is not to give into temptation at the lower levels, when your selection of Force powers is greatly limited and a Dark Side power you were forced to select might be the most useful in combat. The PC is forced to know these things, but will he/she actually use them?
It is now much easier even for Lightsider Players to fall to the temptations of the Dark Side using the restored content system of Force training.
There is also the simple truth that sometimes Jedi level up at low-mid level without learning any new Force powers. Once you have run out of powers which are available due to your Force feats, particularly at low levels you will simply level up with no new powers until you gain new Force feats with which to make new powers available to you. This is not a bug, but reflects the dedicated and sometimes difficult training of the Jedi, who at higher character levels become simply the most powerful figures in the galaxy but often need the help of companions and allies at lower levels. Jedi are powerful later, but are not Gods from the getgo and many fall along the way.
This gameplay system is canonical to the tabletop RPG from which the Aurora shell (game programming) was evolved.
Gameplay changes (modified content)
There are a series of 2da edits and some dialog lines to bring the restored gameplay together so it works nicely and provides a complete mod suitably changing TSL into something a little more for genuine RPG gamers. It's all done using the Patcher so there's no compatability issues.
Already mentioned the villains have been tweaked slightly which combines well with the enhanced classes combat tables. Jedi Guardians and professional Soldiers are still a force to be reckoned with but Scoundrels and Scouts don't have so much stacked against them as with most difficulty level tweaks that are around, they can still make good headway with an effective use of class abilities, or with good tactics and not too much micro-management can still hold their own in a stand up fight. All up the challenge level overall is higher for good character play and more interesting, without the extremes of being either too arcade style with no class ability recognition or totally hardcore and needing the end-combat-round autopause switched on.
Also mentioned the Force Points cost of using opposed alignment powers has been increased incrementally, so it's not until you're really a full Darksider or Lightsider that opposite alignment powers get extremely costly to use, but once you commit fully to the dark or light, they do.
There are some minor changes to the class skills of the Jedi classes. Canonically Jedi Sentinels travelled the furthest reaches of the galaxy independently in Courier Ships and relied upon their own repair skills if stranded, and were renowned for customising their lightsabres. By 6th level they have access to healing powers anyway so I switched the Treat Injury skill to Repair. Characters may still spend points in Treat Injury as a cross class skill or spend a mundane feat to turn it into a class skill, but as far as strict class specialisation goes the Jedi Sentinel's job isn't to go around healing people with medpacks, but to investigate rumours of the Sith or their artefacts and report to the Council, they aren't even supposed to enter combat unless it can't be helped.
I made a slight adjustment to the visual effects animations because the Flurry and similar regular feats annoyed me with their glowing effects. They aren't Force powers and the regular animations without the glowing hands types of effects look much more realistic and in character. Force effects visuals have been retained, so it is not identical to Shem's similar standalone mod but has the same inspiration.
The experience table progression has been slightly tweaked so level progression at higher levels is slightly faster. It just smoothly puts you a couple of levels up from standard gameplay whilst you're still in a position to enjoy the extra features and classes mastery as a player, just before the epilogue modules. You get to show off a bit towards the end there when there are still regular bystanders around to gape at your awesomeness. In vanilla gameplay by the time you get totally awe-inspiring you're into the epilogue and nobody is around to see it.
Some NPC templates had to be changed as well. Sion at Korriban, Nihilus on the Ravager and Visas when she joins your party all needed to have their Force powers, skills and abilities changed to reflect canon set down by the game. Sion needed Sith Marauder abilities, Nihilus Sith Assassin ones, and Visas didn't have Force Sight and needed adjustments on power selection for the Control/Sense/Alter availability feats.
When in combat with Sion and Nihilus, whilst their hit die and combat tables are controlled by active game balancing, at least their available powers/abilities are changed and this alone makes them much more interesting opponents if the AI is doing the battle well. I had a great fight with Nihilus once just after installing this tweak where he used many new powers I gave him which the 2da template really should've already had to begin with.
Basically the vanilla game drops the ball on the Prestige classes by having them only available to the Player/Exile and this falls down when facing the Sith Lords themselves, who have their 2da templates geared for regular Jedi classes with no Prestige class abilities except during scripted cutscenes. The fact all they then have is bumped up hit die and combat tables seems unimaginative in my view so I gave them the abilities of the Sith Prestige classes for use by the combat AI scripts.
I changed the classes of recruited Jedi more in keeping with the altered gameplay system and their respective personalities. Bao Dur now becomes a Jedi Sentinel, Atton a Jedi Guardian and Disciple a Jedi Consular. I could not script selectable Jedi class recruitment because it would've conflicted with TSLRCM and I'm a newb at scripting.
Also the Dark Side powers of Drain Life and Force Drain have had their damage caps raised just like in Paragon's mod. It used to be capped at 10pts but is more like 50pts now, which suits the power of these dark abilities.
Installation
Just run the Patcher and follow the instructions. I'm not sure if the dialog.tlk file in your TSL game directory will be backed up by the Patcher so please backup your original copy of this file before hitting the okay button for mod installation.
Disclaimer
All copyrights are held by their respective owners, this mod is unsigned and not affiliated with LucasArts or Obsidian. Just a personal touch, use at your discretion and own risk. This mod may cause sexual sterility if taken intravenously.
Credits
Everyone at Holowan Labs, Fred Tetra for KotorTool, Stoffe for the Patcher and her scripting assistance (are you single stoffe? call me). The mod community. Kotorfiles and the staff. You know, everyone who makes modding this fun game possible and points the way on how to do it, hosts the mod sites, etc.
Any probs PM me at Holowan Labs, user name Vanir
Yes, that's it. But which script is the level-up script? Is c_pc_level.ncs used for all the party, the Exile and companions (I can just add a script reference in there) or do the companions have their own level up script separate from the Exile (where I'd need to add a script reference also)?
The c_pc_level.ncs is just a check script,usually used for dialog checks. I did some checking and not sure if there is a script that runs from the gui screen for leveling up or at least I can't find it. It's possible that part is hard coded into the level up screen and not able to be modified.
Thanks mate, I really appreciate the responses from such well known/respected modders here...I'm biting my nails, being such an ambitious mod, not really that complex, but certainly changes the gameplay heaps.
I'll find some other imaginative way around this if it is the case. Time to get out my Indiana Jones hat and do some digging...
hmm...I'm pretty sure I can get to it through the k_inc_generic.ncs for constant checking or use the dialog.tlk with a tag as my level up screen trigger...just thinking on paper and stumbling in the dark here but that seems logical at first glance as I figure out creative scripting for TSL...
Edit
I have new script probs
Can a more experienced scripter have a look over this and tell me where I'm going wrong? You should be able to see what I'm trying to do.
const int G_FORCE_POWER = 1; // spells.2da line number, shouldn't this be the name (260 in this case)?
void main() {
object oPC = GetFirstPC();
if (GetSpellAcquired(G_FORCE_POWER, oPC)) {
return;
}
// I want to grant this power to the Jedi Guardian at 2nd level
int CLASS_TYPE_JEDIGUARDIAN(int iClass);
int i;
int iJediLvl = 0;
for (i = 1; i <= 2; i++) {
int iClass = GetClassByPosition(i, oPC);
if ((iClass != CLASS_TYPE_INVALID) && CLASS_TYPE_JEDIGUARDIAN(iClass)) {
if (GetLevelByClass(iClass, oPC) > iJediLvl) {
iJediLvl = GetLevelByClass(iClass, oPC);
}
}
int G_LEVEL_REQ = 2;
if (iJediLvl >= G_LEVEL_REQ) {
GrantSpell( G_FORCE_POWER, oPC );
}
}
// I want to grant this same power to the Jedi Sentinel at 6th level
int CLASS_TYPE_JEDISENTINEL(int iClass);
for (i = 1; i <= 2; i++) {
int iClass = GetClassByPosition(i, oPC);
if ((iClass != CLASS_TYPE_INVALID) && CLASS_TYPE_JEDISENTINEL(iClass)) {
if (GetLevelByClass(iClass, oPC) > iJediLvl) {
iJediLvl = GetLevelByClass(iClass, oPC);
}
}
int G_LEVEL_REQ = 6;
if (iJediLvl >= G_LEVEL_REQ) {
GrantSpell( G_FORCE_POWER, oPC );
}
}
//I want to grant this power to the Jedi Consular at 12th level
int CLASS_TYPE_JEDICONSULAR(int iClass);
for (i = 1; i <= 2; i++) {
int iClass = GetClassByPosition(i, oPC);
if ((iClass != CLASS_TYPE_INVALID) && CLASS_TYPE_JEDICONSULAR(iClass)) {
if (GetLevelByClass(iClass, oPC) > iJediLvl) {
iJediLvl = GetLevelByClass(iClass, oPC);
}
}
int G_LEVEL_REQ = 12;
if (iJediLvl >= G_LEVEL_REQ) {
GrantSpell( G_FORCE_POWER, oPC );
}
}
}
I'm using trial and error. At the moment what I need to know is if I can't use CLASS_TYPE_JEDIGUARDIAN as a function, how do I script to check for the level in a specific Jedi class?