Author Topic: Strings and things  (Read 2057 times)

The_Swordalizer

  • Guest
Strings and things
« 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??

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Strings and things
« Reply #1 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.
Earn Money Sleeping.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Strings and things
« Reply #2 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)
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: Strings and things
« Reply #3 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.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Strings and things
« Reply #4 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
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: Strings and things
« Reply #5 on: May 09, 2005, 02:40:58 PM »
Ah, you can't use quotes to enclose the string.  Try again with tildes.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Strings and things
« Reply #6 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  :(
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Idobek

  • Dust Bunny
  • Planewalker
  • *****
  • Posts: 431
  • Gender: Male
Re: Strings and things
« Reply #7 on: May 10, 2005, 04:15:05 AM »
Wrap 'em in %s.
The Gibberlings Three Forums

<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Strings and things
« Reply #8 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
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Idobek

  • Dust Bunny
  • Planewalker
  • *****
  • Posts: 431
  • Gender: Male
Re: Strings and things
« Reply #9 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.
The Gibberlings Three Forums

<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: Strings and things
« Reply #10 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.
"You alone can make my song take flight..."

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Strings and things
« Reply #11 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
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

The_Swordalizer

  • Guest
Re: Strings and things
« Reply #12 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.

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Re: Strings and things
« Reply #13 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%. :)
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: