Jump to content


Photo

WeiDU feature request


  • Please log in to reply
12 replies to this topic

#1 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 09 March 2004 - 09:40 AM

In WeiDU, strings are delimitated by ~~, "" or %%. Is this feature available also for conditions or actions? E.G.:

IF "Global("myglobal","global",1)" THEN hello
SAY "Hi!" 
IF "" THEN DO "SetGlobal("MYglobal","global",2)" REPLY "Hi!" EXIT 
END

is this valid or not? If not, would you please allow this syntax (and, by extension, also the

IF %Global("myglobal","global",1)% THEN hello
SAY %Hi!% 
IF %% THEN DO %SetGlobal("MYglobal","global",2)% REPLY %Hi!% EXIT 
END
one?)
In italian, writing that little state with the ~ would require me to do alt+0126 every single time.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#2 MagusWizardo

MagusWizardo

    Don't ask... please don't ask.

  • Member
  • 201 posts

Posted 12 March 2004 - 12:52 AM

IF "GLOBAL(...)" THEN ...
Causes problems which IF ~GLOBAL(...)~ does not - so, I'd say no it doesn't work. SAY "Hi" and REPLY "Hi" (or %Hi%) work fine, though.

#3 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 12 March 2004 - 06:20 AM

IF %Global("myglobal","global",1)% THEN hello
SAY %Hi!% 
IF %% THEN DO %SetGlobal("MYglobal","global",2)% REPLY %Hi!% EXIT 
END
does this work or not? If not, would it be possible to make that way correct? it takes me about 1/2 of the time it would take to write

IF ~Global("Myglobal","global",1)~ THEN hello
SAY ~Hi!~ 
IF ~~ THEN DO ~SetGlobal("MYglobal","global",2)~ REPLY ~Hi!~ EXIT

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#4 -Guest-

-Guest-
  • Guest

Posted 12 March 2004 - 08:21 AM

IF %Global("myglobal","global",1)% THEN hello
SAY %Hi!% 
IF %% THEN DO %SetGlobal("MYglobal","global",2)% REPLY %Hi!% EXIT 
END
does this work or not? If not, would it be possible to make that way correct? it takes me about 1/2 of the time it would take to write

IF ~Global("Myglobal","global",1)~ THEN hello
SAY ~Hi!~ 
IF ~~ THEN DO ~SetGlobal("MYglobal","global",2)~ REPLY ~Hi!~ EXIT

From the excellent WeiDU read me: "Strings are delineated by tildes or %% or "" (your choice, but WeiDU uses the tilde by default)."

The only caveat as the string cannot contain the character used to quote the string. So "Global("myglobal","global",1)" will fail, as the string itself contains '".' As would %Does 200% percent damage,% or ~That's ~really~ tough.~

So yes, your example should work, provided the string doesn't contain '%.'

#5 weimer

weimer
  • Member
  • 1569 posts

Posted 12 March 2004 - 03:42 PM

does this work or not?

Why not try it out? :-) It took me about 8 seconds to copy your code into a text file, put "BEGIN FOO" at the top and run WeiDU on it.

Yes, it works. :-)

If you have any other recommendations for non-US support, let me know. One thing I was considering was allowing you to specify your own delimiter for strings. I'll do that if ~, " and % end up being insufficient.

#6 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 14 March 2004 - 12:40 AM

Why not try it out? :-) It took me about 8 seconds to copy your code into a text file, put "BEGIN FOO" at the top and run WeiDU on it.

