Jump to content


Photo

Help with NPC mod?


  • Please log in to reply
7 replies to this topic

#1 candyapple

candyapple
  • Member
  • 4 posts

Posted 26 December 2018 - 11:58 PM

I've just gotten into attempting my own NPC mod. However, I've come into a problem and I'm not quite sure how to solve it or where the problem is even coming from. 

 

I've been able to spawn my NPC with all the join/kick out dialogue in the area and position I want him to, but whenever I enter the map he immediately starts walking toward the nearest companion character or PC and initiates dialogue. He even walked up to Viconia at one point when she wasn't even in my current party. I've triple checked the script file where he spawns and the dialogue file where he joins the party, but nothing seems to be amiss. (I've been using the Branwen mod as my main reference). 

 

I was thinking it might have something to do with how I've edited the .cre file, which i made using shadowkeeper. That's the only thing I can think of, but I have no idea what to even fix. Any help would be appreciated! 

Attached Files


Edited by candyapple, 27 December 2018 - 01:06 PM.


#2 Creepin

Creepin
  • Administrator
  • 1676 posts

Posted 27 December 2018 - 03:58 AM

Hard to say anything without seeing your scripts.

 

Also, it's not precisely clear from your description does your NPC starts walking even when he is outside of the visual range of the party?


The Old Gold - v0.2 WIP (mod for BGT/BWP/BWS)


#3 candyapple

candyapple
  • Member
  • 4 posts

Posted 27 December 2018 - 01:07 PM

Hard to say anything without seeing your scripts.

 

Also, it's not precisely clear from your description does your NPC starts walking even when he is outside of the visual range of the party?

 

Yes, as soon as I enter the map he will start walking toward the closest companion character or PC, even if I can't see him. I've attached the .baf file to the original post. 



#4 Creepin

Creepin
  • Administrator
  • 1676 posts

Posted 27 December 2018 - 02:10 PM

Regarding scripts: can you also attach your NPC's scripts, all of them? Your area script looks just fine.

 

Regarding walking offscreen - there's effect #293, it might be called "Enable Offscreen AI" or "Set Persistent AI" or something along these lines depending on what utility you use to check your .cre file. Do check if you accidentally had this effect attached to your .cre?


The Old Gold - v0.2 WIP (mod for BGT/BWP/BWS)


#5 candyapple

candyapple
  • Member
  • 4 posts

Posted 27 December 2018 - 02:26 PM

Regarding scripts: can you also attach your NPC's scripts, all of them? Your area script looks just fine.

 

Regarding walking offscreen - there's effect #293, it might be called "Enable Offscreen AI" or "Set Persistent AI" or something along these lines depending on what utility you use to check your .cre file. Do check if you accidentally had this effect attached to your .cre?

 

Thats the only script I have at the moment. I've only done the bare minimum for the mod right now since I'm just trying to get the hang of it at the moment. According to the guide I've been using I shouldn't require any other scripts as far as I know. This is the one dialogue file I have (which I basically just copied and pasted straight from the guide, dialogue and all).

 

I've been using shadowkeeper to work with the .cre file. I couldn't find anything like that in shadowkeeper, should I be using a different program? 

Attached Files



#6 Gwendolyne

Gwendolyne
  • Staff
  • 483 posts

Posted 27 December 2018 - 06:33 PM

What Creepin means is that you probably created your cre file from an existing one, and one of its scripts involves its behavior. So, post your cre file, please. ;)


CARPE DIEM ....
 

In progress : Menace sur le Royaume de Diamant Éternel there.

#7 candyapple

candyapple
  • Member
  • 4 posts

Posted 27 December 2018 - 07:09 PM

What Creepin means is that you probably created your cre file from an existing one, and one of its scripts involves its behavior. So, post your cre file, please. ;)

 

I see. I thought it might be something like that.

Attached Files



#8 Creepin

Creepin
  • Administrator
  • 1676 posts

Posted 28 December 2018 - 01:39 AM

That is weird. Your cre doesn't have effect #293 attached, so at this point I can't really say why does it function off screen. Unless you are making your NPC for EE and EE changed all scripts to run in the background by default (wild guess, I have no idea how EE works). BTW I find it most convenient to check stuff like this with Near Infinity, though Infinity Explorer would handle that too. Not so sure about ShadowKeeper, haven't used that for like 10 years. Still, whatever the reason for that offscreen behaviour, you could curb it by putting See(Player1) among the triggers of your dialogue initiation script snippet. Wouldn't hurt to refine his targeting as well so that he wouldn't try to chat with Viconia. Something like that:

IF
   See(Player1)
THEN
   RESPONSE #100
      StartDialogueNoSet(LastSeenBy())
END

Unfortunately your script afslay.bcs can't be checked unless you attach that too so this is just a general idea.


The Old Gold - v0.2 WIP (mod for BGT/BWP/BWS)