Mirage Source
Adding NPC Chat - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Adding NPC Chat (/showthread.php?tid=485)



Adding NPC Chat - halla - 17-12-2006

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


- Matt - 17-12-2006

Someone posted a tut for that. So that it works with shop keeper, friendly, etc.


- Dragoons Master - 17-12-2006

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.


- halla - 17-12-2006

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.


- Matt - 17-12-2006

http://ms.shannaracorp.com/forums/viewtopic.php?t=859