Author Topic: The language of "String"  (Read 2623 times)

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
The language of "String"
« on: March 08, 2006, 01:32:37 AM »
Ok, this is a fundamental question from a weidu idiot. How do I create journal entries?
Having consulted several tutorials, I'd imagine I have to create a d file and traify that into dialogue.tlk.

However, I am not sure what is the syntax for strings. In other words, what do I need to put at the beginning and the end of this text:

The Pocket Plane

An angel has brought me back to the Abyss to inform me, as far as I can tell, that my destiny as a Bhaalspawn is about to come to fruition.  But I am not quite ready, it seems.  My mind is not prepared to accept all the power of Bhaal's realm...and so it has created a demiplane of my very own, a cocoon by her description, in which I will have to prepare myself.

It appears that there is no obvious ways out. Perhaps if I overcome the present challenge, I will be able to assert more control over this place...
« Last Edit: March 08, 2006, 01:34:17 AM by notasophist »

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: The language of "String"
« Reply #1 on: March 08, 2006, 02:00:36 AM »
A normal script action for adding a journal entry is what?  AddJournalEntry(12345) ?

You'd have that in a .baf (.bcs script source) file packaged somewhere with your mod. Then you'd have WeiDU compile it during installation. The exception would be that instead of a predefined text string (12345), you'd have to use a .tra reference.

AddJournalEntry(@12345)

I'm assuming you know how .tra files work, for this.  Just ask if that needs clarifying.

So that's about that, unless I'm missing an important detail or seven.

 - .baf file with a .tra reference
 - .tra with the text string for the .baf
 - .tp2 to compile the .baf using the .tra
Earn Money Sleeping.

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: The language of "String"
« Reply #2 on: March 08, 2006, 02:17:54 AM »
Why exactly do you have to use .tra for Journal entries?  As far as I'm aware they work fine hardcoded, you just have to use something other than tildes if you're having the command in a dialogue, for example percentage signs
e.g.
Code: [Select]
IF ~~ THEN DO ~EraseJournalEntry(%ZOMG i r teh s0n 0f @ g0d

w00t!%)~
« Last Edit: March 08, 2006, 02:23:19 AM by Grim Squeaker »
"You alone can make my song take flight..."

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: The language of "String"
« Reply #3 on: March 08, 2006, 09:20:07 AM »
That may work, but it didn't always, plus which it means if you change the journal entry (proofreading, editing, whatever) now you have to remember to change it both where it's created and in all the places it gets erased.

Some things are worth learning to use .tra over, this is one of them.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
Re: The language of "String"
« Reply #4 on: March 09, 2006, 01:10:55 PM »
hmm.. apparently I don't know how .tra file works because i'm having a hard time complling d.files into .tra.  So, yeah. Some help/clarification would be most appreciated.

Offline Duality

  • Planewalker
  • *****
  • Posts: 147
Re: The language of "String"
« Reply #5 on: March 09, 2006, 02:46:30 PM »
Here's an example.

//This block is the .d file.
BEGIN dujug

IF ~NumTimesTalkedTo(0)~ THEN BEGIN intro
SAY @1 = @48
IF ~~ THEN REPLY @2 GOTO insulted
IF ~~ THEN REPLY @3 GOTO greet
IF ~~ THEN REPLY @4 GOTO lunatic
END



//This is what goes into the .tra file
@1  = ~Who are you? I~
@2  = ~Um. Hi.~
@3  = ~Go Away.~



//And this is the weidu script.
COMPILE ~imnesvale/dialogs/imnes.d~
USING ~imnesvale/english/imnes.tra~            //The using is so it knows where to look for the definitions of @1, @2 etc.
      ~imnesvale/%s/imnes.tra~


Basically, the tra file just lets you store all your strings in one file and you use their number to reference them. Actually, I wish I hadn't done it this way, since it makes it hard to follow the dialog sometimes.
"I'll try being nicer if you try being smarter."

"There is a certain freedom in being totally screwed. It means that nothing you do is going to make it any worse."

"Eagles may soar, but weasels don't get sucked into jet engines."

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: The language of "String"
« Reply #6 on: March 10, 2006, 01:06:35 AM »
Also check the WeiDU readme for instructions on how to automatically traify a .d or .baf or whatever that has regular strings and not .tra strings.
Earn Money Sleeping.

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
Re: The language of "String"
« Reply #7 on: March 10, 2006, 01:59:03 AM »
hmm.. so far i've failed to traify my d files. I keep on getting syntax errors. It's my first time doing scripting. Uh, so don't expect any weidu magic from me. It's gonna take a while. Methinks.

I managed to add in strings to the dialogue.tlk by using the TLKEditor. In my opinion, adding journal additions is easy as pie this way. However, i don't know how easy would it be to share the mod this way...  is it possible for weidu to extract strings from dialogue.tlk and comiple it later?

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: The language of "String"
« Reply #8 on: March 10, 2006, 04:14:07 AM »
I managed to add in strings to the dialogue.tlk by using the TLKEditor. In my opinion, adding journal additions is easy as pie this way. However, i don't know how easy would it be to share the mod this way...  is it possible for weidu to extract strings from dialogue.tlk and comiple it later?

Not easily at all.  If you're having trouble with .tra then I'd suggest doing it the way I suggested in my first post.  For more detail on that I'd suggest: Journal Entries for Dummies.
"You alone can make my song take flight..."

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
Re: The language of "String"
« Reply #9 on: March 10, 2006, 04:26:15 AM »
To Grim Squeaker:

