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

Helladen

Members
  • Posts

    2272
  • Joined

  • Last visited

    Never

Everything posted by Helladen

  1. Looks really good. I'm going to wait a few days until you implement all your going to do before I add it to my source. Sure showed me up, mine was too basic. :P
  2. I thought it said replace your entire sub earlier, weird… (I had fixed this months ago sorry for wasting your time. :P)
  3. Can you show us what you edited? Some of us can't just replace the entire sub like that… :P
  4. I fixed that sorry. I use the same method for my mount system. :P (I removed it on the server forgot to remove it on the client check…) Simply redo the fix or remove the mount check to fix the issue.
  5. @Pikachu!: > Oh, that's a shame…Although, could you possibly post a video of it? So I can get the idea of how it might work...? I don't feel like making it work with the regular EO becuase I'm not sure how the CurrentMusic is set and such. You need to add a packet on server side that sends the target whenever it is changed. For example, you need to send this packet whenever it is changed and in GameLoop under tmr100 provide a check for battle music based on the npc target. It takes awhile to get it to work well, but sorry I couldn't write a tutorial for this. The code is just so different on mine in this area.
  6. I'm going to just make a check in npc editor for if they have a shield or not. Then it will compare using that.
  7. Very good. I will be using this. GetPlayerEquipment should be: ``` If GetPlayerEquipment(index, Shield) > 0 Then ```
  8. I just typed them out as references. The long part of doing all of it was figuring out the best way which seems to be using 2 sets of Titles. PlayerTitles and Titles, one holds the title # and the other holds the title data.
  9. I honestly have been reworking the code and ended up doing this: AmountOfTtiles as Byte - so it skips titles it doesn't need to send PlayerTitles(1 to MAX_TITLES) as Byte CurrentTitle as Byte Next I made a specific rec for the actual title data. Titles(1 to MAX_TITLES) as TitleRec TitleRec contains Name and Color to be drawn. Basically the CurrentTitle just tells which one the player is using, there's no way to do that any other way aside fro making it's own variable in PlayerRec. AmountOfTitles does a For Next when sending and receiving the PlayerTitles array so it lessens the work on client/server. The title data is going to be an editor on the client so when it sends all the titles to the client later it will just do… Trim$(Title(Player(MyIndex).CurrentTitle).Name) when needing to preview it.
  10. Since your going to make it a UDT you should consider getting rid of the curTitle in PlayerRec and do something like this: Titles(1 to MaxTitles) as TitlesRec in PlayerRec and then branch the UDT into name/color/etc. I think CurrentTitle is going to have to be a separate value regardless though.
  11. @Dåттêвåyо: > Public Sub ChangePet(ByVal Index As Long, Optional InvNum As Byte = 0) > > change to: > > Public Sub ChangePet(ByVal Index As Long, Optional InvNum As Long) Not really a bug, the byval optional is just saying if the value is not provided it sets it to 0 I'm sorry my game has InvNum as Byte I'll fix it. Fixes have been added to the main post, if you used the first release you can upgrade by following the instructions. Thanks for reporting the issues. :)
  12. Also I forgot to mention this does not have the requirements code, because my source has them in HandleUseItem so you will have to add those if you want them.
  13. It does nothing. It just walks behind you, such as a Pokemon game. It walks and moves as you do, it's very basic…
  14. There's not much to show. The pets are just a sprite rendered behind or beside the player with a difference of 32 pixels. They have their own packet when sending the data, mostly because all my packets are separate anyway cause of players syncing with there they don't need to. And they also are in the PlayerData packet which clears out when you log out so it disappears/reappears when logging in. This hasn't been heavily tested but I spot bugs/errors very easily so it should be very stable.
  15. This is a very basic pet system. Using items will show them and using them again will hide them. **Lightning's Pet System is better, be warned!** **Credits:** Helladen and Robin for the base code from BltPlayer. **EO V2 Beta Basic Pet System V.1.2** **V.1.0:** - Initial Release. **V.1.1:** - Fixed rendering order and added the requirements check to Case Select on Server, mine uses HandleUseItem instead of reusing the same code for each Case Select, so I added for you guys so you could restrict pets with specific requirements. Fixed InvNum being dimmed as Byte in Change Pet to Long, this was because mine uses Byte for it. **V.1.2** - Fixed a misuse of MyIndex when checking directions in GameLoop, it now uses I. Added where you can't drop the pet if your using it. **Client:** >! In modConstants find: ``` Public Const ITEM_TYPE_TELEPORT As Byte = 9 ``` Below it add: ``` Public Const ITEM_TYPE_PET As Byte = 10 ``` In modTypes inside PlayerRec add: ``` ' Pet Pet As Integer ``` In frmEditor_Item look for cmbType, click on it and look in properties for list. Click on it and click on the arrow to the right, go to the bottom of the list and type Pet. >! In frmEditor_Item find cmbType_Click and below this: ``` If (cmbType.ListIndex = ITEM_TYPE_TELEPORT) Then fraTele.Visible = True Else fraTele.Visible = False End If ``` Add: ``` If (cmbType.ListIndex = ITEM_TYPE_PET) Then fraPet.Visible = True Else fraPet.Visible = False End If ``` Copy a frame from the bottom of frmEditor_Item and paste it out of the current area. Drag the frame down to where you copied it from, make sure the visibility it set to false. Set the name for it as fraPet, set the caption for it to Pet Data. >! Add a scroll bar and label. Set the name to scrlPetSprite. Set the caption to Sprite: 1. Make sure the minimum for the scrlPetSprite is 1. Place the label above or next to the scroll bar. >! Double click scrlPetSprite and paste this into the sub: ``` If EditorIndex < 1 Or EditorIndex > MAX_ITEMS Then Exit Sub >! ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler lblPetSprite.Caption = "Sprite: " & scrlPetSprite.Value Item(EditorIndex).Data1 = scrlPetSprite.Value Exit Sub ' Error handler errorhandler: HandleError "scrlPetSprite_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear ``` In frmEditor_Item inside form_load place this into the sub: ``` frmEditor_Item.scrlPetSprite.max = NumCharacters ``` In modGameEditors inside ItemEditorInit find With Item(EditorIndex) and add: ``` If .Data1 > 0 Then If .Data1 > frmEditor_Item.scrlPetSprite.max Then frmEditor_Item.scrlPetSprite.Value = frmEditor_Item.scrlPetSprite.max Else frmEditor_Item.scrlPetSprite.Value = .Data1 End If Else frmEditor_Item.scrlPetSprite.Value = 1 End If ``` In modDirectDraw7 find Y-based render, find: ``` Call BltPlayer(I) ``` Below it add: ``` If GetPlayerDir(I) = DIR_DOWN Then Call BltPet(I) Call BltPlayer(I) Else Call BltPlayer(I) Call BltPet(I) End If ``` Add this to the bottom of modDirectDraw7: ``` Public Sub BltPet(ByVal Index As Long) Dim Anim As Byte, I As Long, X As Long, Y As Long Dim Sprite As Long, SpriteTop As Long Dim rec As DxVBLib.RECT ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler >! If Player(Index).Pet = 0 Then Exit Sub >! Sprite = Item(Player(Index).Pet).Data1 >! If Sprite < 1 Or Sprite > NumCharacters Then Exit Sub CharacterTimer(Sprite) = GetTickCount + SurfaceTimerMax >! If DDS_Character(Sprite) Is Nothing Then Call InitDDSurf("characters\" & Sprite, DDSD_Character(Sprite), DDS_Character(Sprite)) End If >! ' Reset frame If Player(Index).Step = 3 Then Anim = 0 ElseIf Player(Index).Step = 1 Then Anim = 2 End If ' If not attacking, walk normally Select Case GetPlayerDir(Index) Case DIR_UP If (Player(Index).YOffset > 8) Then Anim = Player(Index).Step Case DIR_DOWN If (Player(Index).YOffset < -8) Then Anim = Player(Index).Step Case DIR_LEFT If (Player(Index).XOffset > 8) Then Anim = Player(Index).Step Case DIR_RIGHT If (Player(Index).XOffset < -8) Then Anim = Player(Index).Step End Select >! ' Set the left Select Case GetPlayerDir(Index) Case DIR_UP SpriteTop = 3 Case DIR_RIGHT SpriteTop = 2 Case DIR_DOWN SpriteTop = 0 Case DIR_LEFT SpriteTop = 1 End Select >! With rec .Top = SpriteTop * (DDSD_Character(Sprite).lHeight / 4) .Bottom = .Top + (DDSD_Character(Sprite).lHeight / 4) .Left = Anim * (DDSD_Character(Sprite).lWidth / 4) .Right = .Left + (DDSD_Character(Sprite).lWidth / 4) End With >! ' Calculate the X If GetPlayerDir(Index) = DIR_RIGHT Then X = (GetPlayerX(Index) - 1) * PIC_X + Player(Index).XOffset - ((DDSD_Character(Sprite).lWidth / 4 - 32) / 2) ElseIf GetPlayerDir(Index) = DIR_LEFT Then X = (GetPlayerX(Index) + 1) * PIC_X + Player(Index).XOffset - ((DDSD_Character(Sprite).lWidth / 4 - 32) / 2) Else X = GetPlayerX(Index) * PIC_X + Player(Index).XOffset - ((DDSD_Character(Sprite).lWidth / 4 - 32) / 2) End If >! ' Is the player's height more than 32? If (DDSD_Character(Sprite).lHeight) > 32 Then ' Create a 32 pixel offset for larger sprites Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - ((DDSD_Character(Sprite).lHeight / 4) - 32) Else ' Proceed as normal Y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset End If ' Adjust Y based on direction If GetPlayerDir(Index) = DIR_DOWN Then Y = Y - 32 ElseIf GetPlayerDir(Index) = DIR_UP Then Y = Y + 32 End If ' Render the actual sprite Call BltSprite(Sprite, X, Y, rec) Exit Sub ' Error handler errorhandler: HandleError "BltPet", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear End Sub ``` In modEnumerations, find SPlayerStats and add this below it: ``` SPlayerPet ``` In modHandleData, find HandleDataSub(SPlayerStats) = GetAddress(AddressOf HandlePlayerStats) below it add: ``` HandleDataSub(SPlayerPet) = GetAddress(AddressOf HandlePlayerPet) ``` At the bottom of modHandleData add: ``` Private Sub HandlePlayerPet(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteBytes Data() Index = Buffer.ReadLong Player(Index).Pet = Buffer.ReadInteger Set Buffer = Nothing End Sub ``` In modHandleData in HandlePlayerData above ' Check if the player is the client player add: ``` ' Pet Player(I).Pet = Buffer.ReadInteger ``` In modClientTCP in sub SendDropItem above: ``` Set Buffer = New clsBuffer ``` Add this: ``` If GetPlayerInvItemNum(MyIndex, InvNum) = Player(MyIndex).Pet Then Call AddText("You can't drop an item that is currently in use!", BrightRed) Exit Sub End If ``` **Server:** >! In modConstants find: ``` Public Const ITEM_TYPE_TELEPORT As Byte = 9 ``` Below it add: ``` Public Const ITEM_TYPE_PET As Byte = 10 ``` In modTypes inside PlayerRec add: ``` ' Pet Pet As Integer ``` In sub UseItem place this at the very bottom before End Select: ``` Case ITEM_TYPE_PET ' stat requirements For I = 1 To Stats.Stat_Count - 1 If GetPlayerRawStat(Index, I) < Item(ItemNum).Stat_Req(I) Then PlayerMsg Index, "You do not meet the stat requirements to equip this item.", BrightRed Exit Sub End If Next ' level requirement If GetPlayerLevel(Index) < Item(ItemNum).LevelReq Then PlayerMsg Index, "You do not meet the level requirement to equip this item.", BrightRed Exit Sub End If ' class requirement If Item(ItemNum).ClassReq > 0 Then If Not GetPlayerClass(Index) = Item(ItemNum).ClassReq Then PlayerMsg Index, "You do not meet the class requirement to equip this item.", BrightRed Exit Sub End If End If ' access requirement If Not GetPlayerAccess(Index) >= Item(ItemNum).AccessReq Then PlayerMsg Index, "You do not meet the access requirement to equip this item.", BrightRed Exit Sub End If Call SendAnimation(GetPlayerMap(Index), Item(GetPlayerInvItemNum(Index, InvNum)).Animation, 0, 0, TARGET_TYPE_PLAYER, Index) Call ChangePet(Index, InvNum) ' Send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, GetPlayerInvItemNum(Index, InvNum) ``` At the bottom of modPlayer paste this: ``` Public Sub ChangePet(ByVal Index As Long, Optional InvNum As Long) If Player(Index).Pet > 0 Then Player(Index).Pet = 0 Else If Item(GetPlayerInvItemNum(Index, InvNum)).Data1 > 0 Then Player(Index).Pet = GetPlayerInvItemNum(Index, InvNum) Else Call PlayerMsg(Index, "This pet does not have a sprite, report this to a staff member!", BrightRed) Exit Sub End If Player(Index).Pet = GetPlayerInvItemNum(Index, InvNum) End If Call SendPlayerPet(Index) End Sub ``` At the bottom of modServerTCP add this to the bottom: ``` Sub SendPlayerPet(ByVal Index As Long) Dim Packet As String Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SPlayerPet Buffer.WriteLong Index ' Send pet item number to client Buffer.WriteInteger Player(Index).Pet SendDataToMap GetPlayerMap(Index), Buffer.ToArray() Set Buffer = Nothing End Sub ``` >! In modEnumerations, find SPlayerStats and add this below it: ``` SPlayerPet ``` In modServerTCP in SendLeftGame above SetBuffer = Nothing add: ``` Buffer.WriteInteger 0 ``` Still in modServerTCP find Sub PlayerData at the bottom of the sub above PlayerData = Buffer.ToArray() add: ``` ' Send pet item number to client Buffer.WriteInteger Player(Index).Pet ``` In modHandleData in sub HandleMapDropItem find: ``` ' Everything worked out fine Call PlayerMapDropItem(Index, InvNum, Amount) ``` Above it add: ``` ' Make sure there not using it If GetPlayerInvItemNum(Index, InvNum) = Player(Index).Pet Then Exit Sub ``` **V.1.0 -> V.1.1 Fixes:** **Client:** >! Change Pet(I) to: ``` If GetPlayerDir(MyIndex) = DIR_DOWN Then Call BltPet(I) Call BltPlayer(I) Else Call BltPlayer(I) Call BltPet(I) End If ``` **Server:** >! Change Public Sub ChangePet(ByVal Index As Long, Optional InvNum As Byte = 0) to: >! ``` Public Sub ChangePet(ByVal Index As Long, Optional InvNum As Long) ``` Replace: ``` Case ITEM_TYPE_PET Call SendAnimation(GetPlayerMap(Index), Item(GetPlayerInvItemNum(Index, InvNum)).Animation, 0, 0, TARGET_TYPE_PLAYER, Index) Call ChangePet(Index, InvNum) ' Send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, GetPlayerInvItemNum(Index, InvNum) ``` With: ``` Case ITEM_TYPE_PET ' stat requirements For I = 1 To Stats.Stat_Count - 1 If GetPlayerRawStat(Index, I) < Item(ItemNum).Stat_Req(I) Then PlayerMsg Index, "You do not meet the stat requirements to equip this item.", BrightRed Exit Sub End If Next ' level requirement If GetPlayerLevel(Index) < Item(ItemNum).LevelReq Then PlayerMsg Index, "You do not meet the level requirement to equip this item.", BrightRed Exit Sub End If ' class requirement If Item(ItemNum).ClassReq > 0 Then If Not GetPlayerClass(Index) = Item(ItemNum).ClassReq Then PlayerMsg Index, "You do not meet the class requirement to equip this item.", BrightRed Exit Sub End If End If ' access requirement If Not GetPlayerAccess(Index) >= Item(ItemNum).AccessReq Then PlayerMsg Index, "You do not meet the access requirement to equip this item.", BrightRed Exit Sub End If Call SendAnimation(GetPlayerMap(Index), Item(GetPlayerInvItemNum(Index, InvNum)).Animation, 0, 0, TARGET_TYPE_PLAYER, Index) Call ChangePet(Index, InvNum) ' Send the sound SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, GetPlayerInvItemNum(Index, InvNum) ``` **V.1.1 -> V.1.2** **Client:** >! In modClientTCP in sub SendDropItem above: ``` Set Buffer = New clsBuffer ``` Add this: ``` If GetPlayerInvItemNum(MyIndex, InvNum) = Player(MyIndex).Pet Then Call AddText("You can't drop an item that is currently in use!", BrightRed) Exit Sub End If ``` Find: ``` Call BltPet(I) ``` Change: ``` If GetPlayerDir(MyIndex) = DIR_DOWN Then ``` To: ``` If GetPlayerDir(I) = DIR_DOWN Then ``` **Server:** >! In modHandleData in sub HandleMapDropItem find: ``` ' Everything worked out fine Call PlayerMapDropItem(Index, InvNum, Amount) ``` Above it add: ``` ' Make sure there not using it If GetPlayerInvItemNum(Index, InvNum) = Player(Index).Pet Then Exit Sub ``` Regards, **Helladen**
  16. I put a post requirement for an activity check, if I let everyone ask me for requests I won't have time to do them all.
  17. Update. Basic Pet System released. I finished the Battle Music on my engine, but I do not think if it will be wise to release as a tutorial, mostly because it modifies the npc targets a lot. As in it sends them every time they are modified. So this request has been denied, sorry.
  18. @Sekaru: > :D. Why're you using xtremeworlds anyways? Surely eclipse is better. I used to use XtremeWorlds, the only reason I'm here is because of Origins. Eclipse was always garbage before that. :P
  19. @Sekaru: > Game Name: Avian Online. > > Tutorial: A battleground system, specifically a Capture the Flag battleground. Players will be able to queue up on some sort of tile, a red team and a blue team tile, once the player steps on a team tile he will be warped to the group's queue map, once there are 3 players on that queue map the team will be formed for that side and players will not be able to enter to anymore. Once there are 3 players in each team the game starts and no one can enter unless someone leaves. > > The objective is to run into the other team's base, pickup the flag 'item' (can be anything to be honest), run back to their own base, and drop it on the flag capture tile. It'll display "Blue Team: Flag Captures: 2/3" (just for simplicity so they don't have to keep score). The team who manages to successfully captures the flag 3 times are all rewarded with a currency item. I wrote something extensive for my XtremeWorlds game so it should be easy to implement. I want it for my game too so it's an advantage of making it better. :)
  20. @Chief: > I'm pretty sure my donation didnt help that cause… You're just a lazy bum, lol :P He could just keep the updates for himself you know? And try working in XtremeWorlds, no updates for 6-12 months on average.
  21. Basically this value is inaccurate, I've tested this and the old code added 1 to the I which it made it 1 off the actual high index. This may have the same effect with the other high indexes, I'm not sure. This also fixes the high index from not resetting, because if there are 0 NPCs on the map then it will not change it. **Client only!** Find: ``` ' Get the npc high Index For I = MAX_MAP_NPCS To 1 Step -1 If MapNpc(I).Num > 0 Then Npc_HighIndex = I + 1 Exit For End If Next ``` Replace it with: ``` ' Get the npc high Index For I = MAX_MAP_NPCS To 1 Step -1 If MapNpc(I).Num > 0 Then Npc_HighIndex = I Exit For End If Next ``` Above this add: ``` Npc_HighIndex = 0 ``` Below it erase this: ``` ' Make sure we're not overflowing If Npc_HighIndex > MAX_MAP_NPCS Then Npc_HighIndex = MAX_MAP_NPCS ```
  22. HammerR your denied you need to get more posts. (50 is the minimum requirement and don't spam to get them please). @Pikachu!: > Game Name: Currently Unnamed. It's in good progress though. > Tutorial required, and How I'd like it: When you get close to an enemy, fade in to a battle music. When you beat them, or walk away, fade back into whatever was playing before. If not that, then maybe Eyecatches? > > **EDIT: Sorry, didn't see that you required a work in progress thread. Ignore this, please.** That seems like a good idea. I might consider doing it anyway. @NightmareX91: > Thanks a bunch. But remember. If it is too complex for you to do then just do day/night c: I will still be very greatful for the tutorial :D I'm making it very basic since the work you put into your application was minimal. (So don't expect it to be more than displaying the pet, being able to set the sprite, and the requirements would work like any other item).
  23. Missed this cause I modified my post: (Be more descriptive on how you would want it and show me your work in progress. :P). But pets would be easier to do than a good day and night system. You could use Eclipse Stable's, but it is very laggy and I'm not an expert at Direct Draw.
  24. Pets is kind of a huge feature, but I'll see about doing it. Would be the biggest thing I've attempted to do in Visual Basic 6 anyway. Be more descriptive on how you would want it and show me your work in progress. :P
×
×
  • Create New...