Jump to content

Newbie Modding Questions


Twani

Recommended Posts

Usually it's pretty pointless to try and diagnose compiler mistakes, because the error can be hiding five or two or fifty lines up, depending on the error.

 

(it might be my lack of sleep, but I don't understand your paragraph about the variables, so I can't comment. However, I would caution you from decrementing or resetting variables - it can lead to problems. I'd rather recommend this: if you have another talk after Lovetalk 24, trigger it at Lovetalk 26, then set the variable to 27).

Link to comment

The idea was to repeat a lovetalk (trigger the whole lovetalk anew) if the player choses the reply option "I don't want to talk now, let's talk later".

 

Resetting the variable to "what it was" before triggering this dialogue and resetting the timer is a valid way to go imho. (If there aren't other scripted events that depend on this varaible, of course.)

Link to comment

Awesome - thanks for your help!

 

I should have edited the initial part of my post - i pretty much just wanted assurances on the method of doing it since i experimented my way to it rather blindly by comparing other files :).

 

All of this stuff is slowly starting to make more sense, and the posted tutorials are a damn great help as well. Will be fun to start experimenting with more advanced scripts later on :).

Link to comment

Moving forward step by step! All of the SoA Lovetalks, banters and PIDS are entered into code and are working pretty perfectly. Also created the necessary files, coded epilogues for ToB and Tree of Life/Hell-talk. Now i just need to qualify requirements for triggering a lot of the talks, banters, PID's and of course untold hours of polish. Some of them are easy, some of them more tricky. What i'm currently wondering is a few things.

 

* Let's say the romancetimer for lovetalks expires, only the next lovetalk requires the party/player to be in a specific area or setting. Will the game "wait" for this to happen or do i need to do something else in order to make sure it works correctly?

* What does the requirement for a conversation GlobalLT and/or GlobalGT indicate (For example, if a PID-talk is predecated by GlobalLT(Variable,Number)? Why use GlobalLT/GlobalGT instead of simply global? I've seen this in other mods - still wondering what it means.

* What is the way to require a lovetalk to be started on "rest", i.e clicking the rest button. I've seen parts of it in the end of dialogues in the form of RestParty(), but not how to actually trigger the dialogue at the rest.

* I haven't coded the ToB-dialogues into my 25-J-file yet for a simple reason - there's 24 of them, 12 each for one "path" (Changed/Unchanged) dependant on the player choice in SoA. What's the best way to go about coding this? Simply creating a variable like "W5LiChanged", setting it to 1 or 2 and requiring the Variable to be "1" for all of the "Changed" talks and "2" for the "Unchanged" talks?

Link to comment

* What does the requirement for a conversation GlobalLT and/or GlobalGT indicate (For example, if a PID-talk is predecated by GlobalLT(Variable,Number)? Why use GlobalLT/GlobalGT instead of simply global? I've seen this in other mods - still wondering what it means.

 

LT = less than, GT = greater than.

 

Global(variable, 5) will trigger when variable is exactly 5, while GlobalGT(variable, 5) will trigger when variable is above 5 and GlobalLT(variable, 5) will trigger when variable is below 5.

 

You're not expected to intuitively figure all this out. IESDP has the info on all triggers (as well as actions, identifiers, opcodes, 2da files, etc.). Here are BG2 Triggers.

Link to comment

1st question: The dialogue would trigger the moment the party is in this area, no need to do anything further.

 

3rd question: This is triggered by the xxxD.bcs, the "dream script", have a look at other NPC mods.

 

4th question: Yes, that would be one possibility. Or you set the variable = 1 and use this for one dialogue path, and = 0 for the other.

Link to comment

* What does the requirement for a conversation GlobalLT and/or GlobalGT indicate (For example, if a PID-talk is predecated by GlobalLT(Variable,Number)? Why use GlobalLT/GlobalGT instead of simply global? I've seen this in other mods - still wondering what it means.

 

LT = less than, GT = greater than.

 

Global(variable, 5) will trigger when variable is exactly 5, while GlobalGT(variable, 5) will trigger when variable is above 5 and GlobalLT(variable, 5) will trigger when variable is below 5.

 

You're not expected to intuitively figure all this out. IESDP has the info on all triggers (as well as actions, identifiers, opcodes, 2da files, etc.). Here are BG2 Triggers.

 

Odd - i thought i searched the DB for that, but got no response. Must've typed it incorrectly - thanks for the clarification! :)

 

1st question: The dialogue would trigger the moment the party is in this area, no need to do anything further.

 

3rd question: This is triggered by the xxxD.bcs, the "dream script", have a look at other NPC mods.

 

4th question: Yes, that would be one possibility. Or you set the variable = 1 and use this for one dialogue path, and = 0 for the other.

 

And thank you, on all 3 counts :). I'll start looking into how to set this up.

Link to comment

 

 

//Love Talk Timers and Condition

 

 

//Check if PC fulfills requirement for romance + Timers

 

IF

InParty(Myself)

Gender(Player1,MALE)

OR(4)

Race(Player1,ELF)

Race(Player1,HALF_ELF)

Race(Player1,HALFORC)

Race(Player1,HUMAN)

CheckStatGT(Player1,13,CHR)

Global("W5LiLoveTalk","GLOBAL",0)

THEN

RESPONSE #100

RealSetGlobalTimer("W5LiRomanceTimer","GLOBAL",3000)

SetGlobal("W5LiRomanceActive","GLOBAL",1)

SetGlobal("W5LiLoveTalk","GLOBAL",1)

END

 

//Lovetalk Timing

 

IF

InParty(Myself)

See(Player1) //

RealGlobalTimerExpired("W5LiRomanceTimer","GLOBAL")

Global("W5LiRomanceActive","GLOBAL",1)

CombatCounter(0)

!See([ENEMY])

OR(31)

Global("W5LiLoveTalk","GLOBAL",1)

Global("W5LiLoveTalk","GLOBAL",3)

Global("W5LiLoveTalk","GLOBAL",5)

Global("W5LiLoveTalk","GLOBAL",7)

Global("W5LiLoveTalk","GLOBAL",9)

Global("W5LiLoveTalk","GLOBAL",11)

Global("W5LiLoveTalk","GLOBAL",13)

Global("W5LiLoveTalk","GLOBAL",15)

Global("W5LiLoveTalk","GLOBAL",17)

Global("W5LiLoveTalk","GLOBAL",19)

Global("W5LiLoveTalk","GLOBAL",21)

Global("W5LiLoveTalk","GLOBAL",23)

Global("W5LiLoveTalk","GLOBAL",25)

Global("W5LiLoveTalk","GLOBAL",27)

Global("W5LiLoveTalk","GLOBAL",29)

Global("W5LiLoveTalk","GLOBAL",31)

Global("W5LiLoveTalk","GLOBAL",33)

Global("W5LiLoveTalk","GLOBAL",35)

Global("W5LiLoveTalk","GLOBAL",37)

Global("W5LiLoveTalk","GLOBAL",39)

Global("W5LiLoveTalk","GLOBAL",41)

Global("W5LiLoveTalk","GLOBAL",43)

Global("W5LiLoveTalk","GLOBAL",45)

Global("W5LiLoveTalk","GLOBAL",47)

Global("W5LiLoveTalk","GLOBAL",49)

Global("W5LiLoveTalk","GLOBAL",51)

Global("W5LiLoveTalk","GLOBAL",53)

Global("W5LiLoveTalk","GLOBAL",55)

Global("W5LiLoveTalk","GLOBAL",57)

Global("W5LiLoveTalk","GLOBAL",59)

Global("W5LiLoveTalk","GLOBAL",61)

THEN

RESPONSE #100

IncrementGlobal("W5LiLoveTalk","GLOBAL",1)

END

 

IF

InParty(Myself)

See(Player1)

RealGlobalTimerExpired("W5LiRomanceTimer","GLOBAL")

OR(31)

Global("W5LiLoveTalk","GLOBAL",2)

Global("W5LiLoveTalk","GLOBAL",4)

Global("W5LiLoveTalk","GLOBAL",6)

Global("W5LiLoveTalk","GLOBAL",8)

Global("W5LiLoveTalk","GLOBAL",10)

Global("W5LiLoveTalk","GLOBAL",12)

Global("W5LiLoveTalk","GLOBAL",14)

Global("W5LiLoveTalk","GLOBAL",16)

Global("W5LiLoveTalk","GLOBAL",18)

Global("W5LiLoveTalk","GLOBAL",20)

Global("W5LiLoveTalk","GLOBAL",22)

Global("W5LiLoveTalk","GLOBAL",24)

Global("W5LiLoveTalk","GLOBAL",26)

Global("W5LiLoveTalk","GLOBAL",28)

Global("W5LiLoveTalk","GLOBAL",30)

Global("W5LiLoveTalk","GLOBAL",32)

Global("W5LiLoveTalk","GLOBAL",34)

Global("W5LiLoveTalk","GLOBAL",36)

Global("W5LiLoveTalk","GLOBAL",38)

Global("W5LiLoveTalk","GLOBAL",40)

Global("W5LiLoveTalk","GLOBAL",42)

Global("W5LiLoveTalk","GLOBAL",44)

Global("W5LiLoveTalk","GLOBAL",46)

Global("W5LiLoveTalk","GLOBAL",48)

Global("W5LiLoveTalk","GLOBAL",50)

Global("W5LiLoveTalk","GLOBAL",52)

Global("W5LiLoveTalk","GLOBAL",54)

Global("W5LiLoveTalk","GLOBAL",56)

Global("W5LiLoveTalk","GLOBAL",58)

Global("W5LiLoveTalk","GLOBAL",60)

Global("W5LiLoveTalk","GLOBAL",62)

THEN

RESPONSE #100

MoveToObject(Player1)

StartDialogueNoSet(Player1)

END

 

 

 

So, bit of a problem. I'm trying to add an Areatype requirement to the first lovetalk by entering the following in the first line.

 

IF ~AreaType(FOREST) Global("W5LiLoveTalk","GLOBAL",2)~ W5LiSR0_Intro

 

This causes Liella to go into a PID-loop similar to the one i experienced when i had unclosed variables in the script file. The way that i've set it up is obviously that each lovetalk, happening at even numbers, increments the lovetalk variable by 1 and resets the timer, leading to the next - up to the final lovetalk of 30 (or 31, the first is marked 0) which begins at Global("W5LiLoveTalk","GLOBAL",62)

 

What am i doing wrong? Is there a fashion of closing variables that i am not aware of? Is it not possible to declare AreaType's in the J-file like that? Do i need to make a seperate script for lovetalks that have Areatype requirements? Do i perhaps need to declare what happens when the variable is set to 63, as after the final lovetalk?

Link to comment

The AreaType Check needs to be in the trigger script. What happens now is: Script detects true conditions, dialogue is started - but in the J-file, no true dialogue but the PID is there, because the party is not in a forest.

 

Never, never put additional trigger conditions into the dialogue file.

 

I notice now that I misunderstood your question above. I was assuming you were talking about a trigger block that checks for the AreaType, then the dialogue will trigger in this area as soon as the timer is run.

Link to comment

The AreaType Check needs to be in the trigger script. What happens now is: Script detects true conditions, dialogue is started - but in the J-file, no true dialogue but the PID is there, because the party is not in a forest.

 

Never, never put additional trigger conditions into the dialogue file.

 

I notice now that I misunderstood your question above. I was assuming you were talking about a trigger block that checks for the AreaType, then the dialogue will trigger in this area as soon as the timer is run.

 

Gotcha - i'll take the advice to heart! Thanks again for your insanely fast and succinct responses!

Link to comment

Actually, I think it's a shame there is no tutorial that covers all these things. File name for spawning - Script variable for ingame actions. No additional trigger conditions into the dialogue file. Interact() calls the xxxB.dlg, StartDialogNoSet() the xxxJ.dlg. etcetc..

 

It's "basics" but you have to get to know them - either by try and error or by asking (I've been there, too! So no worries.)

Link to comment
Actually, I think it's a shame there is no tutorial that covers all these things. File name for spawning - Script variable for ingame actions. No additional trigger conditions into the dialogue file. Interact() calls the xxxB.dlg, StartDialogNoSet() the xxxJ.dlg. etcetc..

 

It's "basics" but you have to get to know them - either by try and error or by asking (I've been there, too! So no worries.)

Well, there's no one preventing you, well except you, from making a tutorial that looks like you... I would read it ... :D ... and could use it. As remembering all this is sometimes harder than actually knowing it's there.
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...