Jump to content


Photo

Modding for Beginners


  • Please log in to reply
111 replies to this topic

#1 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 08 February 2004 - 04:59 AM

Where can I find a tutorial that assumes NO knowledge of modding? I know absolutely NOTHING of coding, but I am working on my mod anyway. I have completed between 75% and 80% of the writing. I will soon need to begin coding, and I have no idea what to do. Thanks! :blink: :unsure:

Sillara
Check out my RPG forum!

#2 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 08 February 2004 - 05:56 AM

There aren't any like that as far as I know. They all assume some sort of basic knowledge. You're going to have to do what the rest of us non-coders did and that's dig around in files to see how BioWare did things and how other modders did them and read the forums and ask lots of questions.

Ghrey's NPC tutorial really is a good place to start. The thread on the tutorial is chock full of good information on pitfalls to avoid so I'd recommend reading that too. http://www.shsforums...ay;threadid=678

WeiDU comes with a readme and some nice tutorials on some of the different functions. It also comes with a folder full of examples. I'd recommend reading them through, even if you don't understand everything (or anything) right off.

#3 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 09 February 2004 - 03:38 AM

(For those of you who have already read this post on the CoM board, sorry!)

I have three questions.

1) When making a joining dialogue, how do I script in a variable for the party attacking the NPC?

2) How do I script in a variable for the NPC to attack the party/turn hostile?

3) How do I have the NPC refuse to speak to the PC another time (i.e., So-and-so has nothing to say to you)?

Thanks!

Sillara

P.S. We have just begun our first bit of coding, and I have an enormous favor to ask of you experienced coders. Would one of you be willing to read over my joining dialogue to make sure that I am doing it properly? :unsure: I would rather send it as an attachment than post it up for two reasons: it contains spoilers, and I would like to make sure I have it in the right kind of file. Thank you again!!!
Check out my RPG forum!

#4 Seifer

Seifer

    The best Anti-Paladin weapon is a tin opener...!

  • Member
  • 4505 posts

Posted 09 February 2004 - 04:58 AM

Send it to me if you wish. I would also ask, are you using Context in your coding?

how come you always look so damn cool in every photo I see you in?!?


Speaking of modding, I listened to IER 3 yesterday, so you can have another quote for your signature: how come you sound so damn cool, as well as look it? It's unfair. Seriously.


Still a cyberjock, still hacking the matrix, still unsure of what that means.

TeamBG member - http://www.teambg.eu

#5 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 09 February 2004 - 05:31 AM

(For those of you who have already read this post on the CoM board, sorry!)

I have three questions. 

1) When making a joining dialogue, how do I script in a variable for the party attacking the NPC?

2) How do I script in a variable for the NPC to attack the party/turn hostile?


Do you want the NPC to attack the party as soon as he sees them or in the middle of the dialog? If it's the former I assume you could just flag him as "enemy" rather than "neutral" and then turn him neutral and stop the fight when his health gets to a certain level. If it's the latter then you'd use DO ~Enemy()~

3) How do I have the NPC refuse to speak to the PC another time (i.e., So-and-so has nothing to say to you)?


Give him dialog without any true conditions.

P.S. We have just begun our first bit of coding, and I have an enormous favor to ask of you experienced coders. Would one of you be willing to read over my joining dialogue to make sure that I am doing it properly?  :unsure:  I would rather send it as an attachment than post it up for two reasons: it contains spoilers, and I would like to make sure I have it in the right kind of file. Thank you again!!!


You can always --traify it first so all we would see would be @1 instead of your actual dialog lines. As for the right kind of file, it just has to be a plain text file.

#6 dorotea

dorotea

    witch extraordinaire

  • Modder
  • 1927 posts

Posted 09 February 2004 - 06:22 AM

Hi there!

Don't forget that besides your d-files (the ones with actual dialog), cre-files (the ones that contain basic information on your new npc) and bcs-files (the scripts that actually dictate your npc behavior) you also need a tp2 file - the file that installs all the above components and adds them to your game.


