Author Topic: Three Questions  (Read 11901 times)

0 Members and 1 Guest are viewing this topic.

Offline Sillara

  • Retired Modder
  • Level 2
  • *****
  • Posts: 888
  • Karma: +2/-0
  • Gender: Female
    • MSN Messenger - gilalion
    • AOL Instant Messenger - sk8pilmp
    • Yahoo Instant Messenger - charisariel
    • View Profile
    • http://www.gilalion.com
    • Email
Three Questions
« on: April 04, 2012, 03:55:58 PM »
Posted: Mon Feb 09, 2004 4:00 pm    

As the title says, I have three questions. icon_redface.gif

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? 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!!!
Can you accept a necromancer? Can you trust a murderer? Can you love Tsujatha?
If you like Tsujatha, you should read his novels.
Natha ssin'urn lu' dwalc ilythiiri noamuth wund l' rivven: Yasraena zhah ghil!
Saerileth's bounty is as boundless as the sea; the more  she gives to you, the more she has, for her love is infinite.

Offline Solaufein

  • Lord of the Realms
  • Administrator
  • Level 5
  • *****
  • Posts: 5149
  • Karma: +127/-19
  • Gender: Male
  • The night is dark and full of terrors...
    • ICQ Messenger - 251194643
    • Yahoo Instant Messenger - gscott7833
    • View Profile
    • http://teambg.net
Three Questions
« Reply #1 on: April 04, 2012, 03:55:59 PM »
Posted: Mon Feb 09, 2004 8:46 pm    
Quote

Sillara of the Tamari wrote:
As the title says, I have three questions. icon_redface.gif

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? 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!!!


I'll see if I can answer later today since I am tired at the moment. In the mean time.

Questions 1 and 2 is there someone in the party T does not like that would cause this? Something I am doing with Calli would be like this speaking in non coding terms.

IF ~InParty("viconia")
InParty("solaufein")~
THEN BEGIN 1
SAY ~I have nothing to say to you while those damned drow are in your group!~ THEN DO ~SetGlobal("CalliRefuse", 1)
END
EXIT


This means she sees that Viconia and Solafein are in the group, she has not talked to the group yet and refuses to join.


IF ~InParty("viconia")
InParty("solaufein")
SetGlobal("CalliRefuse", 1)~
THEN BEGIN 1
SAY ~That did it now you die!~ THEN DO~ChangeEnemyAlly(Myself,EVILCUTOFF)
Enemy()
Attack(NearestEnemyOf(Myself))~
END
EXIT

This one is doing this. The group has the nerve to talk to Calli again with the drow in the party, she is pissed and now will attack the party.

This is by no means a precise coding example I am doing this at the top of my head.
My mods:
Dark Horizons
The Undying
Nikita
IWD2 store

Co-contributor:
Dark Side of the Sword Coast BG1 Weidu
Aurils Bane
Encounters
Saerileth
Baldur's Gate - Enhanced Edition beta tester
Baldur's Gate 2 - Enhanced Edition beta tester
Icewind Dale - Enhanced Edition beta tester

Offline Sillara

  • Retired Modder
  • Level 2
  • *****
  • Posts: 888
  • Karma: +2/-0
  • Gender: Female
    • MSN Messenger - gilalion
    • AOL Instant Messenger - sk8pilmp
    • Yahoo Instant Messenger - charisariel
    • View Profile
    • http://www.gilalion.com
    • Email
Three Questions
« Reply #2 on: April 04, 2012, 03:56:01 PM »
Posted: Tue Feb 10, 2004 1:35 pm    

That was helpful! icon_biggrin.gif Is there anything I need to do to create a global variable beyond type in "SetGlobal Virgin","1" or whatever? Do I have to code in some sort of definition for the variable? I noticed you put in a Set CalliRefuse to 1 sort of thing, so I figured you could help me.

Thanks!

Sillara
Can you accept a necromancer? Can you trust a murderer? Can you love Tsujatha?
If you like Tsujatha, you should read his novels.
Natha ssin'urn lu' dwalc ilythiiri noamuth wund l' rivven: Yasraena zhah ghil!
Saerileth's bounty is as boundless as the sea; the more  she gives to you, the more she has, for her love is infinite.

Offline Solaufein

  • Lord of the Realms
  • Administrator
  • Level 5
  • *****
  • Posts: 5149
  • Karma: +127/-19
  • Gender: Male
  • The night is dark and full of terrors...
    • ICQ Messenger - 251194643
    • Yahoo Instant Messenger - gscott7833
    • View Profile
    • http://teambg.net
Three Questions
« Reply #3 on: April 04, 2012, 03:56:02 PM »
Posted: Tue Feb 10, 2004 8:23 pm    

Setting it to one is a way for the game not to repeat that dialogue again. Which is helpful when the second dialogue comes up because statement one has been executed so statement 2 will be true. You should use weidu and decompile dialogues like Aerie's for example.

Also look at creature scripts which is what executes the dialogues. Look at Aeries script file with Near Infinity. I'll do a make up sample

Script file

Code: [Select]
Code:


IF
  AreaCheck("2100")
  Global("HateUnderdark", "GLOBAL" 0)
THEN
  Interact(Player1)
END


This script is telling the game to execute the dialogue that has the Global HateUnderdark.

Code: [Select]
Code:


IF
  ~AreaCheck("2100")
  Global("HateUnderdark", "GLOBAL" 0)~ BEGIN 1
  SAY ~I hate the Underdark boo hoo!~ THEN DO ~SetGlobal("HateUnderdark", "GLOBAL" 1)~
EXIT
END


HateUnderdark has been set to 1 so now it will not repeat. It takes time to understand this. I learned it by going over the games dialogue and script files.
My mods:
Dark Horizons
The Undying
Nikita
IWD2 store

Co-contributor:
Dark Side of the Sword Coast BG1 Weidu
Aurils Bane
Encounters
Saerileth
Baldur's Gate - Enhanced Edition beta tester
Baldur's Gate 2 - Enhanced Edition beta tester
Icewind Dale - Enhanced Edition beta tester