Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding NPC Chat
#1
Ok I pretty much have it but I just have some trouble... right now I have it open a form and say the attacksay and the npcs name. How its set now it only does it when you attack an agressive NPC.

I tried on a friendly one but it says I cant hurt it and wont bring it up. I tried to set it if FRIENDLY then to do it but some reason its not working.

On the Server in modGameLogic I have this in the AttackNPC sub

Code:
' Check if we should send a message
        If MapNpc(MapNum, MapNpcNum).Target = 0 And MapNpc(MapNum, MapNpcNum).Target  Attacker Then
            If Trim(Npc(NpcNum).AttackSay)  "" Then
                Call NPCTalk(Attacker, Trim(Npc(NpcNum).Name), Trim(Npc(NpcNum).AttackSay), SayColor)
            End If
        End If

Thats when it used to call AttackSay but I made it open the chatbox and so on.

Anyways where should I place the code or whatever to get it to do it when I try to attack a Friendly Target... that way it wont bring up a chat when you attack a monster and only when its friendly.

Thanks
Reply
#2
Someone posted a tut for that. So that it works with shop keeper, friendly, etc.
Reply
#3
It says you can't attack that npc becouse you realy can't. That verification is made inside function CanAttackNpc. Just search for .Behavior and you will find something.
Reply
#4
Ok thanks... so I guess I have it placed in the wrong spot. I will check into that.

Oh I dont remember ever seeing a tutorial for this. Plus still feels better to do it on my own even if its not as good lol

If there isnt a tutorial though when im done I could write one up if anyone wanted


EDIT::

OK I got it now. Thanks for pointing me in the right direction. I will neaten it up... add the npcs picture and stuff and possibly add options and so on.
Reply
#5
http://ms.shannaracorp.com/forums/viewtopic.php?t=859
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)