Jump to content


Photo

Minor Quest Coding Questions


  • Please log in to reply
7 replies to this topic

#1 minotaur_in_maze

minotaur_in_maze

    Modding Prima-Dona

  • Member
  • 906 posts

Posted 17 February 2006 - 01:35 PM

After a couple of Years, and after being given a HUGE amount of guidance from the friendly folk here - (SHED and SCONRAD top that particular list) I am getting the rudiments of coding, and I have made HUGE strides! :)

I still need work, but? Anyway I am getting close to done, but have a few issues as far as (Ithink it would be) scripting and effects in coding. Just little problems I am having because I don?t know how to either make globals or how to write out certain scripted actions. Let me try to list my probs here and see if anyone can help or advise.


These are all questions on coding for quests.

1. Okay, so I have a little sub quest where the party encounters and unhappy (Not Hostile) zombie. After some dialog options the player has the choice, depending on what path taken, to either kill the zombie (as a mercy killing that is requested rather than a battle) or, (if coding allows) to use a raise dead spell to bring him back to life (sorta like the bit in the city in the beginning of ToB). So, is there a way to code the thing so that if I choose to do a mercy killing, I can kill the zombie and not have every Other creature (Undead) in the area go hostile forever? I also want to give the party (2000XP) Experience for the mercy killing.

Along the same lines, is it possible to code something to Raise the corpse with a scroll/spell - like at the city beginning of ToB with the little boy and his father? I am wondering if that was hardcoded in. Same as, I need to set globals for whatever I do, kill or raise and set different XP for whatever choice is made (2000XP to kill - 3500XP to raise)

2. One of my main (and small I think) problems is knowing How to Begin a quest (Not sure if it is coded right)-

----------------------------------------
IF ~OctoberInpartyTrue()~ THEN BEGIN OctSTB~

(SOMETHING MISSING HERE. NEED TO MAKE Script/.Cre that will trigger only IF October -NPC- In Party ???)

SAY ~Sigh. (Frown. Yawn)~ // What the new creature being greeted says when party approaches.
IF ~~ THEN REPLY ~Hello friend, why so glum?~ GOTO OctSTB01
IF ~~ THEN REPLY ~What?s the problem with you, gnome?~ GOTO OctSTB01
IF ~~ THEN REPLY ~Boy you look like you?re having a really bad day. What?s up?~ GOTO OctSTB01
EXIT
END

IF ~~ THEN OctSTB01
SAY ~Hello outworlders.~
= ~Might I ask, have you ever been to the surface?~
IF ~~ THEN REPLY ~Certainly, we've come from there. That's where we live. Why?~ GOTO OctSTB02
IF ~~ THEN REPLY ~Yeah, it is home. Why?~ GOTO OctSTB02
END

IF ~~ THEN OctSvirTrav02
SAY ~Sigh. You *LIVE* on the surface? Oh you are so lucky. Have you seen many things?~
= ~Great bodies of water, I believe called - lakes?~
= ~Sky?~
= ~Trees?~
++ ~ Well sure. All the time, yes. Why?~ GOTO OctSTB03
++ ~Yup, why do you ask?~ GOTO OctSTB03
++ ~Nope, not us. I need to get going now.~ GOTO OctReject
EXIT
END

IF ~~ THEN OctSTB03
SAY ~Sigh.~
= ~Always wanted to travel have I. Not happy being cooped up underground always. Mayor says I am aberation and not a good Svirfneblin but I cannot change.~
= ~Want to see Overworld Soooooo bad, but a lone Svirfneblin would not survive long out there I have been told. In any case, mayor won't let me leave... Especially now since those cursed Drow have been raiding us more often.~
= ~Mayor says every hand will be needed if dirty Drow attack.~
++ ~Hmm, seems a shame not to be able to come and go as you please alright.~ GOTO OctSTB04
++ ~That doesn?t seem right to me.~ GOTO OctSTB04
++ ~Not my problem pal! Scram!~ GOTO OctReject
++ ~IsValidForPartyDialogue("Viconia")~ + ~Hold your tongue, insect, lest someone else be tempted to remove it and do it for you.~ + OctSTB04
++ ~IsValidForPartyDialogue("October")~ + ~Can we not help him, <CHARNAME>, he?s just so cute.~ + OctSTB04
END
END

----------------------

I only give this much as I have a Multisay in that last block with Viconia and October both react.)

So, the quest is now started and if the player elects he can help out the gnome by, initially, going to talk to the Svirfneblin Mayor. Two things, if I understand it correctly, I can add a GLOBAL that will begin the talk ?IF? the GLOBAL is met (and if it is Not then things just go along as usual. Right? More importantly, as I would be moving from one area (the Svirfneblin village) into another (Place I meet the mayor) do I have to Restart the quest to cary it on I mean, or is it all done with the GLOBALS? This is a question I have often as in this quest I tend to move to different areas a lot...


3. MUCH later I have the option for the Player to talk to a colorful background NPC who can offer information, items for sale and a couple of small subquests. I have two issues here. One, I have read the Tuto on ?How to make a store/items? and I think I can do it, no problem. What I need is to set up the scenerio so that the option to seeing what is in stock, indeed, even knowing that this new background character IS a trader, is not availible Unless certain dialog chains are gone into. Not right from the git-go I mean. Thus, farther down in the dialog I have:

--------------------------------------------

IF ~~ THEN LaveryQuestionsA
SAY ~Sure, I might be able to help. I?ve seen lots around here, let me tell you. Ask away!~
++ ~What do you do here?~ GOTO LaveryTraderA1  HERE is the option the player can take to go to the block leading to buy/sell
++ ~What can you tell me about King Fellis?~ GOTO LaveryKingInfoA
++ ~What can you tell me about the Chancellor?~ GOTO LaveryChancellorInfoA
++ ~I?ve seen the way you?re staring at October. Have you met before, and if so, can you tell me anything about her?~ GOTO LaveryOctoberInfoA
++ ~What can you tell me about this place?~ GOTO LaveryPlaceInfoA
++ ~What I really need to know is if you have any idea how I can get that damned necklace King Fellis refused to give me!~ GOTO Lavery07A
++ ~I can?t think of much to ask right now, other than how did you know I was ticked off in the first place?~ GOTO Lavery01A
EXIT
END
-------------------------------------------

The Other issue, accessed from the same block, above, is where the PC asks Lavery about his relationship with October. No problem there, except that October has something to say when the chat rolls around. I need to do a CHAIN for October, Lavery and PLAYER1. Can I code it thus:

-------------------------------------------

IF ~~ THEN LaveryOctoberInfoA
SAY ~I was wondering if you were gonna get around to that, though I didn?t know if October mentioned me.~
== OCTOBJ ~Hey, I was just...~
== PLAYERJ ~No, she didn?t.~
== OCTOBJ ~I was going to tell you later on.~
== LAVERYJ ~Shame on you, Tobi!~
== PLAYERJ ~Hmmm.~

Etc.
----------------------------

I feel something is off there.

4. Is there a way to check for charisma number in order for a block of dialog to fire? I have a finish for a quest that is only supposed to happen if the PC has 14 or higher CHA, but don?t know how to code it such in the start.

5. This Might be a matter of Weight. The character Lavery (above) is a flirt and will come on to every female in the group and the PC if female. Problem. I need to get the Important dialog out there and I Don?t need the flirts falling all over themselves (I.E. From Imoen to Mazzy to Nalia etc. while neglecting the important Quest related dialog. Is it a matter of Weight, or do I need some other checks? The flirts cannot just be ignored as this character is based on flirts.

6. Last, is there a list someplace of scripting commands I can write out to make the various visual effects (warping in/out - magic shield bubbles etc) happen? And do I write them in after the regular GLOBALS?

Oh, I am having One Small problem with the .Cre, though tutos say one thing I find that even following directions won?t do the deed in NI. Anyone have a bit of time for that?

Thanks.

Still creeping along.


Minotaur In Maze - Resident Pain In The A** :whistling:
* * * * * *
They say the world is going to Hell.

They are wrong.

The world IS Hell! Always has been, always will be; except perhaps for the five percent or so of the population who can afford differently.

And, if one must reside in Hell, it is far better to do it as a minion of the Devil than as a member of the damned.
* * * * * *
LOVE SUCKS: It makes fools and slaves of us all.
But being alone and unloved is worse.
- Nancy A. Collins "Thin Walls"
* * * * * *

#2 Shed

Shed

    -Shed-

  • Modder
  • 2636 posts

Posted 17 February 2006 - 04:15 PM

So many questions!

Ok, here's a good place to be reminded of: http://iesdp.gibberlings3.net/main.htm . It's a database of every condition, action, effect or identifier you need, so you can look them up yourself.

1.

So, is there a way to code the thing so that if I choose to do a mercy killing, I can kill the zombie and not have every Other creature (Undead) in the area go hostile forever? I also want to give the party (2000XP) Experience for the mercy killing.


Fighting the zombie is not the same as setting other creatures hostile. But if you want the creature to just fall over dead, use Kill(O:Object*) and AddexperienceParty(I:XP*).

2.
IF ~OctoberInpartyTrue()~
Please, oh please, don't just make stuff up.

OctSTB~
This tilda is lost.

(SOMETHING MISSING HERE. NEED TO MAKE Script/.Cre that will trigger only IF October -NPC- In Party ???)
Please, oh please, comment your comments. I can explain why, if you like.

GOTO OctSTB01
EXIT
END
This EXIT is lost.

GOTO OctSTB02
Should I assume by "OctSTB02" you mean "OctSvirTrav02"?

++ ~IsValidForPartyDialogue("Viconia")~ + ~Hold your tongue, insect, lest someone else be tempted to remove it and do it for you.~ + OctSTB04
++ ~IsValidForPartyDialogue("October")~ + ~Can we not help him, <CHARNAME>, he?s just so cute.~ + OctSTB04
These are coded as player responses. It's probably better to use a CHAIN, so you can get October or Viconia's responses. A CHAIN tells WeiDU to let one character talk after another.

CHAIN IF ~~ THEN
GNOME // Where GNOME is the dialogue file used by the gnome
OctSTB03
~Sigh.~
= ~Always wanted to travel have I. Not happy being cooped up underground always. Mayor says I am aberation and not a good Svirfneblin but I cannot change.~
= ~Want to see Overworld soooooo bad, but a lone Svirfneblin would not survive long out there I have been told. In any case, mayor won't let me leave... Especially now since those cursed Drow have been raiding us more often.~
= ~Mayor says every hand will be needed if dirty Drow attack.~
== VICONIJ IF ~IsValidForPartyDialogue("Viconia")~ ~Hold your tongue, insect, lest someone else be tempted to remove it and do it for you.~ + OctSTB04
== OCTOBJ IF ~IsValidForPartyDialogue("October")~ ~Can we not help him, <CHARNAME>, he?s just so cute.~ + OctSTB04
END // We end the chain so the player can answer if neither October nor Viconia are present.
++ ~Hmm, seems a shame not to be able to come and go as you please alright.~ + OctSTB04
++ ~That doesn?t seem right to me.~ + OctSTB04
++ ~Not my problem pal! Scram!~ + OctReject

I can add a GLOBAL that will begin the talk ?IF? the GLOBAL is met (and if it is Not then things just go along as usual. Right? More importantly, as I would be moving from one area (the Svirfneblin village) into another (Place I meet the mayor) do I have to Restart the quest to cary it on I mean, or is it all done with the GLOBALS? This is a question I have often as in this quest I tend to move to different areas a lot...

A global is just a variable that can be set and checked. There's no way to just "start a quest" in BG2. Setting globals doesn't start quests. However, they can be used to change dialogue dependent on events. They can also be checked in scripts.

To set a global in a dialogue file, put this in the relevant DO: ~SetGlobal("Insertyournamehere","GLOBAL",1)~

Or in part of a whole state:
IF ~Global("Insertyournamehere","GLOBAL",0)~ // This will return true if the value of "Insertyournamehere" is 0 or has not been set yet.
Statename
SAY ~Let's set the global!~
IF ~~ THEN REPLY ~4tw.~ DO ~SetGlobal("Insertyournamehere","GLOBAL",1)~ EXIT
END

IF ~Global("Insertyournamehere","GLOBAL",1)~ // This checks that the value of "Insertyournamehere" is 1.
NewState
SAY ~Oh, you set the global!~
++ ~Yes. Yes I did.~ EXIT
END

You can set or check a global anywhere in the game, no matter what map you're in. That's why they call it a "global".

3.
GOTO LaveryTraderA1 ? HERE is the option the player can take to go to the block leading to buy/sell
Please see my earlier comment about comments.

What I need is to set up the scenerio so that the option to seeing what is in stock


StartStore(S:Store*,O:Target*)

In context:
IF ~~ LaveryTraderA1
SAY ~I am a tradesman. Would you like to see today's fine deals?~
IF ~~ THEN ~Yes, please.~ DO ~StartStore("mystore",LastTalkedToBy())~ EXIT
++ ~No.~ EXIT
END

As for:
IF ~~ THEN LaveryOctoberInfoA
SAY ~I was wondering if you were gonna get around to that, though I didn?t know if October mentioned me.~
== OCTOBJ ~Hey, I was just...~
== PLAYERJ ~No, she didn?t.~
== OCTOBJ ~I was going to tell you later on.~
== LAVERYJ ~Shame on you, Tobi!~
== PLAYERJ ~Hmmm.~

Putting words into the player's mouth looks awful. Also, there's no such dialogue file as PLAYERJ and even if there was, it wouldn't be assigned to the player.

4.

Is there a way to check for charisma number in order for a block of dialog to fire? I have a finish for a quest that is only supposed to happen if the PC has 14 or higher CHA, but don?t know how to code it such in the start.


IF ~CheckStatGT(LastTalkedToBy(),16,CHR)~ THEN wub
SAY ~Your charisma is over 16! I want your babies, please.~
++ ~Sweet.~ EXIT
END

5. You want the character to flirt with every female in the party one after the other?

6.

Last, is there a list someplace of scripting commands I can write out to make the various visual effects (warping in/out - magic shield bubbles etc) happen? And do I write them in after the regular GLOBALS?


You want one of these:

272 CreateVisualEffect(S:Object*,P:Location*)
The Object parameter here should actually be ResRef since it references a VVC file with priority. If a VVC file is not found, it will search for a BAM file. If I were to rename this, I'd call it PlayAnimationPoint().
273 CreateVisualEffectObject(S:DialogFile*,O:Target*)
Again, a weird first parameter. DialogFile should actually be ResRef. If a VVC file is found, it will play that, and if not, it will try to play a BAM of the filename specified. The difference between this and CreateVisualEffect() is that this references an object.


You can find the list here if you search for 0xd7 on the page.

#3 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 18 February 2006 - 04:58 AM

++ ~IsValidForPartyDialogue("Viconia")~ + ~Hold your tongue, insect, lest someone else be tempted to remove it and do it for you.~ + OctSTB04
++ ~IsValidForPartyDialogue("October")~ + ~Can we not help him, <CHARNAME>, he’s just so cute.~ + OctSTB04
These are coded as player responses.

They also have an extra +, which will make WeiDU choke.

If you want to add an optional condition, you'll have to code it like this:

+ ~True()~ + ~String.~ + Transition

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#4 -Minotaur Et All-

-Minotaur Et All-
  • Guest

Posted 18 February 2006 - 05:16 AM

THANK YOU BOTH!!! :)

I'll get right on it! :)

Working hard - :)

MiM

#5 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 18 February 2006 - 11:50 AM

Moved topic to the right location, btw. :)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#6 Deathsangel

Deathsangel

    Living on Wings of Dreams

  • Modder
  • 3089 posts

Posted 18 February 2006 - 04:02 PM

IF ~CheckStatGT(LastTalkedToBy(),16,CHR)~ THEN wub
SAY ~Your charisma is over 16! I want your babies, please.~
++ ~Sweet.~ EXIT
END


:ROFL:

Still modding the Mod for the Wicked... It is a big project you know... And I got sidetracked (several times) a bit... sorry.
However, as we all know, Evil never really sleeps.


Sentences marking (my) life:

Winds of change... Endure them, and in Enduring grow Stronger
It takes a fool to look for logic in a man's heart
Never question the sanity of the insane
The Harmony of Life is Chaos
Living on Wings of Dreams



(1st march 2009) SHS women over me:
Kat: if there were more guys that looked like you out here, people's offspring wouldnt be so damn ugly
Noctalys: you are adorable :P

~~ I love it, and I am humbled! Yay! ~~


#7 minotaur_in_maze

minotaur_in_maze

    Modding Prima-Dona

  • Member
  • 906 posts

Posted 19 February 2006 - 04:44 AM

Okay now. :)

[quote name='Shed' date='Feb 18 2006, 12:15 AM' post='240939']
2.
IF ~OctoberInpartyTrue()~
Please, oh please, don't just make stuff up.

--------------------------------------

T'Was a syntax problem. I wanted/Meant for the encounter to fire Only IF October is in the party. I have since gotten it right. :)
--------------------------------------


GOTO OctSTB01
EXIT
END
This EXIT is lost.
-------------------------------

THIS one I didn't get. I still can't find it. What is missing?
-------------------------------

CHAIN IF ~~ THEN
GNOME // Where GNOME is the dialogue file used by the gnome
OctSTB03
~Sigh.~
= ~Always wanted to travel have I. Not happy being cooped up underground always. Mayor says I am aberation and not a good Svirfneblin but I cannot change.~
= ~Want to see Overworld soooooo bad, but a lone Svirfneblin would not survive long out there I have been told. In any case, mayor won't let me leave... Especially now since those cursed Drow have been raiding us more often.~
= ~Mayor says every hand will be needed if dirty Drow attack.~
== VICONIJ IF ~IsValidForPartyDialogue("Viconia")~ ~Hold your tongue, insect, lest someone else be tempted to remove it and do it for you.~ + OctSTB04
== OCTOBJ IF ~IsValidForPartyDialogue("October")~ ~Can we not help him, <CHARNAME>, he?s just so cute.~ + OctSTB04
END // We end the chain so the player can answer if neither October nor Viconia are present.
++ ~Hmm, seems a shame not to be able to come and go as you please alright.~ + OctSTB04
++ ~That doesn?t seem right to me.~ + OctSTB04
++ ~Not my problem pal! Scram!~ + OctReject

Okay, if I am reading this right - I can make all of the Gnome's dialog into a seperate file attached to the .Cre and put the END After any possible interjections from Viccy or October but Before CHARNAME replied. GOT IT!

Ongoing thanks - I am recoding/writing now!

Minotaur - Goal in life is to make a mod!
* * * * * *
They say the world is going to Hell.

They are wrong.

The world IS Hell! Always has been, always will be; except perhaps for the five percent or so of the population who can afford differently.

And, if one must reside in Hell, it is far better to do it as a minion of the Devil than as a member of the damned.
* * * * * *
LOVE SUCKS: It makes fools and slaves of us all.
But being alone and unloved is worse.
- Nancy A. Collins "Thin Walls"
* * * * * *

#8 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 19 February 2006 - 05:09 AM

T'Was a syntax problem. I wanted/Meant for the encounter to fire Only IF October is in the party. I have since gotten it right. :)

No, no, no. What Shed was trying to say is that you can't, in any case, invent new things. Triggers are already listed in the game mechanics, and you can't use anything but those already there. You can't make up new things and expect the game engine to 'guess' what you mean - you'll have to use the same triggers as the game creators and all other modders do.

There's no such thing as OctoberInpartyTrue(). You'll want 0x4043 InParty(O:Object*) (found together with all other valid triggers here), which would be:

InParty("October")

...if the deathvariable of your creature is "October".

THIS one I didn't get. I still can't find it. What is missing?

Nothing's missing -- quite to the contrary, you have an "EXIT" which shouldn't be there.

Okay, if I am reading this right - I can make all of the Gnome's dialog into a seperate file attached to the .Cre and put the END After any possible interjections from Viccy or October but Before CHARNAME replied. GOT IT!

All of the Gnome's dialogue should be in a seperate file attached to the .cre-file. That's how the game engine works - with all dialogue and all creatures.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner