peekay Posted March 8, 2011 Share Posted March 8, 2011 so that hash is the petslot is that per map per playerindex? Link to comment Share on other sites More sharing options...
Helladen Posted March 9, 2011 Share Posted March 9, 2011 Yeah. Link to comment Share on other sites More sharing options...
Shasokais Posted March 9, 2011 Share Posted March 9, 2011 On the server side fault output. Points to .ispet in modGameLogicCompile Error:Method or data member not foundWhy? I did everything as written here. Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 @Shasokais:> On the server side fault output. Points to .ispet in modGameLogic> > Compile Error:> > Method or data member not found> > Why? I did everything as written here.Make sure you add "IsPet As Byte" to the bottom of MapNpcRec in modTypes. Link to comment Share on other sites More sharing options...
peekay Posted March 9, 2011 Share Posted March 9, 2011 @peekay:> so that hash is the petslot is that per map per playerindex?@Helladen:> Yeah.then why isnt it just 1? Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 @peekay:> so that hash is the petslot is that per map per playerindex?@Helladen:> Yeah.No, you replace the hashes with the NPC number you wish to use as a pet. Link to comment Share on other sites More sharing options...
Shasokais Posted March 9, 2011 Share Posted March 9, 2011 With this right, simply put in the wrong direction.But now the issue here is this error:![](http://s13.radikal.ru/i186/1103/94/a84537d8eae3.jpg) Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 @Shasokais:> With this right, simply put in the wrong direction.> But now the issue here is this error:What error? Link to comment Share on other sites More sharing options...
Shasokais Posted March 9, 2011 Share Posted March 9, 2011 I inserted the screenshot above, still do not understand because of what Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 @Lightning:> You need to replace the hashes with a number. Link to comment Share on other sites More sharing options...
Shasokais Posted March 9, 2011 Share Posted March 9, 2011 something like this? Map(PlayerMap).Npc(PetSlot) = 1 MapNpc(PlayerMap).Npc(PetSlot).Num = 1 'set its Pet Data MapNpc(PlayerMap).Npc(PetSlot).IsPet = YES MapNpc(PlayerMap).Npc(PetSlot).PetData.Name = GetPlayerName(index) & "'s " & Npc(1).Name MapNpc(PlayerMap).Npc(PetSlot).PetData.Owner = index 'If Pet doesn't exist with player, link it to the player If Player(index).Pet.SpriteNum <> 1 Then Player(index).Pet.SpriteNum = 1 Player(index).Pet.Name = GetPlayerName(index) & "'s " & Npc(1).Name End If TempPlayer(index).TempPetSlot = PetSlot Link to comment Share on other sites More sharing options...
Richy420Rich Posted March 9, 2011 Share Posted March 9, 2011 The # would represent the NPC number of your Pet. If your Pet NPC is number 211 then you'd use 211 in replace of all the #'s. Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 @n00b:> The # would represent the NPC number of your Pet. If your Pet NPC is number 211 then you'd use 211 in replace of all the #'s.Thank you very much. xD Link to comment Share on other sites More sharing options...
Magnate Posted March 9, 2011 Share Posted March 9, 2011 This looks really good :P Link to comment Share on other sites More sharing options...
Shasokais Posted March 9, 2011 Share Posted March 9, 2011 Hmm … and if I want to make a few pets.Then what to do? (This would be a rhetorical question)And you can probably last question sweat this topic exactly where to be insertedHmm ... and if I want to make a few pets.Then what to do? (This would be a rhetorical question)And you can probably last question sweat this topic exactly where to be inserted```'check if the NPC attacking us is actually our pet.'We don't want a rebellion on our hands now do we?If MapNpc(MapNum).Npc(mapNpcNum).PetData.Owner = Index Then Exit Function```I realized that it is necessary to insert CanNpcAttackPlayer, but where? Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 @Shasokais:> Hmm … and if I want to make a few pets.> Then what to do? (This would be a rhetorical question)Add a new parameter to Sub SpawnPet, called NPCNum. (You would then replace the hashes with "NPCNum".) Then make an item or spell to call SpawnPet.@Shasokais:> And you can probably last question sweat this topic exactly where to be inserted> ```> > 'check if the NPC attacking us is actually our pet.> 'We don't want a rebellion on our hands now do we?> > If MapNpc(MapNum).Npc(mapNpcNum).PetData.Owner = Index Then Exit Function> > ```> I realized that it is necessary to insert CanNpcAttackPlayer, but where?Underneath the other validity checks in CanNpcAttackPlayer.@Magnate:> This looks really good :PThanks! ;) Link to comment Share on other sites More sharing options...
Shasokais Posted March 9, 2011 Share Posted March 9, 2011 Excuse me, I'm not really in this parse (Only in some subjects get to do yourself) you can please show where to insert.```'check if the NPC attacking us is actually our pet.'We don't want a rebellion on our hands now do we?If MapNpc (MapNum). Npc (mapNpcNum). PetData.Owner = Index Then Exit Function```In:```Function CanNpcAttackPlayer(ByVal mapNpcNum As Long, ByVal index As Long) As Boolean Dim MapNum As Long Dim npcNum As Long ' Check for subscript out of range If mapNpcNum <= 0 Or mapNpcNum > MAX_MAP_NPCS Or Not IsPlaying(index) Then Exit Function End If ' Check for subscript out of range If MapNpc(GetPlayerMap(index)).Npc(mapNpcNum).Num <= 0 Then Exit Function End If MapNum = GetPlayerMap(index) npcNum = MapNpc(MapNum).Npc(mapNpcNum).Num ' Make sure the npc isn't already dead If MapNpc(MapNum).Npc(mapNpcNum).Vital(Vitals.HP) <= 0 Then Exit Function End If ' Make sure npcs dont attack more then once a second If GetTickCount < MapNpc(MapNum).Npc(mapNpcNum).AttackTimer + 1000 Then Exit Function End If ' Make sure we dont attack the player if they are switching maps If TempPlayer(index).GettingMap = YES Then Exit Function End If MapNpc(MapNum).Npc(mapNpcNum).AttackTimer = GetTickCount ' Make sure they are on the same map If IsPlaying(index) Then If npcNum > 0 Then ' Check if at same coordinates If (GetPlayerY(index) + 1 = MapNpc(MapNum).Npc(mapNpcNum).y) And (GetPlayerX(index) = MapNpc(MapNum).Npc(mapNpcNum).x) Then CanNpcAttackPlayer = True Else If (GetPlayerY(index) - 1 = MapNpc(MapNum).Npc(mapNpcNum).y) And (GetPlayerX(index) = MapNpc(MapNum).Npc(mapNpcNum).x) Then CanNpcAttackPlayer = True Else If (GetPlayerY(index) = MapNpc(MapNum).Npc(mapNpcNum).y) And (GetPlayerX(index) + 1 = MapNpc(MapNum).Npc(mapNpcNum).x) Then CanNpcAttackPlayer = True Else If (GetPlayerY(index) = MapNpc(MapNum).Npc(mapNpcNum).y) And (GetPlayerX(index) - 1 = MapNpc(MapNum).Npc(mapNpcNum).x) Then CanNpcAttackPlayer = True End If End If End If End If End If End IfEnd Function``` Link to comment Share on other sites More sharing options...
Ruins of Hell Posted March 9, 2011 Share Posted March 9, 2011 You could put it under:``` If TempPlayer(index).GettingMap = YES Then Exit Function End If```There's a lot of other places you could put it under too; but this'll do. Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 @Soul:> You could put it under:> > ```> If TempPlayer(index).GettingMap = YES Then> Exit Function> End If> > ```> There's a lot of other places you could put it under too; but this'll do.Just got in before me… thanks! ;) Link to comment Share on other sites More sharing options...
DarkKang Posted March 9, 2011 Share Posted March 9, 2011 Lightning, I try what you say (to Shasokasis request), but it don't works.Subscript out of range in:MapNpc(PlayerMap).Npc(PetSlot).PetData.Name = GetPlayerName(index) & "'s " & Npc(**NpcNum**).NameYes, I give the NPC a name, I created the parameter NpcNum.You know how works the GetVar and PutVar functions of EO?Example, I clicked on command button in CLIENT, so how I can put a var in the account of player?And, replace the NpcNum with a get var?Example:I clicked on command button 01\. So, the script put var '1' in "Pet =", in player's account. So, "Pet = 1".Then, when I click spawn pet, the script will get var of Pet =.If the var is 1, so will execute the script Case 1 (or spawn the NPC 1).Please, help me XD(Again, **sorry my bad english**, I'm brazilian!)(Sorry my bad english I'm brazilian) Link to comment Share on other sites More sharing options...
Yxxe Posted March 9, 2011 Author Share Posted March 9, 2011 You're very difficult to understand. GetVar returns as a string, so make sure you convert whatever you are getting from a string to a byte. Link to comment Share on other sites More sharing options...
Gimulex Posted March 10, 2011 Share Posted March 10, 2011 You lost me here:Place them in the options menu, or in any other menu you wish. After you have created them, they should look something like this:*Image*Okay, HOW do I place them in the options menu? Link to comment Share on other sites More sharing options...
Sunku Posted March 10, 2011 Share Posted March 10, 2011 How would i make the labels for Eclipse Origins if i already made the pet system? Link to comment Share on other sites More sharing options...
DarkKang Posted March 10, 2011 Share Posted March 10, 2011 I translated the tutorial in portuguese (to brazilians). I'm brazilian, so, it isn't Google Tradutor, okay?______________________________________>! Olá, seja bem-vindo ao meu tutorial básico de pets! Quando você terminar o tutorial, você terá criado um sistema de pet básico, onde poderá aprimorar-se ainda mais nele. Antes de iniciar, tenha certeza que você possui os requerimentos:>! * Visual Basic 6* Cliente e Servidor* Básico de programação>! **CompatÃÂvel com: Eclipse Origins 2.0.0**>! ![](http://i801.photobucket.com/albums/yy294/Adrammelech_2009/SummonedPet.png)>! **Client~Side (Projeto do cliente)**>! Primeiramente, trabalharemos com o cliente. O que iremos realizar no sistema de pet, inclui:>! * Invocar pet* Pet atacar inimigo* Pet seguir o dono* Pet andar livremente pelo mapa* Esconder/desinvocar seu pet>! De inÃÂcio, vamos trabalhar com o modGameLogic.Vá ao final dos códigos e cole estes cinco subs:>! ```Sub SpawnPet(ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong CSpawnPet SendData Buffer.ToArray() Set Buffer = Nothing>! End Sub>! Sub PetFollow(ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong CPetFollowOwner SendData Buffer.ToArray() Set Buffer = NothingEnd Sub>! Sub PetAttack(ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong CPetAttackTarget SendData Buffer.ToArray() Set Buffer = NothingEnd Sub>! Sub PetWander(ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong CPetWander SendData Buffer.ToArray() Set Buffer = NothingEnd Sub>! Sub PetDisband(ByVal Index As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong CPetDisband SendData Buffer.ToArray() Set Buffer = NothingEnd Sub```Estes são os códigos de controle do pet (já citados acima).>! Agora, abriremos o modEnumerations.>! Haverá uma lista enorme com várias variáveis iniciando com 'C'. Após:>! ```CPartyLeave```Cole o seguinte código:>! ```CSpawnPetCPetFollowOwnerCPetAttackTargetCPetWanderCPetDisband```Agora, acesse o modHandleData, e substitua todo o "Sub HandleSpawnNpc", por isto:>! ```Private Sub HandleSpawnNpc(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim n As LongDim Buffer As clsBuffer>! ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteBytes Data() n = Buffer.ReadLong>! With MapNpc(n) .Num = Buffer.ReadLong .x = Buffer.ReadLong .y = Buffer.ReadLong .Dir = Buffer.ReadLong .IsPet = Buffer.ReadByte .PetData.Name = Buffer.ReadString .PetData.Owner = Buffer.ReadLong ' Client use only .XOffset = 0 .YOffset = 0 .Moving = 0 End With>! ' Error handler Exit Suberrorhandler: HandleError "HandleSpawnNpc", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Agora, acesse o frmMain, e crie uma nova picturebox, ou qualquer coisa, e dentro dela, adicione 5 labels, como no exemplo (em inglês) abaixo:>! ![](http://i801.photobucket.com/albums/yy294/Adrammelech_2009/Commands.png)>! Estes são os comandos do pet (citados no inÃÂcio do tutorial). Clique em cima de cada um deles, e adicione o código:>! Call Pet (Invocar pet):```Call SpawnPet(MyIndex)```Attack Target (Atacar inimigo):>! ```Call PetAttack(MyIndex)```Follow Me! (Seguir o dono):>! ```Call PetFollow(MyIndex)```Wander (Deixar o pet livre pelo mapa):>! ```Call PetWander(MyIndex)```Disband Pet (Esconder/desinvocar pet):>! ```Call PetDisband(MyIndex)```Agora, adicione o código abaixo no final do "MapNpcRec", no modTypes:>! ``` 'Pet Data IsPet As Byte PetData As PetRec```Abaixo de "Dir As Byte" no PlayerRec (ainda em modTypes), adicione:>! ```Pet As PetRec```E adicione isto acima do "PlayerRec":>! ```Public Type PetRec SpriteNum As Byte Name As String * 50 Owner As LongEnd Type```______________________________________Tomorrow I'll translate the Server~Side message, I'm tired now >.< Link to comment Share on other sites More sharing options...
Yxxe Posted March 11, 2011 Author Share Posted March 11, 2011 @Gimulex:> You lost me here:> > Place them in the options menu, or in any other menu you wish. After you have created them, they should look something like this:> *Image*> > Okay, HOW do I place them in the options menu?@sunku:> How would i make the labels for Eclipse Origins if i already made the pet system?Open up the client-side source, go to the in-game form > picOptions, then set it to "Bring To Front" and add the labels. Don't forget to compile. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now