Jump to content


Photo

Modding for Beginners


  • Please log in to reply
111 replies to this topic

#21 -Ashara-

-Ashara-
  • Guest

Posted 24 February 2004 - 07:20 AM

Sillara, do you have this link to the main page of the IESDP site? I know, that in the other thread the link was only to the Actions part of it. Try the site below, it has a very thorough section on setting timers, what units are used and how they are applied.

http://dragonlance.t.../iesdp/main.htm

at night
outdoors

should be

TIMEODAY(NIGHT), AreaType(OUTDOOR) - check the appropriate arguments in the IDS files.

if you want just to make notes to yourself, use
//// in front of the text, this way the programknows it's not the code.

THEN GOTO TsujathaLoveTalk11a means that you stay with the sme speaker file (ie you still continue talking to Tsujatha, not changing to say, Imoen) and TsujathaLoveTalk11a is simply the name of the block wich contains Tsujathat's reply. So it can be anything, the mani thing you have it somewhere. If you want to exit on PC's remark use EXIT after PC's reply....

It is also a good idea to have the capital consistent in the file naming. Here:

Global("Lovetalk","LOCALS",0)

DO ~SetGlobal("LoveTalk","LOCALS",1)~

What you are doing you are checking in the first line that variable "Lovetalk" does not exist, then you set the same variable "Lovetalk" to 1 to let the game know that the conversation happened.

I, again, recommend the Road to Banter which explains these things in much more details and very accurately.

#22 -jcompton-

-jcompton-
  • Guest

Posted 24 February 2004 - 07:23 AM

IF
~Global("TsujathaRomanceActive","GLOBAL",1)
Global("Lovetalk","LOCALS",0)
Global("TsujathaMatch","GLOBAL",1)
GlobalTimerExpired("TsujathaRomance","GLOBAL")
at night
outdoors

You'll find that AreaType() and TimeOfDay() take care of those issues.

THEN BEGIN TsujathaLoveTalk1
  SAY ~blah blah blah~
  DO ~SetGlobal("LoveTalk","LOCALS",1)~
  IF ~~ THEN REPLY ~blah blah blah~ DO ~RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk11a
  IF ~~ THEN REPLY ~blah blah blah~ DO ~RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk12a
  IF ~~ THEN REPLY ~blah blah blah~ DO ~RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk13a
END


No. Any DO action must be part of a transition... again, learn the structure and some of these questions will answer themselves.

THEN BEGIN TsujathaLoveTalk1
SAY ~blah blah blah~
IF ~~ THEN REPLY ~blah blah blah~ DO ~SetGlobal("LoveTalk","LOCALS",1) RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk11a
IF ~~ THEN REPLY ~blah blah blah~ DO ~SetGlobal("LoveTalk","LOCALS",1) RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk12a
IF ~~ THEN REPLY ~blah blah blah~ DO ~SetGlobal("LoveTalk","LOCALS",1) RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk13a
END

Also, are the numbers for "Lovetalks" correct??


It is impossible to answer this question without knowing what the script that controls the romance looks like.

All a romance in BG2 is, is a series of dialogues governed by a script. By convention, the script watches a variable called LOVETALK.

So, if your script expects the romance to start at LOVETALK=0, expects you to set a 30-second timer in the dialogue and set LOVETALK to 1... then it's correct. If not, it's not.

#23 dorotea

dorotea

    witch extraordinaire

  • Modder
  • 1927 posts

Posted 24 February 2004 - 01:58 PM

Sillara, I just wanted to give you a sort of general advice, based on how I myself started modding.

Do not try to code complex lovetalks and banters , and cutscenes right away.

1. Figure out how to make a simple new npc from scratch (there is a tutorial ->
at the Forgotten Wars Projects by Ghreyfain.

http://www.spellhold...orials/weidunpc

2. Make your npc (ie his cre file, his simple bcs, his joining dialog, and the tp2 file that will install him as well as figure out how do you install a new mod - by making a Setup-mymod.exe file

3. Test your new npc - add him to the game scripts.

After you do all this and post yor first screenshot with your new npc 'in your game' - come back and ask more questions about how you code a romance for him.

By the way - Forgotten War Projects is good place to ask for help on basics - jcompton even runs a one-day-npc contest


After you get your npc figured out and a game with him - start coding his romance and test after adding each new dialog - to make sure it actually 'works' in the game.

By then you will have a much better idea of what questions to ask.

Freedom cannot be equated with goodness, virtue, or perfection. Freedom has its own unique self-contained nature; freedom is freedom ? not universal goodness. Any confusion or deliberate equalization of freedom with goodness and excellence is in itself negation of freedom, and acceptance of the path of restraint and enforcement.

Nikolai Berdyaev - Christian Existentialist, Philosopher of Freedom.


The Longer Road mod
Redemption mod
Bitter Grey Ashes


#24 -jcompton-

-jcompton-
  • Guest

Posted 24 February 2004 - 02:03 PM

I wouldn't call One-Day NPC a contest. It's more of an artistic movement. Like the Bauhaus of mods.

#25 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 24 February 2004 - 06:11 PM

Forgotten Wars Projects? Basics? I will go there immediately! :D Thank you for the advice, by the way. I will try to get Tsujatha present in the game first, and then we will see what happens. I will also ask the questions I have concerning BCS over there. When I become better at modding perhaps I will be allowed back in here. :unsure:

Sillara
Check out my RPG forum!

#26 -Ashara-

-Ashara-
  • Guest

Posted 08 March 2004 - 01:44 PM

OK, from the begginer modder #2 ....

Trying to do: Have dialogues prompted by NPC's BSC file to happen at the entry to a certain area.

Problem: have stuttering bugs so far, trying to apply the "Yoshimo speaks of Renal"-like script

Hypothetic solution:

On BSC file has the following 2 Blocks:

IF
InParty(Myself)
AreaCheck("FW____")
Global("DialogueName", "LOCALS", 0) ---> to check that dialogue had not run previously if a few areas can spawn it
Global("ScriptName", "GLOBAL", 0)
THEN
RESPONSE#100
SetGlobal("ScriptName", "GLOBAL", 1) ---> to have it in the condition of the ONLY dialogue I want to hear in that area, no more than that
END

Code the NPC's talk on J file.

in NPC's J-file put the conditions on the talk:
Global("DialogueName", "LOCALS", 0)
SetGlobal("ScriptName", "GLOBAL", 1)

Add the second scripted block in BSC looking like this:


IF
InParty(Myself)
AreaCheck("FW____")
Global("DialogueName", "LOCALS", 0)
Global("ScriptName", "GLOBAL", 1)
THEN
RESPONSE#100
StartDialogueNoSet(Player1)
SetGlobal("ScriptName", "GLOBAL", 2)
END

Am I on the right track or forgetting something essential still??????

#27 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 08 March 2004 - 03:40 PM

I'm not sure why you need 2 script blocks. I did this with Cailean:

His script:
//Cailean complains about the Docks
IF
InParty(Myself)
AreaCheck("AR0300")
Global("FWCaileanQuestCompleted","GLOBAL",0)
Global("FWCaileanDocksWarning","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("FWCaileanDocksWarning","GLOBAL",1)
StartDialogNoSet(Player1)
END

His xxJ.dlg file:
//Cailean comments on entering the docks.
IF ~AreaCheck("AR0300") Global("FWCaileanQuestCompleted","GLOBAL",0) Global("FWCaileanDocksWarning","GLOBAL",1)~ THEN BEGIN CaileanDocksWarning
SAY ~Docks! Thieves! Blah!~ // he doesn't really say this
IF ~~ THEN DO ~SetGlobal("FWCaileanDocksWarning","GLOBAL",2)~ EXIT
END

#28 -Ashara-

-Ashara-
  • Guest

Posted 08 March 2004 - 07:32 PM

Thank you, Kismet.

It's working with two blocks as well, I have checked it, though it is not that elegant. Logic is all the same here, I just reset the variable in the script, not dialogue. The biggest thing is to use the J file and DialogueNoSet combination as opposite to B file and Interact. -_-
I am doing NPC-NPC talks the same way, starting with a SAY block in J file and then EXTERNing into the CHAIN3. I tried just to start a CHAIN in J file and it did not work for me.

#29 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 09 March 2004 - 05:20 AM

What kind of errors did you get? I had no problems using CHAIN in a xxJ.d file.

#30 -Ashara-

-Ashara-
  • Guest

Posted 09 March 2004 - 06:57 PM

Probably just parses. It was a big chain with EXTERNs and other stuff, so it was easier to behead it and to stuck the first bit into J, and the rest to be left untouched, than changing the whole thing into J files.

#31 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 10 March 2004 - 02:19 AM

Speaking of chaining, is there anything special I need to do or code in to be able to chain in the Bxxx.d file? (I do realize it will become the Bxxx.dlg when compiled.) I was having some parsing troubles with my chains in my xxxxP.d file, so I was concerned.

SofT
Check out my RPG forum!

#32 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 10 March 2004 - 07:04 AM

As far as compiling CHAINs is concerned, I'm pretty sure a .d file is a .d file is a .d file (meaning it doesn't matter if you call it btsuj.d or fstuj.d or mydia.d you just need to get your syntax straight.)

#33 -Ashara-

-Ashara-
  • Guest

Posted 10 March 2004 - 07:11 AM

No, not really. Just put an END on your APPEND if it is before CHAINs :rolleyes:

The parsing errors are your typos basically (missing tildas mostly, lol or incorrectly spelled IDS's or functions...), and I actually LOVE them since they are so easy to see when debugging - the weidu gives you the line# where the error had happened. :wub:

#34 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 10 March 2004 - 02:45 PM

SPOILER HERE.

Here is an example TsujathaLoveTalk (DO NOT READ if you don't want it to be spoiled):
=====================================================
IF
~Global("TsujathaRomanceActive","GLOBAL",2)
Global("TsujathaLoveTalk","LOCALS",39)
Global("TsujathaMatch","GLOBAL",1)
Global("TsujathaVirgin","GLOBAL",1)
GlobalTimerExpired("TsujathaLoveTalkTime","GLOBAL")~
THEN BEGIN TsujathaLoveTalk20A
SAY ~XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX~
IF ~~ THEN REPLY ~XXXXXXXXXXXXXXXXXXXXXXXXX~ DO ~SetGlobal("LoveTalk","LOCALS",40) RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk20A1a
IF ~~ THEN REPLY ~XXXXXXXXXX~ DO ~SetGlobal("LoveTalk","LOCALS",40) RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk20A2a
IF ~~ THEN REPLY ~XXXXXXXXXXXXXX~ DO ~SetGlobal("LoveTalk","LOCALS",40) RealSetGlobalTimer("TsujathaRomance","GLOBAL",30)~ THEN GOTO TsujathaLoveTalk20A3a
END
=====================================================
This LoveTalk, along with all the others, is in the BTSUJAT.D file. I want to be able to CHAIN what Tsujatha says because, as you can see in this one, his responses are sometimes a bit long. How do I chain just Tsujatha's lines? Can someone please take this, change it to a chained LoveTalk, and re-post it in this thread, please?? Thanks a million all you patient and helpful modders out there! You will be rewarded with a great mod for your efforts!!!

SofT

P.S. This problem has been solved, so I have removed the spolier. Thanks a million Kismet.
Check out my RPG forum!

#35 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 10 March 2004 - 02:54 PM

You don't want CHAIN, you want multisay. :)

SAY ~Something~
= ~I'm still saying something~
= ~This is a really long something that I'm saying.~
IF ~~ THEN REPLY ~Done yet?~
etc.

Which, by the way, is covered in the weidu readme. http://www.weidu.org...eiDU.html#htoc8

#36 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 10 March 2004 - 03:06 PM

Kismet, when is your birthday? CUZ I WANNA BUY YOU A PRESENT!!! Very succinctly, you have answered my question perfectly! No more replies are necessary to this "Chain/Multisay" Question. Thanks.
Check out my RPG forum!

#37 -Ashara-

-Ashara-
  • Guest

Posted 14 March 2004 - 04:44 PM

Uhm...by some reason in the talks between NPCs and PC the remarks of the PC get assigned to the NPC closest to the speaking NPC.

Example: Jaheira initiates the talk with PC, but after PC's reply is chosen it shows on the screen as Coran's remark (Coran stnding next to Jaheira).

I am using APPEND to B-file and the script is something like shown below. Do I need to add anything to make sure that she converses with PC, not with the next NPC? (Erm...texts are not included in the mod)

IF WEIGHT #-1 ~See(Player1)
Global("JAPC2","LOCALS",0)~ THEN BEGIN JAPC2
SAY ~Blah-blah, <CHARNAME>?~ [JAHEI99]
IF ~~ THEN REPLY ~Yeah.~ DO ~SetGlobal("JAPC2","LOCALS",1)~ GOTO JAPC2.1
IF ~~ THEN REPLY ~NAY!~ DO ~SetGlobal("JAPC2","LOCALS",1)~ GOTO JAPC2.2
IF ~~ THEN REPLY ~Oh, go nug Khalid already!~ DO ~SetGlobal("JAPC2","LOCALS",1)~ GOTO JAPC2.3
END

#38 -jcompton-

-jcompton-
  • Guest

Posted 15 March 2004 - 11:51 AM

Uhm...by some reason in the talks between NPCs and PC the remarks of the PC get assigned to the NPC closest to the speaking NPC.

It's nothing to do with the DLG coding, everything to do with how you call the conversation.

Basically, whoever ends up as the target of the Interact() or Dialogue() command is the person who ends up appearing in the replies. Note that this is, ultimately, a cosmetic issue since it only shows up in the scrollback, but if you absolutely positively want the PC's name to appear there, you must use Interact(Player1) or Dialogue(Player1). Using something like Interact([PC]) will just pick any party member (either at random or whoever's closest to Jaheira, can't recall how it works.)

#39 -Ashara-

-Ashara-
  • Guest

Posted 15 March 2004 - 12:55 PM

Thanks JC, we will trigger them from scripts then

#40 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 23 March 2004 - 10:59 PM

I have a "slight" problem. (It is only slight because if I cannot figure out the answer, I will just scrap the whole thing.) I want my NPC to interject during a conversation with a particular enemy (all right; it's Firkraag), and then I want to have him cast a spell on the PC. How do I script that, and where do I put that? Do I just stick the appropriate commands at the end of the interjection (i.e., in the J file)? Or is there something else I need to do?

Thanks in advance!

Sillara
Check out my RPG forum!