Also, one program that I think you need to have besides Context editor (http://fixedsys.com/...t/download.html) and Weidu (http://weidu.org/Wei...ADME-WeiDU.html) is the Near Infinity - the Infinity Engine Editor and Browser (http://www.idi.ntnu....i/download.html).

Hope it helps. You can send your files to me if you wish - simply PM or email at

ladydorotea@hotmail.com, and yes, as Seifer mentioned the best format is plain text. Just save your d-file as All-files xxx.d and it will be readable in any text editor (Notepad, Wordpad, Context etc) It is not desirable to use Word.

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


#7 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 15 February 2004 - 11:39 PM

I have a question regarding interjection coding. Suppose I want my NPC to interrupt something someone says in the game. Something like this.

Salvanas: Blah-blah-blah.
MyNPC: No! Blah-BLAH-blah.
Salvanas: You're right. Blah-BLAH-blah.
MyNPC: Stupid git.
END

I want my NPC's dialogue to interrupt/intercept the other person's speech and prevent it from advancing as well as having the guy respond to my NPC. How do I do that?

Thanks!
Sillara
Check out my RPG forum!

#8 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 16 February 2004 - 04:30 AM

I have another general modding question. :unsure: In my NPC/NPC banters (among others), I have occasionally had cause to use quotation marks around words (as in, "dark, foul magic" when quoting Valygar, or from time to time when expressing sarcasm or what-not). However, I am not sure what putting quotation marks in the coded dialogue would do. Is it all right to put quotes within the coded dialogues? How would that look? Is there anything special I have to do to get the quotes to not be read as commands or whatever? And, on a similar note, how do I get the spoken words to indent? I have occasional poetry quotations, and I would like to have them indented.

Thanks!

Sillara
Check out my RPG forum!

#9 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 16 February 2004 - 05:57 AM

1) to get your NPC deviate your path in the dialogue, you should use INTERJECT instead of INTERJECT_COPY_TRANS: the former allows you to choose where to direct your dialogue (see valen for examples), while the latter makes your NPC say his little thing and then the dialogue will continue as usual.
2) Bioware dialogues uses *ironic or emphatised* instead of "ironic or emphatized". it should be safe as long as there aren't /nearby, because in WeiDu /*this is a comment*/.
3) to indent, you can, in your .tra file (or in the hard-coded .d), write
@1 "line 1
line 2
linte 3"
(or SAY "line 1
line 2
line 3"
safely because each @ reference is long from " to the next " (I use ", having an italian keyboard, but WeiDU usually uses the tilde). WeiDU totally ignores indenting in both .d and .tp2 files.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#10 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 16 February 2004 - 06:28 AM

Thanks! That helps a lot. :D

Sillara
Check out my RPG forum!

#11 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 17 February 2004 - 01:40 AM

I'm ba-ack! :P

This time my question involves the PC's class. My NPC has class-specific dialogues with the PC, but I was wondering how to trigger that. What Global (or Local?) or whatever do I have to code in? Also, is there any way to check for the PC's kit? Or is the fighter class all that can be checked for, not the Wizard Slayer or Kensai or what-have-you?

Thanks again!
Sillara
Check out my RPG forum!

#12 Valheru

Valheru

    Ancient One

  • Member
  • 120 posts

Posted 17 February 2004 - 02:27 AM

I am also a begginer but I would reccomend that you look at other dialogues in the game and see what the conditions are it is a great help or so I found it to be.
Thanks for picture Immy :)

#13 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 18 February 2004 - 07:20 AM

Class(Player1,MONK)
Kit(Player1,KENSAY)
or whatever. Classes are: MAGE FIGHTER CLERIC THIEF BARD PALADIN DRUID RANGER FIGHTER_MAGE FIGHTER_CLERIC FIGHTER_THIEF FIGHTER_MAGE_THIEF MAGE_THIEF CLERIC_MAGE CLERIC_THIEF FIGHTER_DRUID FIGHTER_MAGE_CLERIC CLERIC_RANGER
Kits are:
ABJURER CONJURER DIVINER ENCHANTER ILLUSIONIST INVOKER NECROMANCER TRANSMUTER BERSERKER WIZARD_SLAYER KENSAI CAVALIER INQUISITOR UNDEAD_HUNTER FERALAN STALKER BEASTMASTER ASSASIN BOUNTY_HUNTER SWASHBUCKLER BLADE JESTER SKALD TOTEMIC_DRUID SHAPESHIFTER BEAST_FRIEND TALOS HELM LATHANDER MONK BARBARIAN WILDMAGE (TOB only, so if used you should create 2 separate .d or .baf, using UNLESS/IF, see Wei-DU instructions for .tp2)

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#14 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 18 February 2004 - 08:08 AM

kit.ids is also broken so you'll have to distribute a fixed one with your mod or work around it.

#15 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 18 February 2004 - 02:36 PM

A the bigg--Thank you for the list! That is exactly what I needed.

@Kismet--does that mean that the game as it stands will not properly identify the kits? Hmm. In that case I may skip kit-specific classes, as repairing anything is WAY out of my league!!

Thanks for the help! I love this thread, too. :wub:
Sillara
Check out my RPG forum!

#16 Littiz

Littiz
  • Modder
  • 1078 posts

Posted 19 February 2004 - 07:50 AM

I have WeiDU-ed Dyara's fixes to the KIT.IDS files for Refinements.
You can ask me if you need them, though they aren't really tested so far (my version of KIT.IDS file was already fixed so the commands find nothing to patch)
-_-

Ever forward, my darling wind...


#17 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 24 February 2004 - 03:14 AM

@Littiz: Please do send them. It would be nice to be sure that the clerics especially get their responses! I ended up not doing other kit-specifics, but the clerics were too different from one another!

I have a slight problem with the NPC/NPC banters. We have no trouble chaining in the usual banters; it is the ones with a conditional response that we have trouble with. For example:

Tsujatha: Blah, blah, blah.
Imoen: You're really dull.
(If NOT in a romance with the PC)
Tsujatha: No, I'm not.

(If in a romance with the PC)
Tsujatha: Charname doesn't think so.

How do I code that? Thanks in advance for the help! :rolleyes:

Sillara

P.S. Don't worry. That was not a REAL sample of the talks. ;)
Check out my RPG forum!

#18 Jurgenaut

Jurgenaut
  • Member
  • 23 posts

Posted 24 February 2004 - 03:57 AM

Now, I'm not very into BG-modaring, but all the bundled romances have the XRomanceActive global variable that's spanning over 1-3, where 1 is "get to know you", 2 is "hot lurve" and 3 is "romance over".

(I'll use pseudo code here, since I dont know the script syntax)
Imoen says "You're really dull.";

IF (getGlobal('XRomanceActive') is '1') then X should say "<charname> doesn't think so...";
IF (getGlobal('XRomanceActive') is '2') then X should say "<charname>? Your sister seems to have something against me.";
IF (getGlobal('XRomanceActive') is '3') then X should say "So I've realized... What should I do to remedy that?" or maybe "Insinuate anything of the sort again and I will hang you using your reckless tongue!".

So the first time you take the NPC into the group, XRomanceActive should be set to 1 (unless any eventual romance restrictions aren't met). At some point in the romance, set it to 2. If charname tells the NPC off during a romance dialogue, set it to 3.
You can initiate all kinds of GLOBALs, if maybe your NPC insulted Aran Linvail during quests in chapter 3, set a variable AranPissed to 1, and you could edit arans dialogue for chapter 6 to deny you help with bodhi if aranpissed is 1.

Edit: To prevent misunderstandings, the pseudo code isn't actual script/dialogue. It is just some form of explanation of the sequence of events. Hopefully you'll be able to reinterpret it to real script/dialogue.
"Advertising has us chasing cars and clothes,
working jobs we hate so we can buy shit we dont need.
We have no purpose or place.
We have no great war, or great depression.
Our war is a spiritual war, our great depression is our lives." - Tyler Durden, Fight Club

#19 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 24 February 2004 - 04:28 AM

Is this anywhere near what it should be?? :wacko: I've read the tutorial(s) for lovetalks, but everyone assumes a certain knowledge already. We need "Modding for Dummies" which takes one by the hand and leads him through. :rolleyes: Thanks in advance for all your help out there. You guys are a great help!


IF
~Global("TsujathaRomanceActive","GLOBAL",1)
Global("Lovetalk","LOCALS",0)
Global("TsujathaMatch","GLOBAL",1)
GlobalTimerExpired("TsujathaRomance","GLOBAL")
at night
outdoors
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

What does the "30" mean in the RealSetGlobalTimer? I know I can change it, but what does it mean?? Also, are the numbers for "Lovetalks" correct??

SofT
Check out my RPG forum!

#20 -Sim-

-Sim-
  • Guest

Posted 24 February 2004 - 04:31 AM

What knowledge does it assume? "Modding for dummies" is rather general.

And the 30 is seconds of real time.