[MOD] (WIP) Remove Specialist Restrictions (does not work)
NicolBluetooth
Member Posts: 48
Alright, so six years ago, I started working on a mod to try to make the class specialization requirements of certain shop items and trainers also available to players with high enough levels in those classes, so you didn't have to choose between them.
I looked at aquadrizzt's mods and asked around on the forums to try to figure out how to do that. I gave up, then tried again a year later, then gave up again. I haven't touched this mod in almost five years now. As it is now, it does nothing; the best I could do was get it to compile without fatal errors.
I still want it to work, and I'm still willing to make it work, I just don't know how. I've purchased three separate versions of Planescape: Torment on GOG and Steam, but I haven't finished playing any of them yet because I had hoped to finish this first.
Now, I think I just need to figure out how to do two things I currently don't know how to do in order to make this work:
1. How to give the dialog response triggers syntactically correct boolean OR arguments.
2. How to make the sales triggers replacements work, because as they're scripted now, they currently do not.
If anyone feels willing and able to help in any way, or just wants to peruse my currently non-functioning code for one's own purposes, I've uploaded the tp2 script to this web address:
https://github.com/Mirrorman95/RemoveSpecialistRestrictions/blob/master/RemoveSpecialistRestrictions/Setup-RemoveSpecialistRestrictions.tp2
I looked at aquadrizzt's mods and asked around on the forums to try to figure out how to do that. I gave up, then tried again a year later, then gave up again. I haven't touched this mod in almost five years now. As it is now, it does nothing; the best I could do was get it to compile without fatal errors.
I still want it to work, and I'm still willing to make it work, I just don't know how. I've purchased three separate versions of Planescape: Torment on GOG and Steam, but I haven't finished playing any of them yet because I had hoped to finish this first.
Now, I think I just need to figure out how to do two things I currently don't know how to do in order to make this work:
1. How to give the dialog response triggers syntactically correct boolean OR arguments.
2. How to make the sales triggers replacements work, because as they're scripted now, they currently do not.
If anyone feels willing and able to help in any way, or just wants to peruse my currently non-functioning code for one's own purposes, I've uploaded the tp2 script to this web address:
https://github.com/Mirrorman95/RemoveSpecialistRestrictions/blob/master/RemoveSpecialistRestrictions/Setup-RemoveSpecialistRestrictions.tp2
0
Comments
1) Updating STO item sale triggers "itmres" has never been read from the resource, so it will always fail the IF-conditions.
The "or" operator in the script doesn't work like this. Instead there is a special script trigger OR(x) which instructs the interpreter to take the next x triggers into account for the OR operation. One notable exception is the NextTriggerObject() trigger which is ignored by the OR() counter.
Optional: To make the line a bit simpler you could also replace WRITE_LONG/RESOLVE_STR_REF with SAY which does the same as WRITE_LONG but automatically converts the given string into a strref.
2) Use dialog-specific WeiDU operations to manipulate dialog content DECOMPILE_AND_PATCH is a bit overkill if you just want to modify a couple of response triggers. Instead place dialog-specific commands into a separate .d file and use COMPILE in the tp2 script to apply the dialog changes.
The command to indiscriminately replace all matching response triggers is REPLACE_TRIGGER_TEXT ~dialog-name~ ~regexp-to-find~ ~replacement-string~
Example: This command uses a regular expression for the search-string. The first expression in square brackets is used to skip matching instances of Global() with a negation operator (!) in front of it.
The backslash-escaped parentheses in the search-string are used to group strings, so that they can be referenced in the replacement-string with "\1", "\2", ... placeholders. This will replace the placeholders with the grouped text in the search-string.