OtisTDog Posted May 21, 2009 Share Posted May 21, 2009 Hello, all -- I finished my first dialog and am working on my first script. It's actually doing what I want it to, thanks to all of the great info on IEDSP and these forums. I have a question about the use of the DisplayString() action in the context of BG:TotSC scripting. It appears you have to provide a specific StrRef value in the call, which is fine if you want to make use of an existing string -- but how do you insert your own string? It does not appear that I can just insert the string I want and have it automatically compiled by WeiDU, as will work with dialog changes. It seems as though I have to somehow get the string built in, then ID the number of that string, then provide that number to the call. Any hints on how the pros handle this? My only ideas so far seem pretty kludgey, and like they would probably break if I make further changes and recompile (which might change the strref for the target string). --Otis Link to comment
erebusant Posted May 21, 2009 Share Posted May 21, 2009 Hello, all -- I finished my first dialog and am working on my first script. It's actually doing what I want it to, thanks to all of the great info on IEDSP and these forums. I have a question about the use of the DisplayString() action in the context of BG:TotSC scripting. It appears you have to provide a specific StrRef value in the call, which is fine if you want to make use of an existing string -- but how do you insert your own string? It does not appear that I can just insert the string I want and have it automatically compiled by WeiDU, as will work with dialog changes. It seems as though I have to somehow get the string built in, then ID the number of that string, then provide that number to the call. Any hints on how the pros handle this? My only ideas so far seem pretty kludgey, and like they would probably break if I make further changes and recompile (which might change the strref for the target string). --Otis You need to provide a .tra file for your script, and code it like thus: IF Entered([ANYONE]) GlobalLT("BHGnollQuest","GLOBAL",2) THEN RESPONSE #100 DisplayString(Myself,@300) SetGlobal("BHGnollQuest","GLOBAL",2) END Link to comment
OtisTDog Posted May 21, 2009 Author Share Posted May 21, 2009 You need to provide a .tra file for your script Ah. I haven't looked at that stuff at all since I thought it was just for translations. I'll check it out -- thanks! --Otis Link to comment
Icendoan Posted May 21, 2009 Share Posted May 21, 2009 You can also use REPLACE, like this: // BAF File IF True() THEN RESPONSE #100 DisplayString(100000000) END in conjunction with: // TP2 File //rest of your mod COMPILE ~myMod/myBaf.baf~ REPLACE ~100000000~ ~newString~ //and it should update the strings, replacing your nonsensical number with the one you want :) Icen Link to comment
Wisp Posted May 22, 2009 Share Posted May 22, 2009 You can use DisplayString(Myself,~String~). REPLACE is not necessary. Link to comment
OtisTDog Posted May 22, 2009 Author Share Posted May 22, 2009 You can use DisplayString(Myself,~String~). REPLACE is not necessary. Hey, great! I had tried this originally, but I got a compile error. Must have been some other issue causing the error, because this approach is working fine now. Thanks very much! --Otis Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.