Pocket Plane Group

Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: The_Swordalizer on May 09, 2005, 11:48:14 AM

Title: Strings and things
Post by: The_Swordalizer on May 09, 2005, 11:48:14 AM

If I want to add some strings that aren't in a .dlg file (e.g. in a .baf file or whatever) what is the correct command in a .tp2 file? I remember seeing a command that let you write a string to specific StrRef, but how can you be sure that noone else has chosen that ref number for their mod??
Title: Re: Strings and things
Post by: Ghreyfain on May 09, 2005, 11:52:03 AM
I'm not entirely sure what you mean, but here's an example of text in a script.

The.baf file:

IF
  Global("SomeGlobal","GLOBAL",1)
THEN
  RESPONSE #100
    DisplayStringHead(Myself,~Ah, <CHARNAME>, at last we meet!~)
    SetGlobal("SomeGlobal","GLOBAL",2)
END

And in the .tp2 you'd have:

COMPILE ~mymod/scripts/the.baf~

You can also use .tra references in scripts like that.  DisplayStringHead(Myself,@1), for instance.
Title: Re: Strings and things
Post by: the bigg on May 09, 2005, 01:39:21 PM
Strings don't work inside BAFs, and you cannot traify a baf.
You'll have to use @ in a baf (or use the old cumbersome way of putting placeholder numbers and then using REPLACE)
Title: Re: Strings and things
Post by: Kismet on May 09, 2005, 01:49:16 PM
Strings don't work inside BAFs, and you cannot traify a baf.
You'll have to use @ in a baf (or use the old cumbersome way of putting placeholder numbers and then using REPLACE)

Yes, they do work inside bafs and yes you can traify a .baf.
Title: Re: Strings and things
Post by: the bigg on May 09, 2005, 02:00:40 PM
Yes, they do work inside bafs and yes you can traify a .baf.
False and false, I just run a test.

Code: [Select]
IF
  True()
THEN
  RESPONSE #100
    DisplayStringHead(Myself,"Hey this is a new string!")
END

Compiled with WeiDU and decompiled with WeiDU:
Code: [Select]
IF
  True()
THEN
  RESPONSE #100
    DisplayStringHead(Myself,0)  // ~<NO TEXT>~
END

traify-ed:
Code: [Select]
IF
  True()
THEN
  RESPONSE #100
    DisplayStringHead(Myself,"Hey this is a new string!")
END
Title: Re: Strings and things
Post by: Kismet on May 09, 2005, 02:40:58 PM
Ah, you can't use quotes to enclose the string.  Try again with tildes.
Title: Re: Strings and things
Post by: the bigg on May 09, 2005, 03:07:52 PM
Ah, you can't use quotes to enclose the string.  Try again with tildes.
I, err, umm...  :'( 
Damn Italian keyboard  :(
Title: Re: Strings and things
Post by: Idobek on May 10, 2005, 04:15:05 AM
Wrap 'em in %s.
Title: Re: Strings and things
Post by: the bigg on May 10, 2005, 05:15:07 AM
Wrap 'em in %s.
Well, there is no reason at all to use hard strings instead of tranlsation files, so I fail to see where is the problem in hard strings not working, after all   ;D
Title: Re: Strings and things
Post by: Idobek on May 10, 2005, 08:32:25 AM
Well, there is no reason at all to use hard strings instead of tranlsation files, so I fail to see where is the problem in hard strings not working, after all   ;D
I'm not entirely sure what you're talking about, but what I meant is that WeiDU will compile and traify bafs with strings wrapped in %s.
Title: Re: Strings and things
Post by: Grim Squeaker on May 10, 2005, 08:37:00 AM
Well, there is no reason at all to use hard strings instead of tranlsation files, so I fail to see where is the problem in hard strings not working, after all   ;D
I'm not entirely sure what you're talking about, but what I meant is that WeiDU will compile and traify bafs with strings wrapped in %s.

I think he's saying that he thinks there is no point not tra-ing files, which personally I feel is bollocks.  But oh well.
Title: Re: Strings and things
Post by: the bigg on May 10, 2005, 08:45:58 AM
I think he's saying that he thinks there is no point not tra-ing files, which personally I feel is bollocks.  But oh well.
Can I hire you as a Gibberish2English translator?  :P  ;D
Title: Re: Strings and things
Post by: The_Swordalizer on May 10, 2005, 08:47:17 AM
So I can use ~This is a string.~ inside a .baf? For some reason I thought that wouldn't work. Kewl.

Cheers all.
Title: Re: Strings and things
Post by: SConrad on May 10, 2005, 03:57:20 PM
So I can use ~This is a string.~ inside a .baf?

Short version of this thread: Yes. That and %String%. :)