I tried your way. In fact, it was the first thing i did. However, weidu kept on trying to find the added text from dialogue.tlk which, naturally, would not exist there. Thus, weidu won't let me compile it. Maybe I was doing something wrong?

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: The language of "String"
« Reply #10 on: March 10, 2006, 04:29:48 AM »
To Grim Squeaker:

I tried your way. In fact, it was the first thing i did. However, weidu kept on trying to find the added text from dialogue.tlk which, naturally, would not exist there. Thus, weidu won't let me compile it. Maybe I was doing something wrong?

Hang on.  Post the code for exactly what you did.  If you hardcode strings (e.g. ~Blah~ or %Blah& as opposed to @1) then WeiDU just adds the new strings as it goes.  There's no 'finding the next in the dialog.tlk' unless its a string you've already used.
"You alone can make my song take flight..."

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
Re: The language of "String"
« Reply #11 on: March 11, 2006, 12:22:49 AM »
Ok, here is what i have in my baf:

IF
  True()
THEN
  RESPONSE #100
    CutSceneId(Player1)  //
    CreateVisualEffectObject("SpGRWHRL","solar")
    PlaySound("EFF_M28")
    Wait(1)
    ActionOverride("Solar",DestroySelf())
    Wait(1)
    CreateCreature("CUTSPY",[1529.1248],0)  // <Invalid Strref -1>
    Wait(1)
    ReallyForceSpellRES("jwchnlgt","cutspy")  // <Invalid Strref -1>
    MoveViewObject("cutspy",8)
    Wait(2)
    CreateVisualEffectObject("SPHOLY","cutspy")
    SetGlobal("OpenRoom1","AR4500",1)
    Wait(2)
    SetGlobal("OpenDoor1","AR4500",1)
    AmbientActivate("AMB_Door01",FALSE)
    SoundActivate("EnergyBarrier1",FALSE)
    SetGlobal("Room1Align","AR4500",1)
    OpenDoor("DOOR1")
    Wait(1)
    OpenDoor("ROOM1")
    Wait(1)
    DisplayStringNoNameHead("cutspy",71993)  // ~You suddenly know with a strange certainty that in the room beyond lies a challenge.  You somehow know that you must face an aspect of yourself or your fears...but not why or how.~
    Wait(1)
    ActionOverride("cutspy",DestroySelf())
    EndCutSceneMode()
    AddJournalEntry(~The Pocket Plane

An angel has brought me back to the Abyss to inform me, as far as I can tell, that my destiny as a Bhaalspawn is about to come to fruition.  But I am not quite ready, it seems.  My mind is not prepared to accept all the power of Bhaal's realm...and so it has created a demiplane of my very own, a cocoon by her description, in which I will have to prepare myself.

There's no obvious way out...it's not a very large place. One thing to note, however, is that the passage to a challenge has been opened. Perhaps, like the previous Trials, completing the challenges will allow me to assert more control over this "Pocket Plane"...~,QUEST)
END

Everytime when i compile it using weidu cut206c.baf (this is the file) --tlkout dialog.tlk, weidu tells me that i've hard coded the journal entry to dialog.tlk. However, i keep on getting blank for the journal entry in game. Any help would be appreciated.

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: The language of "String"
« Reply #12 on: March 11, 2006, 06:46:19 AM »
That's because you're trying to compile it (which adds the entry to the dialog.tlk) and THEN package it (as you're not taking the dialog.tlk with you, because this is WeiDU not the dark ages, you don't have the string).  My advice is, unless you have a really, really good reason, don't precompile your bafs.

Just have a line in your tp2 that compiles them on install:
e.g.
Code: [Select]
COMPILE ~foldername/whatever.baf~
It should work fine.
"You alone can make my song take flight..."

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
Re: The language of "String"
« Reply #13 on: March 11, 2006, 10:40:53 PM »
yuck, whenever i try to compile the baf, weidu tells me that there's a syntax error near COMPILE in my tp2. This is my TP2 (it's just comipling so far):

BACKUP ~SarevokBegone/backup~
AUTHOR ~notasophist@yahoo.com~

COMPILE ~SarevokBeGone/cut206c.baf~       
USING ~SarevokBeGone/english/sbg.tra~



the same thing happens when i try to hardcoded the baf without using .tra.


Offline Duality

  • Planewalker
  • *****
  • Posts: 147
Re: The language of "String"
« Reply #14 on: March 11, 2006, 10:47:41 PM »
You need a

BEGIN ~Sarevok Be Gone~

at the start, so weidu knows what component you are installing.
"I'll try being nicer if you try being smarter."

"There is a certain freedom in being totally screwed. It means that nothing you do is going to make it any worse."

"Eagles may soar, but weasels don't get sucked into jet engines."

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
Re: The language of "String"
« Reply #15 on: March 12, 2006, 12:09:36 AM »
I added the BEGIN part, now weidu tells me that the syntax error is at BEGIN.

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: The language of "String"
« Reply #16 on: March 12, 2006, 04:27:11 AM »
I added the BEGIN part, now weidu tells me that the syntax error is at BEGIN.

Where did you insert it?  It should be after AUTHOR but before your COMPILE.  When it doubt do try and look at existing examples and see where things differ.
"You alone can make my song take flight..."

Offline notasophist

  • Planewalker
  • *****
  • Posts: 151
Re: The language of "String"
« Reply #17 on: March 12, 2006, 04:44:20 AM »
That did the job.

Thanks for your help everyone. :)

 

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)?: