Author Topic: Minor Questions On Quest Coding/Scripting/Visual Effects  (Read 3121 times)

0 Members and 1 Guest are viewing this topic.

Offline Blue_Minotaur

  • Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
    • View Profile
    • Email
Minor Questions On Quest Coding/Scripting/Visual Effects
« on: February 17, 2006, 01:56:10 PM »
After a couple of Years, and after being given a HUGE amount of guidance from the friendly folk here - I am getting the rudiments of coding and making HUGE advances!

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.

Blue Minotaur - Is there Anyone I haven't P*ssed off? :)
Feel the authority of my horns

Offline jastey

  • Newbie
  • *
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Minor Questions On Quest Coding/Scripting/Visual Effects
« Reply #1 on: February 18, 2006, 06:53:48 AM »
Oktober is the death variable of your NPC, and the quest should only trigger if she is in the party?
"InParty("Oktober")" would be the trigger then. I am not sure what you mean with "NEED TO MAKE Script/.Cre that will trigger". Do you want the zombie only to appear if October is in the party? Then the creation block would go into the area script, I'd suppose.

IF
   InParty("Oktober")
   Global("MyZombieExists","GLOBAL",0)
THEN
   CreateCreature("zombie",[xxx.yyy],0)
   SetGlobal("MyZombieExists","GLOBAL",1)
END

would be EXTEND_BOTTOM to the area script of the relevant area.

Then the zombie could have the dialogue file with

IF ~NumTimesTalkedTo(0)~ THEN OctSTB
SAY ~Sigh. (Frown. Yawn) etc.~
...

"NumTimesTalkedTo(0)" means he wasn't spoken to before. It's a LOCALS variable.

You find these triggers in the iesdp listed: BG2 triggers. Or I go into NI and have a look at the .ids listings. For charisma check it would be "CheckStatGT(Player1,13,CHR)" (for charisma greater than 13, meaning 14 or higher, of player1 the condition would be true).

GLOBALs are variables the game recognises on every area for every character, so moving between areas in your quest with set GLOBAL variable is no problem. LOCALS are variables only true for the NPC they are related to (and get lost if the Cre is dying and newly created). There also exist AREA variables, which, obviously, are only remembered for a certain area.

Chain: I would be interested if your chain example would be working myself, actually. When I learned how to code chains it went like this:

CHAIN LAVERYJ LaveryOctoberInfoA
~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.~

Although I would prefer Player1 to have some more possibilities to choose an answer, if s/he has to comment at all, but that's only my opinion. Adding answer options after a chain would go like this:

CHAIN LAVERYJ LaveryOctoberInfoA
~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...~
END
++ ~No, she didnít.~ + LaveryOctoberInfoB
++ ~Doesn't matter, go on.~ + LaveryOctoberInfoB

CHAIN OCTOBJ LaveryOctoberInfoB
~I was going to tell you later on.~
== LAVERYJ ~Shame on you, Tobi!~
END
++ ~Hmmm.~

Note that chains have to be put at the end of the dialogue file for compiling.

For answering question 5 I 'd need some more info about the dialogues and what should happen when. Actually you can always trigger the diaogue blocks in a way they do not fire if crucial quest dialogues should appear first. It's not only wheight but also including the relevant triggers into the IF ~~ THEN condition of the dialogue.

Sorry I don't answer to all of your questions, but I am a bit in a hurry right now. Maybe I find some more time later.

Offline jastey

  • Newbie
  • *
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Minor Questions On Quest Coding/Scripting/Visual Effects
« Reply #2 on: February 18, 2006, 10:05:53 AM »
OK, just realized you posted the same questions at SSH and already got answers. Maybe next time you could mention your double posting, as now I feel I could have spend my time something more useful than typing things you already heard.

Offline Blue_Minotaur

  • Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
    • View Profile
    • Email
Sorry about not mentioning the multiple posting, but...
« Reply #3 on: February 18, 2006, 01:50:39 PM »
...truth be told, Your answers Here actually TOLD me a lot more on what I need to do. In this case, the answers I got here were much clearer to a brain trust such as myself. :)

Thanks! :)

Minotaur
Feel the authority of my horns

Offline jastey

  • Newbie
  • *
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Minor Questions On Quest Coding/Scripting/Visual Effects
« Reply #4 on: February 18, 2006, 02:46:25 PM »
Thanks, that calmed me down. Sorry, didn't mean to sound offended (or offending), I just got the impression I spent (a lot of) typing time invain. So if that wasn't the case I'm happy.
Maybe best if you repose the remaining questions, so we can have go on them, too.