Pullin' the old switcheroo trick (PLEASE help!)
#1
Posted 20 February 2007 - 03:25 PM
At some point, I want my NPC to speak to a merchant and, in dialogue, have him upgrade her dagger to another that will actually be useful in ToB.
I know that when the characters come out of the underdark and their drow items get changed to adamintine dust the coding goes like this
IF
Global("DROWITEMCHECKDONE","GLOBAL",0)
HasItem("DWCHAN01",Player1)
THEN
RESPONSE #100
TakeItemReplace("DWDUST","DWCHAN01",Player1)
................ (more actions)
END
How do I change this into what I need for my NPC and in which file do I put it?
Thank you
Keldon
#2
Posted 21 February 2007 - 01:22 AM
Several NPCs have examples of that - If I am not mistaken Kelsey, Sheena and several others have such a dialogue. - maybe it would be best to check that out - mods of others are always the best tutorials.
Edited by Thauron, 21 February 2007 - 01:24 AM.
#3
Posted 21 February 2007 - 02:24 AM
TakeItemReplace(S:Give*,S:Take*,O:Object*)
So adapting the script for your item (MyItem1 and 2) would look like:
IF Global("MYITEMSWITCH","GLOBAL",0) HasItem("MYITEM1",Player1) THEN RESPONSE #100 TakeItemReplace("MYITEM2","MYITEM1",Player1) END
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move - Douglas Adams
I like persons better than principles, and I like persons with no principles better than anything else in the world - Oscar Wilde
Give a man a fire, and he's warm for a day. But set a man on fire, and he's warm for the rest of his life. - Terry Pratchett
#4
Posted 21 February 2007 - 10:12 AM
If you try to get the dialog to work and then post the dialog code when you have that we can show where to put the appropriate Action.
#5
Posted 21 February 2007 - 11:34 AM
Thank you very much for the help you gave me on this one! it was very much appreciated.
I now have a second question.....I have coded it so that, on two different occasions, my NPC can go hostile and attack the PC. Now, I have tried it with each entry going to their perspective attk1 and attk2, and both of them going to just attk2.
The reason for this is that in the first case, the NPC goes hostile but then just stands there, won't even attack back if the PC attacks her.
In the second case, everything goes exactly as I want it to, she goes hostile and attacks the PC.
Since there is no difference in the coding, how come she won't attack the first time but she will the second?
Does anyone know the answer to this?
Thank you
Keldon
#6
Posted 21 February 2007 - 12:35 PM
Maybe if you can post the relevant parts from your dialogue and your NPC-override script we might be able to figure it out.
#7
Posted 27 February 2007 - 11:15 AM
Sticz
#8
Posted 27 February 2007 - 11:45 AM
I will code that in when I get home and see how it works for me!
Keldon
#9
Posted 28 February 2007 - 12:47 AM
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
~~ I love it, and I am humbled! Yay! ~~
#10
Posted 28 February 2007 - 08:54 AM
Thank you for all your support on this issue. I have finally been successful in getting my NPC to go hostile on command.
I used DeathsAngel's idea of adding it to the dialogue file but added in a few other parts of coding that other people had suggested.
It took some teamwork, but working together, we were successful and I want to extend a heartfelt thanks to all who helped.
Peace
Keldon