Jump to content


NSC Script-Problem


  • Please log in to reply
14 replies to this topic

#1 -Arren-

-Arren-
  • Guest

Posted 03 August 2009 - 12:34 PM

Hi there

I have a strange problem with my mod. After my NPC joins the party his override script is set to "none". The CRE file of my NPC has got the correct entry before installing, after installing and even after the NPC was created via script it has got the correct script assigned. And after he joins all modding hell is breaking loose. <_<

Since I?m just starting I follow the various tuts very accurately and don?t do fancy stuff. I just use JoinParty() and set a variable. Somebody got an idea?

so long

Arren

#2 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 03 August 2009 - 02:00 PM

I don't know why the script is getting changed on you, but you could try the following and see if it helps you...


In the state that has JoinParty() add
ChangeAIScript("script_name",OVERRIDE) //replace script_name with your script's name.

I think that this will ensure that your script is properly assigned.

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#3 Arren

Arren
  • Member
  • 6 posts

Posted 04 August 2009 - 12:12 AM

I tried this Action already, but it still doesn´t work.
I also created a new CRE and new Scripts and Dialogs, but the Problem still exists.
I use a Vanilla-BGT Installation, with no Mods, just the Textpacks and some Bugfixes.
I'm still here.

#4 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 04 August 2009 - 06:46 AM

I don't know why the script is getting changed on you, but you could try the following and see if it helps you...


In the state that has JoinParty() add
ChangeAIScript("script_name",OVERRIDE) //replace script_name with your script's name.

I think that this will ensure that your script is properly assigned.

Well, you would need to reinsure it by ActionOverride()

So it would go like this:
ActionOverride("DV",ChangeAIScript("script_name",OVERRIDE))
Where the "DV" is the creatures Script Name(editable with .cre editors like Near Infinity), inside the quotemarks.

Deactivated account. The user today is known as The Imp.


#5 Arren

Arren
  • Member
  • 6 posts

Posted 05 August 2009 - 12:59 AM

Okay, I tried these:

IF ~~ THEN BEGIN 1-2
	SAY ~Mir gehts gut. Kann ich mich dir anschließen?~
		IF ~~ THEN REPLY ~Ja, klar.~ DO ~SetGlobal("##dbjoined","GLOBAL",1) JoinParty() ActionOverride("##db",ChangeAIScript("##db",OVERRIDE))~ EXIT
		IF ~~ THEN REPLY ~Ne du, grad nicht.~ EXIT
END

Still doesn't work.
This is freakin, I´m very sure that my code match the codes in the tuts and compiling works without any problems.
I don't know what's going wrong.
That's bad I can't mod anything while my NSC has not a script...
I'm still here.

#6 Grim Squeaker

Grim Squeaker

    Fallen

  • Member
  • 1018 posts

Posted 05 August 2009 - 02:31 AM

Ermmm... did you append the appropriate 2da files in the tp2?
"You alone can make my song take flight..."

#7 Arren

Arren
  • Member
  • 6 posts

Posted 05 August 2009 - 04:18 AM

Sorry, did you mean this?
APPEND ~pdialog.2da~
~##db ##dbP ##dbJ ##dbD ##db25P ##db25J ##db25D ##db25~
UNLESS ~##db~

APPEND ~interdia.2da~
~##db ##dbB ##db25B~
UNLESS ~##db~

If not, then no, I only append this 2DAs. Which should I also append?
(Sorry, it´s my first time as a BG-Modder, I don´t know exactly what you mean...)
I'm still here.

#8 Taimon

Taimon
  • Member
  • 387 posts

Posted 05 August 2009 - 04:37 AM

If all else fails attach your work in progress here, so that other people might have a closer look at it.

Edited by Taimon, 05 August 2009 - 04:38 AM.


#9 Arren

Arren
  • Member
  • 6 posts

Posted 05 August 2009 - 05:51 AM

If all else fails attach your work in progress here, so that other people might have a closer look at it.

Okay, that´s a good idea^^
The file contains the NPC I created.
If somebody could take a look at him and maybe find the error, I would be very happy.
Thanks a lot.Attached File  db.rar   473.21K   176 downloads
I'm still here.

#10 Taimon

Taimon
  • Member
  • 387 posts

Posted 05 August 2009 - 08:35 AM

Not sure what you are doing, but this works for me. Even when I delete the "Change AI Script" action from the dialogue.

I added a simple block to the override script to check whether the script is run.
IF
	InParty(Myself)
THEN
	RESPONSE #100
		DisplayString(Myself,1234)
END


#11 Arren

Arren
  • Member
  • 6 posts

Posted 05 August 2009 - 10:50 AM

Argh, this is curious(for me...)
Maybe their`s something with the Installation, huh?
I think I try a complete new-one, then I will look.
Thanks @all
(If a few more people could try, if it works for them, it would be perfect!Thanks!)
I'm still here.

#12 -kaschpakopp-

-kaschpakopp-
  • Guest

Posted 05 August 2009 - 03:59 PM

Well, I tried it. And it doesn't work.

I added two things to his script. As you can see, first he spams his line. after he joins, he displays it once and then no more. because his override script entry's gone the way of all flesh... :D

#13 Taimon

Taimon
  • Member
  • 387 posts

Posted 05 August 2009 - 10:21 PM

You guys seem to be testing on BGT while I tested on vanilla ToB.
I'd say, there is something in the area script of AR0015 (candlekeep prologue), that messes with your override script.
Could be the HP adjustment, that Ascension64 did come up with.

/Edit:
If you give your NPC at least 2 XP, he should not be affected.

Edited by Taimon, 05 August 2009 - 10:40 PM.


#14 Arren

Arren
  • Member
  • 6 posts

Posted 06 August 2009 - 06:50 AM

BÄM!
THANKS Taimon and all other of course also.
After I give my NPC 20 XP, it now works perfectly and he has his script.
Thanks a lot!
But what WAS exactly the problem? sorry, but I don´t get it...
I'm still here.

#15 Taimon

Taimon
  • Member
  • 387 posts

Posted 06 August 2009 - 11:27 AM

BGT does some magic to ensure that your players get the correct amount of HP on startup and in one particular case it needs to check something via script. (It uses the override script slot to do this.)
The whole HP adjustment process is only done if your player has 0 or 1 XP.