Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[CS:DE] to [EO] Conversation system V1.1


RyokuHasu
 Share

Recommended Posts

  • 2 weeks later...
  • Replies 170
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...
If a player uses a convo to acquire an item with his inventory full the server crashes. This really isn't something you want happening considering it will happen relatively often and you aren't there to restart the server all the time. Can it be fixed or is it just something I did wrong?
Link to comment
Share on other sites

It can easily be fixed, just make a check for the free space int he inventory, I used one on my Taming system for when you where giving summoning scrolls.

something like…

```
                    For i = 1 To 36 'one more than your max inventory
                        If i <= 35 Then 'max inventory
                            If GetPlayerInvItemNum(Index, i) <= 1 Then
                                Call GiveInvItem(Index,ItemNum, 1)
                                Call PlayerMsg(Index, "It has been added to you inventory.", BrightGreen)
                                Exit For
                            End If
                        Else
                            Call PlayerMsg(index, "You do not have enough room in your bag.", BrightRed)
                        End If
                    Next

```
Link to comment
Share on other sites

  • 2 weeks later...
When i converted it myself i did this:
```
    If Npc(NpcNum).Behaviour = NPC_BEHAVIOUR_FRIENDLY Then
        If Npc(NpcNum).Conv > 0 Then
            InitChat Attacker, mapNum, mapNpcNum
        ElseIf LenB(Trim$(Npc(NpcNum).AttackSay)) > 0 Then
                Call PlayerMsg(Attacker, CheckGrammar(Trim$(Npc(NpcNum).Name), 1) & " says: " & Trim$(Npc(NpcNum).AttackSay), SayColor)
        End If
        Exit Function
    End If

```
Link to comment
Share on other sites

  • 4 weeks later...
It ok mate, I was being stupid and dident read the rest of the post. All I had to do was set the npc's hp to 1 to make it alive.

Now I have the task of creating a script server side that allows me to call any conversation in the conv editor

example: Call initchat (index, 1) ' 1 is the first conversation in the conversation editor!

anyone want to help?
Link to comment
Share on other sites

@Eason:

> This will change the CS:DE to EO?

No, this tutorial will 'cut' out a code from CS;DE and implement it into EO.
If you want to do [this](http://www.touchofdeathforums.com/smf/index.php/topic,64806.0.html) tutorial, you only need VB6 and EO.
Link to comment
Share on other sites

Why are you even posting about the crafting system in here? Anyways you could try to add it to cs:de I doubt u will even have to edit much or anything at all to make it work….
This tutorial u are posting in  is for the npc conversation system :)
Link to comment
Share on other sites

Also make sure you add this in modHandleData (server)

In HandlePlayerMove find this towards the bottom:
```
Call PlayerMove(index, Dir, movement)
```
Above it add:
```
' can't move if chatting
If TempPlayer(index).inChatWith > 0 Then
    ClosePlayerChat index
End If
```
This will close the chat window if you move to keep players from walking around with chat Windows open…. Make sure you added the optional sub ClosePlayerChat from the original post...
Edit: sorry double post was on my phone since web was down and didn't see
Link to comment
Share on other sites

thanks ive been looking for that justn

edit: this isn't working justn…

edit 2: There seems to be some problems with your optional code on the OP, and this you just did.

change this part to this:
```
' can't move if chatting
If TempPlayer(index).inChatWith > 0 Then
    ClosePlayerChat index
End If
```
Link to comment
Share on other sites

Oops ok to fix the error in modServerLoop find this after you added the optional stuff from the first post:
```
            ' /////////////////////////////////////////////
                ' // This is used for npcs to attack targets //
                ' /////////////////////////////////////////////
```
Above it add :
```
End If
```Thanks Whack for pointing out my mistake above I was posting it from my phone last night I didn't mean to have the space in between.
Everything works for me now just tested it =)

**Here is the whole thing in case people didnt understand:**

modServerLoop
Private Sub UpdateMapLogic
under this:
```
      ' /////////////////////////////////////////////
                ' // This is used for NPC walking/targetting //
              ' /////////////////////////////////////////////
                ' Make sure theres a npc with the map
                If Map(mapnum).NPC(x) > 0 And MapNpc(mapnum).NPC(x).Num > 0 Then
                    If MapNpc(mapnum).NPC(x).StunDuration > 0 Then
                        ' check if we can unstun them
                        If GetTickCount > MapNpc(mapnum).NPC(x).StunTimer + (MapNpc(mapnum).NPC(x).StunDuration * 1000) Then
                            MapNpc(mapnum).NPC(x).StunDuration = 0
                            MapNpc(mapnum).NPC(x).StunTimer = 0
                        End If
                    Else
```Add this:
```
' check if in conversation
                        If MapNpc(mapnum).NPC(x).c_inChatWith > 0 Then
                            ' check if we can stop having conversation
                            If Not TempPlayer(MapNpc(mapnum).NPC(x).c_inChatWith).inChatWith = npcNum Then
                                MapNpc(mapnum).NPC(x).c_inChatWith = 0
                                MapNpc(mapnum).NPC(x).Dir = MapNpc(mapnum).NPC(x).c_lastDir
                                NpcDir mapnum, x, MapNpc(mapnum).NPC(x).Dir
                            End If
                        Else
```Still in modServerLoop Find:
```
            ' /////////////////////////////////////////////
                ' // This is used for npcs to attack targets //
                ' /////////////////////////////////////////////
```
Above it add :
```
End If
```
At the bottom of modConv add this:
```
Public Sub ClosePlayerChat(ByVal index As Long)
    ' exit the chat
    TempPlayer(index).inChatWith = 0
    TempPlayer(index).curChat = 0
    ' send chat update
    sendChat index
    ' send npc dir
    With MapNpc(TempPlayer(index).c_mapNum).NPC(TempPlayer(index).c_mapNpcNum)
        If .c_inChatWith = index Then
            .c_inChatWith = 0
            .Dir = .c_lastDir
            NpcDir TempPlayer(index).c_mapNum, TempPlayer(index).c_mapNpcNum, .Dir
        End If
    End With
    ' clear last of data
    TempPlayer(index).c_mapNpcNum = 0
    TempPlayer(index).c_mapNum = 0
    Exit Sub
End Sub

```
then under "SendBank index" in modconv add:
```
TempPlayer(index).InBank = True
```then under "SendInventory index" in modconv add:
```
ClosePlayerChat index
```
Also make sure you add this in modHandleData (server)

In HandlePlayerMove find this towards the bottom:
```
Call PlayerMove(index, Dir, movement)
```
Above it Add:
```
' can't move if chatting
If TempPlayer(index).inChatWith > 0 Then
    ClosePlayerChat index
End If
```
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
ummm… i have an issue. the frm.main isnt in english its in coding. how do i put in the buttons?

example:

```
.3  lt  &3           ¨  F      h  î  00    ¨  V  @@    (  þ  (      @                               B89 Bk9 c­J kï¥ þîÆ ­µ› Fgg '), ýþý ƒèý )R‰ 9ŒÞ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

      

      

      

                                                                  

    

     

     

                                                                                                        ÿÿ‡ÿÿÿ‡ÿÿ†ÿÿ†ÿæ  æ  €  €  €  €  €  €  à  à  à  à  à  à  à  à  à  à  €  €  €  €  €  €  € ÿ€ ÿà ÿà ÿ(                                     B89 Bk9 c­J kï¥ þîÆ ­µ› Fgg '), ýþý ƒèý )R‰ 9ŒÞ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  
                 
   
                           ÿ?  ò          €  €  €  €  €          €ÿ  (  0  `                               B89 Bk9 c­J kï¥ þîÆ ­µ› Fgg '), ýþý ƒèý )R‰ 9ŒÞ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

                      

                      

                      

                                                                                                                                                                                                                  

                    

                     

                     

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÃÿÿ  ÿÿÿÃÿÿ  ÿÿà ÿÿ  ÿÿà ÿÿ  ÿó  ?ÿ  ÿó  ?ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿð  ?ÿ  ÿð  ?ÿ  ÿð  ÿ  ÿð  ÿ  ÿð  ÿ  ÿð  ÿ  ÿð  ÿ  ÿð  ÿ  ÿð  ÿ  ÿð  ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿÀ  ÿ  ÿÀ  ?ÿ  ÿÀ  ?ÿ  ÿÀ ÿÿ  ÿÀ ÿÿ  ÿð ?ÿÿ  ÿð ?ÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿ  ÿÿÿÿÿÿ  ÿÿÿÿÿÿ  (  @  €                               B89 Bk9 c­J kï¥ þîÆ ­µ› Fgg '), ýþý ƒèý )R‰ 9ŒÞ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

            

            

            

            

            

            

            

                                                                                                                                                                                                                                            

        

        

        

         

         

         

         

                                                                                                                                                                                                                                                                                                                                                                                                                          ÿÿÿÿÀ?ÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÀ?ÿÿÿÿÿÿÀ?ÿÿÿÿÀ< ÿÿÿÿÀ< ÿÿÿÿÀ< ÿÿÿÿÀ< ÿÿü<    ?ÿü<    ?ÿü<    ?ÿü<    ?ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ÿü    ?ÿü    ?ÿü    ?ÿü    ?ÿü      ?ü      ?ü      ?ü      ?ü      ü      ü      ü      ü      ü      ü      ü      ü      ü      ü      ü      À      ?À      ?À      ?À      ?À    ÿÀ    ÿÀ    ÿÀ    ÿÀ    ?ÿÀ    ?ÿÀ    ?ÿÀ    ?ÿÀ  ÿÿÿÀ  ÿÿÿÀ  ÿÿÿÀ  ÿÿÿü  ?ÿÿÿü  ?ÿÿÿü  ?ÿÿÿü  ?ÿÿÿx  {\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 Georgia;}}
\viewkind4\uc1\pard\f0\fs17
\par }

```
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...