I tried to, but failed (I wan't working on this example, I was working on 60 pages of code, so maybe there were some other noob errors...). Also, another problem is that the computer I use to write code is not the one on which BG2 is installed (yes I have big problems in efficient life organization).
BTW, if anybody wants to check my 60 pages of stuff to check for the stupid error I've put in, please let me know :unsure:

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#7 weimer

weimer
  • Member
  • 1569 posts

Posted 15 March 2004 - 05:54 PM

Why don't you tell us what error WeiDU is reporting (quote verbatim) and then quote 20 lines of your file, the ten around the line reported with the error?

It is possible to run WeiDU even if BG2 is not installed (using the --nogame option), but it's difficult to test-compile scripts that way. D files work fine, though.

#8 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 18 March 2004 - 05:16 AM

After discovering the --log feature, I have checked my .d. It was full of states ending without END. Of course the fault was mine. sorry for the trouble caused.

But I've found something strange:
when traifying this section
CHAIN
IF ~Global("spoken","locals",0)~ THEN tb#lich willkillyou
~Ah, heroes. Fool enough to torment me.~ = ~Don't you agree, my pet?~ DO ~SetGlobal("spoken","locals",1)~
== tb#terry ~RARGH! KILL! EAT!~
== tb#lich ~Yes, you will eat them as soon as they lie dead on the ground.~ =  ~Anyway, you have time enuoght to speak your prayers and say your last words.~
== MAZZYJ ~Die, foul monster. Arvoreen is on my side! She had granted me power you dare not dream of!~
== JANJ IF ~InParty("jan")~ THEN ~They say I can kill people with chattering. Let's see if this is real.~ = ~Uncle Scratchy had a Hamster, and ate it for supper. Thus, I always wanted to have an hamster of my own...~
== MINSCJ IF ~InParty("jan") InParty("Minsc")~ THEN ~YOU DID WHAT? GIVE ME BOO NOW!~
== JANJ IF ~InParty("jan") InParty("Minsc")~ THEN ~It wasn't me, it was Uncle Scratchy.~
== JANJ IF ~InParty("jan")~ THEN ~Anyway, after then Uncle Scratchy's breath was really powerful. Dare not cross him, lichling!~
== tb#lich ~Ah, powers I do fear. SILENT, AND TASTE MY CHAIN CONTINGENCY: REMOVE MAGIC - 2 ABI DALZIMS, ON ENEMY SEEN.~ = ~Alas, a rat had biten me this morning, and that contingency had flied on him;~ = ~he also was a scripting-rat-thusly-immune-to-magic, so I had depleted a lot of spells on him.~ = ~At last, I morphed to a Mind Flayer and ate his brain.~ = ~It tasted of... turnips.~
== JANJ IF ~InParty("jan")~ THEN ~TURNIPS? HOW DARE YOU BE SO STUPID?~ = ~WATER turnips, EARTH turnips, SCYLISTHAN turnips, MAGIC turnips or JANSEN turnips?~
== tb#lich IF ~InParty("jan")~ THEN ~Hmm... fire ones.~
== tb#lich ~Didn't it ever happen to you, that your anti-hero has ran out of spells before you fought him, thus being weaker than he should?~
== MAZZYJ ~Please, lich, stop talking, as <CHARNAME> will anyway have problems beating you, so he will prefer a shorter dialogue to hasten the reload process.~
== tb#lich ~Ah yes? Should I be shorter in what I say, to hasten my death?~ = ~NEVER!~
== MAZZYJ ~Does he NEVER stay silent? But I like his game: <CHARNAME>, be prepared to taste the record of the longest dialogue you'll ever read~
== tb#lich ~I thought entering the slums with twenty thousand gold was enough pissing for him...~
== MAZZYJ IF ~GlobalLT("chapter","global",4)~ THEN ~I bet that all the sequence Desharik-Spellhold-Irenicus-Candlekeep-Irenicus-Bodhi-Imoen will be longer.~
== MAZZYJ IF ~GlobalGT("chapter","global",3)~ THEN ~All the sequence Desharik-Spellhold-Irenicus-Candlekeep-Irenicus-Bodhi-Imoen WAS longer.~
== MAZZYJ ~and entering ascension, trying to redeem Irenicus and failing is something really pissing... Especially when that battle will be fought twenty times...~ = ~At least *my* *pervert* had avoided cutscenes...~
== MINSCJ IF ~InParty("minsc")~ ~All the mission in which Boo is going to be kidnapped will be even longer.~ = ~(Go and download unfinished business...)~
== JANJ IF ~InParty("jan")~ ~A simple banter of mine is good enough for any record.~ 
== tb#lich ~Yes, that is a nasty record... It seems that your enemy hate you both in long-winded dialogues and cutscenes~ = ~(But here I will take the record)~ = ~and in cheating you off. Well, I was cheated *against*~ = ~the pervert who created me gave you scrolls of protection from magic~
== MAZZYJ IF ~Global("Mazzyisgoingtobeapaladinkit","global",2)~ THEN ~Uh... I chose the sword...~
== MAZZYJ IF ~Global("Mazzyisgoingtobeapaladinkit","global",3)~ THEN ~Oh, you are right...~
== MAZZYJ IF ~Global("Mazzyisgoingtobeapaladinkit","global",4)~ THEN ~No... not protection from magic, but protection from Undead is enough, I think...~
== tb#lich ~Yes, he was pervert.~ = ~I'm tired of this conversation~
END tb#lich loop

windows gives me this error message (the message was in Italian, so the translation could be not completely correct, but I've done my best):
WEIDU has caused an error of not correct page in the module WEIDU.EXE in 0167:0045001a.
Registers:EAX=00472648 CS=0167 EIP=0045001a EFLGS=00010246
EBX=00973130 SS=016f ESP=006efc80 EBP=00000003
ECX=00000001 DS=016f ESI=00000003 FS=59ef
EDX=00472648 ES=016f EDI=00b91120 GS=0000
Byte at the address CS:EIP:
8b 41 fc 8b 72 fc c1 e8 0a c1 ee 0a 3b c6 74 08 
Image of the stack:
00b91120 00000003 0045006f 00000001 00472648 00404c72 00000001 00472648 009948e0 00973130 00441515 0093fa3c 00973130 00408d93 006efda8 00408a41


However, after deleting these two lines:
== MINSCJ IF ~InParty("minsc")~ ~All the mission in which Boo is going to be kidnapped will be even longer.~ = ~(Go and download unfinished business...)~
== JANJ IF ~InParty("jan")~ ~A simple banter of mine is good enough for any record.~
it works fine.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#9 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 18 March 2004 - 05:54 AM

However, after deleting these two lines:

== MINSCJ IF ~InParty("minsc")~ ~All the mission in which Boo is going to be kidnapped will be even longer.~ = ~(Go and download unfinished business...)~
== JANJ IF ~InParty("jan")~ ~A simple banter of mine is good enough for any record.~
it works fine.

I think you're missing a couple of THENs:

== MINSCJ IF ~InParty("minsc")~ THEN ~All the mission in which Boo is going to be kidnapped will be even longer.~ = ~(Go and download unfinished business...)~
== JANJ IF ~InParty("jan")~ THEN ~A simple banter of mine is good enough for any record.~

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#10 weimer

weimer
  • Member
  • 1569 posts

Posted 18 March 2004 - 11:54 AM

The "THEN" in the optional conditonal of a CHAIN list is optional.

I can reproduce this problem. Working.

#11 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 19 March 2004 - 05:31 AM

I think you're missing a couple of THENs:

WEIdu would have told me in polite english in the log file, it wouldn't have spawned a nasty list of exadecimal values.

Weimer, I can e-mail you the whole .d if it is needed. I'm using WEIdu version 150.

EDIT: the problem is still up with version 153

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#12 weimer

weimer
  • Member
  • 1569 posts

Posted 24 March 2004 - 04:59 PM

Grr, this problem actually appears to be with the OCaml parser generator. Sigh. It's non-trivial to track down.

#13 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 25 March 2004 - 04:58 AM

Well... good luck.
As a payoff, would you accept whole italian TRAs for all of your BG2 & IWD2 mods?

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.