She only attacks when she wants to, please help
#1
Posted 21 February 2007 - 12:01 PM
I have a question that I hope will be quite easy to answer. I have coded my NPC so that, on two different occasions, she 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
#2
Posted 21 February 2007 - 01:30 PM
EDIT: This should be in IE Help forums, not Modders' Room.
Khadion NPC mod - Team leader, head designer
Hubelpot NPC mod - Team leader, coder
NPC Damage - Coder
PC Soundsets - Coder, voice actor
Brythe NPC mod - Designer
DragonLance TC - Glory of Istar - Designer
The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
The Jerry Zinger Show - Producer
Iron Modder 5 - Winner
#3
Posted 21 February 2007 - 04:41 PM
In both instances she and the PC are talking about wether she is going to join the party or not, then the PC insults her, she gets angry and attacks him/her......so to answer your question......ummm, kinda?
#4
Posted 21 February 2007 - 05:04 PM
Khadion NPC mod - Team leader, head designer
Hubelpot NPC mod - Team leader, coder
NPC Damage - Coder
PC Soundsets - Coder, voice actor
Brythe NPC mod - Designer
DragonLance TC - Glory of Istar - Designer
The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
The Jerry Zinger Show - Producer
Iron Modder 5 - Winner
#5
Posted 21 February 2007 - 06:38 PM
In the second one, she has been in, got kicked out, and is talking to the PC about possibly rejoining.
Does this help?
#6
Posted 21 February 2007 - 07:49 PM
Khadion NPC mod - Team leader, head designer
Hubelpot NPC mod - Team leader, coder
NPC Damage - Coder
PC Soundsets - Coder, voice actor
Brythe NPC mod - Designer
DragonLance TC - Glory of Istar - Designer
The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
The Jerry Zinger Show - Producer
Iron Modder 5 - Winner
#7
Posted 22 February 2007 - 05:55 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! ~~
#8 -Guest-
Posted 22 February 2007 - 06:10 AM
No, there are no scripts, that I am aware of assigned to the .cre-file. So far all that I have created for her is the tp2, the exe, the .d, the area.baf, portraits (hmm, this might be attached to it?), the NPC.cre. and the attk.baf (to instruct her to attack any enemy she sees)
DeathsAngel
I am afraid I am new to this whole coding stuff, how would you code this "script attack(Player1)"? Perhaps this may be the answer to this puzzle.
#9
Posted 22 February 2007 - 06:13 AM
Keldon
#10
Posted 22 February 2007 - 06:25 AM
If you include the following line in your tp2, it will assign her the override script MyScript. You would then put everything you wanted her to do, like attack Player1, in it. Unfortunately, I'm at work, so the long answers will have to wait until later.
In the tp2:
COPY ~MyMod/CRE/MyNPC.cre~ ~override~ //various sound assignments WRITE_ASCII 0x280 #8 ~MyScript~ //I think that hex offset is right, but would someone be able to check?
Then later on, you would compile her script in the tp2:
COMPILE ~MyMod/BAF/MyScript.baf~
"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#11
Posted 22 February 2007 - 06:42 AM
IF ~~ THEN BEGIN noofcy
SAY ~You will not offend Cyric in my presence so easily. You will die for your insolence!~
IF ~~ THEN DO ~Attack(Player1)~ EXIT
END
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! ~~
#12
Posted 22 February 2007 - 06:55 AM
Deathsangel.....I am very excited about being able to put it in the .d the way you just suggested. It just seems so very simple and straightforward!
Thank you very much for that.
On a bit of a different note, one question that has crossed my mind a few times is....I am creating an evil NPC to share with the community, you are creating The Mod for the Wicked (which I am very excitedly awaiting). Maybe, with this similarity we share, we can collaborate and see if the two can become associated somehow? I don't know if this goes against any particular rules, and hope it in no way offends you....I was just thinking that it might be a neat thing to do. (How is the mod for the wicked coming along?)
Peace
Keldon
#13
Posted 22 February 2007 - 07:11 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! ~~
#14
Posted 22 February 2007 - 02:35 PM
The entire reason I'm asking the questions is that is you do have a script assigned to the character in any other slot than override, they get wiped when the NPC joins the party.No, there are no scripts, that I am aware of assigned to the .cre-file. So far all that I have created for her is the tp2, the exe, the .d, the area.baf, portraits (hmm, this might be attached to it?), the NPC.cre. and the attk.baf (to instruct her to attack any enemy she sees)
attk.baf, you say. Where are you using that?
0x280 is the deathvariable. #8 is not necessary unless you're overwriting another string, and should be placed after the string (~~).COPY ~MyMod/CRE/MyNPC.cre~ ~override~ //various sound assignments WRITE_ASCII 0x280 #8 ~MyScript~ //I think that hex offset is right, but would someone be able to check?
Also, WeiDU support certain constants, which makes it easier to remember than keeping all offsets in your head.
COPY ~MyMod/CRE/MyNPC.cre~ ~override~ WRITE_ASCII SCRIPT_OVERRIDE ~MyScript.bcs~ #8
That's one way to do it, but if you have a script, you should use that instead. Why? Because if you have a good script assigned to the NPC, he or she will actually do more than just swing his sword - use potions, combat tactics and whatnot. If it's a mage, he will cast spells, and so on.Deathsangel.....I am very excited about being able to put it in the .d the way you just suggested. It just seems so very simple and straightforward!
Thank you very much for that.
Note that it doesn't applies if your script only says Attack() - that's just the same thing. I'm talking about if you have a good script assigned to the creature.
Khadion NPC mod - Team leader, head designer
Hubelpot NPC mod - Team leader, coder
NPC Damage - Coder
PC Soundsets - Coder, voice actor
Brythe NPC mod - Designer
DragonLance TC - Glory of Istar - Designer
The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
The Jerry Zinger Show - Producer
Iron Modder 5 - Winner
#15
Posted 22 February 2007 - 03:42 PM
Also, WeiDU support certain constants, which makes it easier to remember than keeping all offsets in your head.
COPY ~MyMod/CRE/MyNPC.cre~ ~override~ WRITE_ASCII SCRIPT_OVERRIDE ~MyScript.bcs~ #8
Bless you, from the bottom of my black little heart. I do so hate trying to keep those wretched offsets in mind. I have no memory for stuff like that.
"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#16
Posted 22 February 2007 - 04:00 PM
These are the constants you can use: SCRIPT_OVERRIDE, SCRIPT_CLASS, SCRIPT_RACE, SCRIPT_GENERAL, SCRIPT_DEFAULT, DEATHVAR, DIALOG and AREA_SCRIPT
Khadion NPC mod - Team leader, head designer
Hubelpot NPC mod - Team leader, coder
NPC Damage - Coder
PC Soundsets - Coder, voice actor
Brythe NPC mod - Designer
DragonLance TC - Glory of Istar - Designer
The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
The Jerry Zinger Show - Producer
Iron Modder 5 - Winner
#17
Posted 23 February 2007 - 03:12 AM
That's one way to do it, but if you have a script, you should use that instead. Why? Because if you have a good script assigned to the NPC, he or she will actually do more than just swing his sword - use potions, combat tactics and whatnot. If it's a mage, he will cast spells, and so on.
Note that it doesn't applies if your script only says Attack() - that's just the same thing. I'm talking about if you have a good script assigned to the creature.
I agree totally, but it seemed to be he just needed flat out attack. That is why I suggested it, but I agree with you Sebastiaan.
It does get a lot easier, doesn't it?
These are the constants you can use: SCRIPT_OVERRIDE, SCRIPT_CLASS, SCRIPT_RACE, SCRIPT_GENERAL, SCRIPT_DEFAULT, DEATHVAR, DIALOG and AREA_SCRIPT
Hm... I already add all that stuff to the .cre file, not adding it by WeiDU. I know its possible, but I seem to miss the benefit of it. I am sure there is one, but I'm missing it.
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! ~~
#18
Posted 23 February 2007 - 03:17 AM
COPY_EXISTING ~_servan.cre~ ~override/B!MESNGR.cre~
SAY NAME1 ~Temple Messenger~
SAY NAME2 ~Temple Messenger~
//various sound assignments
WRITE_ASCII SCRIPT_OVERRIDE ~B!MESNGR.bcs~
WRITE_ASCII DIALOG ~B!MESNGR.dlg~
WRITE_ASCII DEATHVAR ~B!MESNGR~
It's much easier than making up a new CRE that will be on screen for 30 seconds.
"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#19
Posted 23 February 2007 - 03:19 AM
Personally, I find it way easier to add scripts to a number of creatures by copy/pasting code rather than opening them all up in NI to edit it individually. It's simply faster - especially if you have more than one creature.Hm... I already add all that stuff to the .cre file, not adding it by WeiDU. I know its possible, but I seem to miss the benefit of it. I am sure there is one, but I'm missing it.
It's even more useful when you use COPY_EXISTING, and want to patch creatures instead of adding new ones. (EDIT: Yeh, what BGhead said.)
Edited by SConrad, 23 February 2007 - 03:20 AM.
Khadion NPC mod - Team leader, head designer
Hubelpot NPC mod - Team leader, coder
NPC Damage - Coder
PC Soundsets - Coder, voice actor
Brythe NPC mod - Designer
DragonLance TC - Glory of Istar - Designer
The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
The Jerry Zinger Show - Producer
Iron Modder 5 - Winner
#20
Posted 23 February 2007 - 03:36 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! ~~