
Increasing existing affects in characters
#81
Posted 08 November 2011 - 02:25 PM
In this IESDP page of the stats:
http://iesdp.gibberl...s/bg2/stats.htm
What's the one for move silently?
#82
Posted 08 November 2011 - 02:41 PM
in BG2 they split it. Stands to reason that where necessary (.2da files) they are labeled with the new names. Whereas in the IDS STATS file, the label is for convenience, the number is what matters. So most likely they gave HIDEINSHADOWS it's own number and left 'move silently' with the STEALTH number.
You could test that by assigning different values for the two stats in say shadowkeeper and then run a script in game that checks both those stats and see if STEALTH returns true for what you put in for 'move silently'
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
#83
Posted 08 November 2011 - 03:23 PM
EDIT: This is what i ended up for choosing the stats (missing stat feedback, that will probably slow down the start of the dialog.
1785 states is too much for the engine to handle?

It's awful, i've been warned:
Would be better to have a option to retry the point allocation in case of mistake, but that would be harder due to not being able to apply the effects as i go.
Edited by i30817, 08 November 2011 - 05:53 PM.
#84
Posted 08 November 2011 - 08:15 PM
137 StartDialog(S:DialogFile*,O:Target*) 137 StartDialogue(S:DialogFile*,O:Target*) 138 SetDialog(S:DialogFile*) 138 SetDialogue(S:DialogFile*) 139 PlayerDialog(O:Target*) 139 PlayerDialogue(O:Target*)to get the right dialog file which covers just that same 10 pt range Would shorten the size of the dialog file considerable...
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
#85
Posted 08 November 2011 - 09:02 PM
IF ~CheckStat(LastTalkedToBy, 254, STEALTH) AND GlobalGT("gt#pts", "GLOBAL", 0)~ REPLY @43 DO ~DialogueIncrementGlobal("gt#pts", "GLOBAL", -1) SetTokenGlobal("gt#pts","GLOBAL","TPOINTS") ApplySpellRES("GT#MVS1", LastTalkedToBy)~ GOTO 5
+ ~CheckStat(LastTalkedToBy, 254, STEALTH) GlobalGT("gt#pts","GLOBAL",0)~ + @43 DO ~IncrementGlobal("gt#pts","GLOBAL",-1) SetTokenGlobal("gt#pts","GLOBAL","TPOINTS") ApplySpellRES("GT#MVS1", LastTalkedToBy)~ + 5
Edited by cmorgan, 08 November 2011 - 09:07 PM.
#86
Posted 09 November 2011 - 01:47 AM
SetTokenGlobal("gt#bks", "GLOBAL", "BKS")
Then the global changes;
SetGlobal("gt#bks", "GLOBAL", 124)
will the <TOKEN> in strings display the old or the new value?
I'm going to find out as soon as i sort the compiler errors, but just as well ask before that.
Also, i have some problems with reading from the keyboard and SNPRINT:
PRINT @9 ACTION_READLN ~KEY~ PRINT ~KEY~ INNER_ACTION BEGIN SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ END //while not hotkey OUTER_WHILE NOT(~T&L_KEY~ STRING_MATCHES_REGEXP ~[A-Z]~) BEGIN PRINT @10 PRINT @9 ACTION_READLN ~KEY~ INNER_ACTION BEGIN SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ END ENDOr
PRINT @9 ACTION_READLN ~KEY~ PRINT ~KEY~ SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ //while not hotkey OUTER_WHILE NOT(~T&L_KEY~ STRING_MATCHES_REGEXP ~[A-Z]~) BEGIN PRINT @10 PRINT @9 ACTION_READLN ~KEY~ SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ ENDFail. I'm trying to get the variable as a single letter for the hotkeys.
Edited by i30817, 09 November 2011 - 02:04 AM.
#87
Posted 09 November 2011 - 02:52 AM
You set the variable T&L&P_KEY but try to check a variable T&L_KEY. You also need to evaluate KEY in the SNPRINT ("%KEY%"), or the result will always be K. The same goes for the variable you use in the STRING_MATCHES_REGEXP and the PRINTs. Yet another thing is that SNPRINT is a patch but you try to use it in the context of an action. Instead of using SNPRINT you can check the STRING_LENGTH.PRINT @9 ACTION_READLN ~KEY~ PRINT ~KEY~ INNER_ACTION BEGIN SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ END //while not hotkey OUTER_WHILE NOT(~T&L_KEY~ STRING_MATCHES_REGEXP ~[A-Z]~) BEGIN PRINT @10 PRINT @9 ACTION_READLN ~KEY~ INNER_ACTION BEGIN SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ END ENDOrPRINT @9 ACTION_READLN ~KEY~ PRINT ~KEY~ SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ //while not hotkey OUTER_WHILE NOT(~T&L_KEY~ STRING_MATCHES_REGEXP ~[A-Z]~) BEGIN PRINT @10 PRINT @9 ACTION_READLN ~KEY~ SNPRINT ~1~ ~T&L&P_KEY~ ~KEY~ ENDFail. I'm trying to get the variable as a single letter for the hotkeys.
Style-wise, you can also drop most of the wavy lines you are using. Aside from a few odd-ball cases you only need to use quotation marks/wavy lines around some special characters and when you want to evaluate string variables.
Edited by Wisp, 09 November 2011 - 03:03 AM.
#88
Posted 09 November 2011 - 07:07 AM
PRINT @9 ACTION_READLN ~KEY~ SNPRINT 1 ~T&L&P_KEY~ ~%KEY%~ //while not hotkey OUTER_WHILE NOT(~%T&L&P_KEY%~ STRING_MATCHES_REGEXP ~[A-Z]~) BEGIN PRINT @10 PRINT @9 ACTION_READLN ~KEY~ SNPRINT 1 ~T&L&P_KEY~ ~%KEY%~ END
No dice. Commenting the snprint makes it progress.
And doesn't readln come with the \n anyway? That's why i wanted the first char.
EDIT: Ended up with this:
PRINT @9 ACTION_READLN ~KEY~ OUTER_PATCH ~%KEY%~ BEGIN READ_ASCII 0 ~%T&L&P_KEY%~ (1) END //while not hotkey OUTER_WHILE NOT(~%T&L&P_KEY%~ STRING_MATCHES_REGEXP ~[A-Z]~) BEGIN PRINT @10 PRINT @9 ACTION_READLN ~KEY~ OUTER_PATCH ~%KEY%~ BEGIN READ_ASCII 0 ~%T&L&P_KEY%~ (1) END END
Edited by i30817, 09 November 2011 - 07:36 AM.
#89
Posted 09 November 2011 - 07:15 AM
As I said, SNPRINT is a patch (only syntactically valid within the scope of an open stream, I guess you could say). The context you are using it expects nothing but actions, so you get a syntax error. You can either put the SNPRINTs in OUTER_PATCHes or use something else (e.g., STRING_LENGTH). Another thing, STRING_MATCHES_REGEXP returns 0 on a match (eq. to logical false in this context), so your code will continue to ask for input until the user enters something invalid, rather than the other way around.No dice. Commenting the snprint makes it progress.
No, it should only contain the intended input.And doesn't readln come with the \n anyway? That's why i wanted the first char.
Edited by Wisp, 09 November 2011 - 07:26 AM.
#90
Posted 09 November 2011 - 07:38 AM
No need to get complicated
yet if you want to get complicated

I've been one known to do things the 'hard way'
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
#91
Posted 09 November 2011 - 08:34 AM
PRINT @9 ACTION_READLN KEYS OUTER_WHILE(~%KEYS%~ STRING_MATCHES_REGEXP ~^(.) ([^\1]) ([^\1\2]) ([^\1\2\3])$~) BEGIN PRINT @10 PRINT @9 ACTION_READLN KEYS END
How can i extract a capturing group of a regex, or does weidu not support that?
and regex negation?
Bizarrely, when i was using ~^[A-Z]$~ as a regular expression, it matched the Enter key. I don't suppose it is supposed to do that...
EDIT: wait i saw wisp message about the not.
Edited by i30817, 09 November 2011 - 08:54 AM.
#92
Posted 09 November 2011 - 08:50 AM
INDEX and READ_ASCII. You can not use regexps directly for assignment. Also, you should have another look at the WeiDU regexp documentation. WeiDU regexps are more Emacs-like than Perl-like.How can i extract a capturing group of a regex, or does weidu not support that?
Edited by Wisp, 09 November 2011 - 09:23 AM.
#93
Posted 09 November 2011 - 09:12 AM
Edit: works great thanks:
PRINT @9 ACTION_READLN KEYS //while not hotkey OUTER_WHILE(~%KEYS%~ STRING_MATCHES_REGEXP ~^\(.\) \([^\1]\) \([^\1\2]\) \([^\1\2\3]\)$~) BEGIN PRINT @10 PRINT @9 ACTION_READLN KEYS END OUTER_PATCH ~%KEYS%~ BEGIN READ_ASCII 0x0 NM_KEY (1) READ_ASCII 0x2 M_KEY (1) READ_ASCII 0x4 F_KEY (1) READ_ASCII 0x6 S_KEY (1) END
Edited by i30817, 09 November 2011 - 09:26 AM.
#94
Posted 09 November 2011 - 10:27 AM
You ask for 4 different hotkey values all at one time? I woulda asked 4 times in a row. yeah code would have been longer, but user wouldn't see that much difference... oh well looks like you got something working tho and that's all that mattersyeah, since i have 4 of the things, i thought to ask for a string and used the regular expression facility to extract them all at once and verifying they are all different.
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
#95
Posted 09 November 2011 - 11:11 AM
OUTER_WHILE( ~%KEYS%~ STRING_MATCHES_REGEXP ~^\(.\)\([^\1]\)\([^\1\2]\)\([^\1\2\3]\)$~ != 0 OR ~%KEYS%~ STRING_MATCHES_REGEXP ~^[A-Z][A-Z][A-Z][A-Z]$~ != 0 ) BEGIN PRINT @10 PRINT @9 ACTION_READLN KEYS END
What i want, is a sequence
ABCD
of upper cased letters without spaces that doesn't repeat
But it appears to be accepting "aaaa"
Did i misinterpert the ^ symbol inside a [] ? That's what is usually used for group negation in regexes.
#96
Posted 09 November 2011 - 11:41 AM
Edited by i30817, 09 November 2011 - 11:57 AM.
#97
Posted 09 November 2011 - 11:57 AM
Well, first problem, WeiDU regexps are not case-sensitive. But you can force the string to upper case with TO_UPPER KEYS. However, I would advise you to not use variable names all in upper case. Tomorrow KEYS may be the name of a new WeiDU function and you would have to change your code. This is one case where you would need to qualify your variable name by using quotes or wavy lines, but it is easier using something else.of upper cased letters without spaces that doesn't repeat
\1, \2 etc are treated literally, as a backslash followed by a number, inside character sets. They do not match preceding groups.Did i misinterpert the ^ symbol inside a [] ? That's what is usually used for group negation in regexes.
To check for distinctness you can use some regular tp2 code.
¡"%char2%" STRING_EQUAL "%char1%" AND !"%char3%" STRING_EQUAL "%char1%" AND !"%char3%" STRING_EQUAL "%char2%" //and so on
Edited by Wisp, 09 November 2011 - 12:12 PM.
#98
Posted 09 November 2011 - 12:09 PM

Got it into a rather standard cascading if chain inside a while, and ... i guess i was mistaken about the IF statement. Only PATCH_IF exists? But i'm not patching anything.
edit ah ACTION_IF of course.
Edited by i30817, 09 November 2011 - 03:48 PM.
#99
Posted 10 November 2011 - 09:47 AM
How can i force evaluation of vars inside ~Mystring with vars~ before i concat it to the old string?
Edit 2:
Any reason the ^ concat would make this code fail? (uncommenting them makes it not compile)
First error appears to be:
SET levelup_string = ""
"ERROR: cannot convert or %% to an integer"
How are we supposed to declare string vars?
Edited by i30817, 10 November 2011 - 02:11 PM.
#100
Posted 10 November 2011 - 03:32 PM