santa-clause Posted July 16, 2013 Author Share Posted July 16, 2013 hello everyone,So i'm having problem with my item stuff resetting all the time and it started when i made 2custom items.So i found a Quickfix already for it but it works till i go to the editor then it crashes again.So i've looked at the difference between server Sub SendUpdateSpellTo and the client Private Sub HandleUpdateSpell So i made at server that ```SpellSize = LenB(Spell(spellNum))SpellSize = SpellSize + 12```But that was actually just a little test if that could fix that would be able to fix it but it only worked half :'(ModTypes Client:```Option Explicit' Public data structuresPublic Map As MapRecPublic Bank As BankRecPublic Player(1 To MAX_PLAYERS) As PlayerRecPublic TempPlayer(1 To MAX_PLAYERS) As TempPlayerRecPublic Class(1 To MAX_CLASSES) As ClassRecPublic Item(1 To MAX_ITEMS) As ItemRecPublic NPC(1 To MAX_NPCS) As NpcRecPublic MapItem(1 To MAX_MAP_ITEMS) As MapItemRecPublic MapNpc(1 To MAX_MAP_NPCS) As MapNpcRecPublic TempMapNpc(1 To MAX_MAP_NPCS) As TempMapNpcRecPublic Shop(1 To MAX_SHOPS) As ShopRecPublic Spell(1 To MAX_SPELLS) As SpellRecPublic Resource(1 To MAX_RESOURCES) As ResourceRecPublic Animation(1 To MAX_ANIMATIONS) As AnimationRecPublic Switches(1 To MAX_SWITCHES) As StringPublic Variables(1 To MAX_VARIABLES) As StringPublic MapSounds() As MapSoundRecPublic MapSoundCount As LongPublic WeatherParticle(1 To MAX_WEATHER_PARTICLES) As WeatherParticleRecPublic Autotile() As AutotileRecPublic Auction(1 To 100) As AuctionHouseRecPublic BattleMsg(1 To MAX_BATTLEMSG) As BattleMsgRec' client-side stuffPublic ActionMsg(1 To MAX_BYTE) As ActionMsgRecPublic BossMsg As BossMsgRecPublic Blood(1 To MAX_BYTE) As BloodRecPublic AnimInstance(1 To MAX_BYTE) As AnimInstanceRecPublic Party As PartyRecPublic GUIWindow() As GUIWindowRecPublic Buttons(1 To MAX_BUTTONS) As ButtonRecPublic Chat(1 To 20) As ChatRecPublic TheirTrade(1 To MAX_INV) As TheirTradeRecPublic CharData(1 To MAX_PLAYER_CHARACTERS) As CharDataRecPublic PlayerInfo As InfoRecPublic Hotbar(1 To MAX_HOTBAR) As HotbarRecPublic TradeYourOffer(1 To MAX_INV) As PlayerInvRecPublic MapResource() As MapResourceRecPublic PlayerInv(1 To MAX_INV) As PlayerInvRec ' InventoryPublic PlayerSpells(1 To MAX_PLAYER_SPELLS) As PlayerSpellRec' autotilingPublic autoInner(1 To 4) As PointRecPublic autoNW(1 To 4) As PointRecPublic autoNE(1 To 4) As PointRecPublic autoSW(1 To 4) As PointRecPublic autoSE(1 To 4) As PointRecPublic chatBubble(1 To MAX_BYTE) As ChatBubbleRecPublic ProjectileList() As ProjectileRec' optionsPublic Options As OptionsRecPublic Type RandInvRec prefix As String * NAME_LENGTH Suffix As String * NAME_LENGTH Stat(1 To Stats.Stat_Count - 1) As Long Rarity As Long Damage As Long speed As LongEnd Type'Evilbunnie's DrawnChat systemPrivate Type ChatRec Text As String Colour As LongEnd Type' Type recsPrivate Type OptionsRec Game_Name As String savePass As Byte Password As String * NAME_LENGTH Username As String * ACCOUNT_LENGTH IP As String Port As Long MenuMusic As String Theme As String Website As String Music As Byte sound As Byte Debug As Byte Windowed As ByteEnd TypePublic Type AuctionHouseRec Owner As String Item As Long Amount As Long Price As Long EndDate As Long Date As String ItemRand As RandInvRecEnd TypePublic Type PartyRec Leader As Long Member(1 To MAX_PARTY_MEMBERS) As Long MemberCount As LongEnd TypePublic Type PlayerInvRec Num As Long Value As LongEnd TypePublic Type PlayerSpellRec Spell As Long Uses As LongEnd TypePrivate Type BankRec Item(1 To MAX_BANK) As PlayerInvRec ItemRand(1 To MAX_BANK) As RandInvRecEnd TypePrivate Type SpellAnim spellnum As Long timer As Long FramePointer As LongEnd TypePrivate Type PlayerRec ' General Name As String Class As Long Sprite As Long Level As Byte Access As Byte PK As Byte IsMember As Byte DateCount As String PlayerQuest(1 To MAX_QUESTS) As PlayerQuestRec ' Vitals Vital(1 To Vitals.Vital_Count - 1) As Long MaxVital(1 To Vitals.Vital_Count - 1) As Long ' Stats Stat(1 To Stats.Stat_Count - 1) As Byte StatExp(1 To Stats.Stat_Count - 1) As Long StatTNL(1 To Stats.Stat_Count - 1) As Long ' Worn equipment Equipment(1 To Equipment.Equipment_Count - 1) As Long ' Position Map As Long X As Byte y As Byte Dir As Byte ' Random Items RandInv(1 To MAX_INV) As RandInvRec RandEq(1 To Equipment.Equipment_Count - 1) As RandInvRec EventOpen(1 To MAX_EVENTS) As ByteEnd TypePrivate Type TempPlayerRec xOffset As Integer yOffset As Integer Moving As Byte Attacking As Byte AttackTimer As Long MapGetTimer As Long Step As Byte GuildColor As Long GuildName As String GuildTag As String * 3 SlashAnim As Byte NextAnim As Long Anim As Long AnimTimer As Long StartFlash As LongEnd TypePrivate Type TileDataRec X As Long y As Long Tileset As LongEnd TypePublic Type TileRec layer(1 To MapLayer.Layer_Count - 1) As TileDataRec Autotile(1 To MapLayer.Layer_Count - 1) As Byte Type As Byte Data1 As Long Data2 As Long Data3 As Long Data4 As String DirBlock As ByteEnd TypePrivate Type MapEventRec Name As String Dir As Long X As Long y As Long GraphicType As Long GraphicX As Long GraphicY As Long GraphicX2 As Long GraphicY2 As Long GraphicNum As Long Moving As Long MovementSpeed As Long Position As Long xOffset As Long yOffset As Long Step As Long visible As Long WalkAnim As Long DirFix As Long ShowDir As Long WalkThrough As Long ShowName As LongEnd TypePrivate Type MapRec Name As String * NAME_LENGTH Music As String * MUSIC_LENGTH BGS As String * MUSIC_LENGTH Revision As Long Moral As Byte Up As Long Down As Long Left As Long Right As Long BootMap As Long BootX As Byte BootY As Byte Weather As Long WeatherIntensity As Long Fog As Long FogSpeed As Long FogOpacity As Long Red As Long Green As Long Blue As Long Alpha As Long MaxX As Byte MaxY As Byte Tile() As TileRec NPC(1 To MAX_MAP_NPCS) As Long NpcSpawnType(1 To MAX_MAP_NPCS) As Long IsMember As Byte Panorama As Byte DayNight As ByteEnd TypePrivate Type ClassRec Name As String * NAME_LENGTH Stat(1 To Stats.Stat_Count - 1) As Byte MaleSprite() As Long FemaleSprite() As Long ' For client use Vital(1 To Vitals.Vital_Count - 1) As Long Desc As StringEnd TypePrivate Type ItemRec Name As String * NAME_LENGTH Desc As String * 255 sound As String * NAME_LENGTH Pic As Long Type As Byte Data1 As Long Data2 As Long Data3 As Long ClassReq(1 To MAX_CLASSES) As Byte AccessReq As Long LevelReq As Long Price As Long Add_Stat(1 To Stats.Stat_Count - 1) As Byte Rarity As Byte speed As Long ConsumeItem As Long Code As Long QuestNum As Long BindType As Byte Stat_Req(1 To Stats.Stat_Count - 1) As Byte Animation As Long Paperdoll As Long AddHP As Long AddMP As Long AddEXP As Long EXPStat As Long CastSpell As Long instaCast As Byte IsMember As Byte a As Byte R As Byte G As Byte B As Byte PDef As Long MDef As Long RDef As Long Random As Byte ItemLevel As Byte isTwoHanded As Byte Projectile As Long Range As Byte Rotation As Integer Ammo As LongEnd TypePrivate Type MapItemRec playerName As String Num As Long Value As Long Frame As Byte X As Byte y As ByteEnd TypePrivate Type NpcRec Name As String * NAME_LENGTH AttackSay As String * 100 sound As String * NAME_LENGTH Sprite As Long SpawnSecs As Long Behaviour As Byte Range As Byte DropChance(1 To MAX_NPC_DROPS) As Double DropItem(1 To MAX_NPC_DROPS) As Byte DropItemValue(1 To MAX_NPC_DROPS) As Integer Stat(1 To Stats.Stat_Count - 1) As Byte HP As Long Animation As Long Damage As Long Level As Long PDef As Long MDef As Long RDef As Long Quest As Byte QuestNum As Long a As Byte R As Byte G As Byte B As Byte SpawnAtDay As Byte SpawnAtNight As Byte Event As Long isBoss As Byte Moral As Byte Projectile As Long ProjectileRange As Byte Rotation As IntegerEnd TypePrivate Type MapNpcRec Num As Long target As Long TargetType As Byte Vital(1 To Vitals.Vital_Count - 1) As Long Map As Long X As Byte y As Byte Dir As ByteEnd TypePrivate Type TempMapNpcRec xOffset As Long yOffset As Long Moving As Byte Attacking As Byte AttackTimer As Long Step As Byte StartFlash As Long Anim As Long AnimTimer As LongEnd TypePrivate Type TradeItemRec Item As Long ItemValue As Long CostItem As Long CostValue As LongEnd TypePrivate Type ShopRec Name As String * NAME_LENGTH BuyRate As Long TradeItem(1 To MAX_TRADES) As TradeItemRecEnd TypePrivate Type SpellRec Name As String * NAME_LENGTH Desc As String * 255 sound As String * NAME_LENGTH Type As Byte MPCost As Long LevelReq As Long AccessReq As Long ClassReq(1 To MAX_CLASSES) As Byte CastTime As Long CDTime As Long Icon As Long Map As Long X As Long y As Long Dir As Byte Vital As Long Duration As Long Interval As Long Range As Byte IsAoE As Boolean AoE As Long CastAnim As Long SpellAnim As Long StunDuration As Long IsLinear As Boolean BuffType As Byte Sprite As Long NextRank As Long NextUses As LongEnd TypePublic Type MapResourceRec X As Long y As Long ResourceState As ByteEnd TypePrivate Type ResourceRec Name As String * NAME_LENGTH SuccessMessage As String * NAME_LENGTH EmptyMessage As String * NAME_LENGTH sound As String * NAME_LENGTH ResourceType As Byte ResourceImage As Long ExhaustedImage As Long ItemReward As Long ToolRequired As Long health As Long RespawnTime As Long WalkThrough As Boolean Animation As Long Exp As Long LevelReq As LongEnd TypePrivate Type ActionMsgRec Message As String Created As Long Type As Long color As Long Scroll As Long X As Long y As Long Alpha As ByteEnd TypePrivate Type BossMsgRec Message As String Created As Long color As LongEnd TypePrivate Type BloodRec Sprite As Long timer As Long X As Long y As LongEnd TypePrivate Type AnimationRec Name As String * NAME_LENGTH sound As String * NAME_LENGTH Sprite(0 To 1) As Long Frames(0 To 1) As Long LoopCount(0 To 1) As Long looptime(0 To 1) As LongEnd TypePrivate Type AnimInstanceRec Animation As Long X As Long y As Long ' used for locking to players/npcs lockindex As Long LockType As Byte ' timing timer(0 To 1) As Long ' rendering check Used(0 To 1) As Boolean ' counting the loop LoopIndex(0 To 1) As Long frameIndex(0 To 1) As LongEnd TypePublic Type HotbarRec Slot As Long sType As ByteEnd TypePublic Type ButtonRec state As Byte X As Long y As Long width As Long height As Long visible As Boolean PicNum As LongEnd TypePublic Type GUIWindowRec X As Long y As Long width As Long height As Long visible As BooleanEnd TypePublic Type EventListRec CommandList As Long CommandNum As LongEnd TypePublic Type MapSoundRec X As Long y As Long SoundHandle As Long InUse As Boolean Channel As LongEnd TypePublic Type WeatherParticleRec Type As Long X As Long y As Long Velocity As Long InUse As LongEnd Type'Auto tiles "/Public Type PointRec X As Long y As LongEnd TypePublic Type QuarterTileRec QuarterTile(1 To 4) As PointRec RenderState As Byte srcX(1 To 4) As Long srcY(1 To 4) As LongEnd TypePublic Type AutotileRec layer(1 To MapLayer.Layer_Count - 1) As QuarterTileRecEnd TypePublic Type ChatBubbleRec Msg As String Colour As Long target As Long TargetType As Byte timer As Long active As BooleanEnd TypePrivate Type TheirTradeRec itemNum As Long ItemValue As Long Rand As RandInvRecEnd TypePublic Type CharDataRec Name As String * NAME_LENGTH Level As Long Class As Long Sex As Long Sprite As LongEnd TypePublic Type InfoRec CurrentWindow As Byte AttackDamage As Long ArcheryDamage As Long PDef As Long MDef As Long RDef As Long block As Long Crit As Long Dodge As Long Parry As LongEnd Type''''''''''''''''''''''''''''''''' ****** Battle Message ****** '''''''''''''''''''''''''''''''''Type BattleMsgRec Msg As String color As Long Created As Long dY As LongEnd TypePublic Type ProjectileRec X As Long y As Long tx As Long ty As Long RotateSpeed As Byte Rotate As Single Graphic As LongEnd Type``` Link to comment Share on other sites More sharing options...
santa-clause Posted July 16, 2013 Author Share Posted July 16, 2013 ModTypes (Server)```Option Explicit' Public data structuresPublic Map(1 To MAX_CACHED_MAPS) As MapRecPublic MapCache(1 To MAX_CACHED_MAPS) As CachePublic PlayersOnMap(1 To MAX_CACHED_MAPS) As LongPublic ResourceCache(1 To MAX_CACHED_MAPS) As ResourceCacheRecPublic player(1 To MAX_PLAYERS) As PlayerRecPublic Bank(1 To MAX_PLAYERS) As BankRecPublic TempPlayer(1 To MAX_PLAYERS) As TempPlayerRecPublic Class(1 To MAX_CLASSES) As ClassRecPublic Item(1 To MAX_ITEMS) As ItemRecPublic NPC(1 To MAX_NPCS) As NpcRecPublic MapItem(1 To MAX_CACHED_MAPS, 1 To MAX_MAP_ITEMS) As MapItemRecPublic MapNpc(1 To MAX_CACHED_MAPS) As MapDataRecPublic Shop(1 To MAX_SHOPS) As ShopRecPublic Spell(1 To MAX_SPELLS) As SpellRecPublic Resource(1 To MAX_RESOURCES) As ResourceRecPublic Animation(1 To MAX_ANIMATIONS) As AnimationRecPublic Party(1 To MAX_PARTYS) As PartyRecPublic Options As OptionsRecPublic Switches(1 To MAX_SWITCHES) As StringPublic Variables(1 To MAX_VARIABLES) As StringPublic MapBlocks(1 To MAX_CACHED_MAPS) As MapBlockRecPublic Auction(1 To 100) As AuctionHouseRecPublic AEditor As PlayerRecPublic Type RandInvRec Prefix As String * NAME_LENGTH Suffix As String * NAME_LENGTH Stat(1 To Stats.Stat_Count - 1) As Long Rarity As Long Damage As Long Speed As LongEnd TypePrivate Type OptionsRec Game_Name As String MOTD As String port As Long Website As String DayNight As ByteEnd TypePublic Type AuctionHouseRec Owner As String Item As Long Amount As Long Price As Long EndDate As Long Date As String ItemRand As RandInvRecEnd TypePublic Type PartyRec Leader As Long Member(1 To MAX_PARTY_MEMBERS) As Long MemberCount As LongEnd TypePublic Type PlayerInvRec num As Long Value As LongEnd TypePrivate Type Cache Data() As ByteEnd TypePrivate Type BankRec Item(1 To MAX_BANK) As PlayerInvRec ItemRand(1 To MAX_BANK) As RandInvRecEnd TypePublic Type HotbarRec slot As Long sType As ByteEnd TypePrivate Type CharRec ' General Name As String * ACCOUNT_LENGTH Sex As Byte Class As Long Sprite As Long Level As Byte PK As Byte IsMember As Byte DateCount As String GuildFileId As Long GuildMemberId As Long PlayerQuest(1 To MAX_QUESTS) As PlayerQuestRec ' Vitals Vital(1 To Vitals.Vital_Count - 1) As Long ' Stats Stat(1 To Stats.Stat_Count - 1) As Byte StatExp(1 To Stats.Stat_Count - 1) As Long StatTNL(1 To Stats.Stat_Count - 1) As Long ' Worn equipment Equipment(1 To Equipment.Equipment_Count - 1) As Long ' Inventory Inv(1 To MAX_INV) As PlayerInvRec Spell(1 To MAX_PLAYER_SPELLS) As Long ' Hotbar Hotbar(1 To MAX_HOTBAR) As HotbarRec ' Position Map As Long x As Byte y As Byte Dir As Byte Switches(0 To MAX_SWITCHES) As Byte Variables(0 To MAX_VARIABLES) As Long BootMap As Long BootX As Byte BootY As Byte ' Random Items RandInv(1 To MAX_INV) As RandInvRec RandEq(1 To Equipment.Equipment_Count - 1) As RandInvRec Spriteold As Long SpellUses(1 To MAX_PLAYER_SPELLS) As Long EventOpen(1 To MAX_EVENTS) As ByteEnd TypePrivate Type PlayerRec ' Account Login As String * ACCOUNT_LENGTH password As String * NAME_LENGTH ' Access Access As Byte ' Characters Char(1 To MAX_PLAYER_CHARACTERS) As CharRecEnd TypePublic Type SpellBufferRec Spell As Long Timer As Long Target As Long tType As ByteEnd TypePublic Type DoTRec Used As Boolean Spell As Long Timer As Long Caster As Long StartTime As LongEnd TypePublic Type TempPlayerRec ' Non saved local vars Buffer As clsBuffer InGame As Boolean AttackTimer As Long DataTimer As Long DataBytes As Long DataPackets As Long targetType As Byte Target As Long GettingMap As Byte SpellCD(1 To MAX_PLAYER_SPELLS) As Long InShop As Long StunTimer As Long StunDuration As Long InBank As Boolean ' trade TradeRequest As Long InTrade As Long TradeOffer(1 To MAX_INV) As PlayerInvRec AcceptTrade As Boolean ' dot/hot DoT(1 To MAX_DOTS) As DoTRec HoT(1 To MAX_DOTS) As DoTRec ' spell buffer spellBuffer As SpellBufferRec ' regen stopRegen As Boolean stopRegenTimer As Long ' party inParty As Long partyInvite As Long tmpGuildSlot As Long tmpGuildInviteSlot As Long tmpGuildInviteTimer As Long tmpGuildInviteId As Long Craft(1 To 2) As Byte CurChar As Byte Buffs(1 To MAX_BUFFS) As Long BuffTimer(1 To MAX_BUFFS) As Long BuffValue(1 To MAX_BUFFS) As Long Transformed As Boolean CurrentEvent As Long inChatWith As Long mapnum As Long mapNpcNum As Long SlotA As Long SlotB As Long inDevSuite As Byte FreeAction As BooleanEnd TypePrivate Type TileDataRec x As Long y As Long Tileset As LongEnd TypePublic Type TileRec Layer(1 To MapLayer.Layer_Count - 1) As TileDataRec Autotile(1 To MapLayer.Layer_Count - 1) As Byte Type As Byte Data1 As Long Data2 As Long Data3 As Long Data4 As String DirBlock As ByteEnd TypePrivate Type MapRec Name As String * NAME_LENGTH Music As String * MUSIC_LENGTH BGS As String * MUSIC_LENGTH Revision As Long Moral As Byte Up As Long Down As Long Left As Long Right As Long BootMap As Long BootX As Byte BootY As Byte Weather As Long WeatherIntensity As Long Fog As Long FogSpeed As Long FogOpacity As Long Red As Long Green As Long Blue As Long Alpha As Long MaxX As Byte MaxY As Byte Tile() As TileRec NPC(1 To MAX_MAP_NPCS) As Long NpcSpawnType(1 To MAX_MAP_NPCS) As Long IsMember As Byte Panorama As Byte DayNight As ByteEnd TypePrivate Type ClassRec Name As String * NAME_LENGTH Stat(1 To Stats.Stat_Count - 1) As Byte MaleSprite() As Long FemaleSprite() As Long startItemCount As Long StartItem() As Long StartValue() As Long startSpellCount As Long StartSpell() As Long Next As Byte StartMap As Long StartMapX As Long StartMapY As LongEnd TypePrivate Type ItemRec Name As String * NAME_LENGTH Desc As String * 255 Sound As String * NAME_LENGTH Pic As Long Type As Byte Data1 As Long Data2 As Long Data3 As Long ClassReq(1 To MAX_CLASSES) As Byte AccessReq As Long LevelReq As Long Price As Long Add_Stat(1 To Stats.Stat_Count - 1) As Byte Rarity As Byte Speed As Long ConsumeItem As Long Code As Long QuestNum As Long BindType As Byte Stat_Req(1 To Stats.Stat_Count - 1) As Byte Animation As Long Paperdoll As Long AddHP As Long AddMP As Long AddEXP As Long EXPStat As Long CastSpell As Long instaCast As Byte IsMember As Byte A As Byte r As Byte G As Byte b As Byte PDef As Long MDef As Long RDef As Long Random As Byte ItemLevel As Byte isTwoHanded As Byte Projectile As Long Range As Byte Rotation As Integer Ammo As LongEnd TypePrivate Type MapItemRec num As Long Value As Long x As Byte y As Byte ' ownership + despawn playerName As String playerTimer As Long canDespawn As Boolean despawnTimer As Long RandData As RandInvRecEnd TypePrivate Type NpcRec Name As String * NAME_LENGTH AttackSay As String * 100 Sound As String * NAME_LENGTH Sprite As Long SpawnSecs As Long Behaviour As Byte Range As Byte DropChance(1 To MAX_NPC_DROPS) As Double DropItem(1 To MAX_NPC_DROPS) As Byte DropItemValue(1 To MAX_NPC_DROPS) As Integer Stat(1 To Stats.Stat_Count - 1) As Byte HP As Long Animation As Long Damage As Long Level As Long PDef As Long MDef As Long RDef As Long Quest As Byte QuestNum As Long A As Byte r As Byte G As Byte b As Byte SpawnAtDay As Byte SpawnAtNight As Byte Event As Long isBoss As Byte Moral As Byte Projectile As Long ProjectileRange As Byte Rotation As IntegerEnd TypePrivate Type MapNpcRec num As Long Target As Long targetType As Byte Vital(1 To Vitals.Vital_Count - 1) As Long x As Byte y As Byte Dir As ByteEnd TypePrivate Type TempMapNpcRec SpawnWait As Long AttackTimer As Long StunDuration As Long StunTimer As Long ' regen stopRegen As Boolean stopRegenTimer As Long ' dot/hot DoT(1 To MAX_DOTS) As DoTRec HoT(1 To MAX_DOTS) As DoTRec lastDir As Byte inChatWith As LongEnd TypePrivate Type TradeItemRec Item As Long ItemValue As Long costitem As Long costvalue As LongEnd TypePrivate Type ShopRec Name As String * NAME_LENGTH BuyRate As Long TradeItem(1 To MAX_TRADES) As TradeItemRecEnd TypePrivate Type SpellRec Name As String * NAME_LENGTH Desc As String * 255 Sound As String * NAME_LENGTH Type As Byte MPCost As Long LevelReq As Long AccessReq As Long ClassReq(1 To MAX_CLASSES) As Byte CastTime As Long CDTime As Long Icon As Long Map As Long x As Long y As Long Dir As Byte Vital As Long Duration As Long Interval As Long Range As Byte IsAoE As Boolean AoE As Long CastAnim As Long SpellAnim As Long StunDuration As Long isLinear As Boolean BuffType As Byte Sprite As Long NextRank As Long NextUses As LongEnd TypePrivate Type MapDataRec NPC() As MapNpcRec TempNPC() As TempMapNpcRecEnd TypePrivate Type MapResourceRec ResourceState As Byte ResourceTimer As Long x As Long y As Long cur_health As LongEnd TypePrivate Type ResourceCacheRec Resource_Count As Long ResourceData() As MapResourceRecEnd TypePrivate Type ResourceRec Name As String * NAME_LENGTH SuccessMessage As String * NAME_LENGTH EmptyMessage As String * NAME_LENGTH Sound As String * NAME_LENGTH ResourceType As Byte ResourceImage As Long ExhaustedImage As Long ItemReward As Long ToolRequired As Long health As Long RespawnTime As Long WalkThrough As Boolean Animation As Long Exp As Long LevelReq As LongEnd TypePrivate Type AnimationRec Name As String * NAME_LENGTH Sound As String * NAME_LENGTH Sprite(0 To 1) As Long Frames(0 To 1) As Long LoopCount(0 To 1) As Long LoopTime(0 To 1) As LongEnd TypePublic Type Vector x As Long y As LongEnd TypePublic Type MapBlockRec Blocks() As LongEnd Type``` Link to comment Share on other sites More sharing options...
santa-clause Posted July 16, 2013 Author Share Posted July 16, 2013 Client codes:```Private Sub HandleUpdateSpell(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim spellnum As LongDim buffer As clsBufferDim SpellSize As LongDim SpellData() As Byte ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set buffer = New clsBuffer buffer.WriteBytes data() spellnum = buffer.ReadLong SpellSize = LenB(Spell(spellnum)) ReDim SpellData(SpellSize - 1) SpellData = buffer.ReadBytes(SpellSize) CopyMemory ByVal VarPtr(Spell(spellnum)), ByVal VarPtr(SpellData(0)), SpellSize Set buffer = Nothing ' Update the spells on the pic Set buffer = New clsBuffer buffer.WriteLong CSpells SendData buffer.ToArray() Set buffer = Nothing ' Error handler Exit Suberrorhandler: HandleError "HandleUpdateSpell", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``````Private Sub HandleSpell(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim spellnum As LongDim buffer As clsBufferDim SpellSize As LongDim SpellData() As Byte If Options.Debug = 1 Then On Error GoTo errorhandler Set buffer = New clsBuffer buffer.WriteBytes data() spellnum = buffer.ReadLong SpellSize = LenB(Spell(spellnum)) ReDim SpellData(SpellSize - 1) SpellData = buffer.ReadBytes(SpellSize) CopyMemory ByVal VarPtr(Spell(spellnum)), ByVal VarPtr(SpellData(0)), SpellSize Set buffer = Nothing Exit Suberrorhandler: HandleError "HandleSpell", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``````Private Sub HandleUpdateItem(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim n As LongDim buffer As clsBufferDim ItemSize As LongDim ItemData() As Byte ' 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 ' Update the item ItemSize = LenB(Item(n)) ReDim ItemData(ItemSize - 1) ItemData = buffer.ReadBytes(ItemSize) CopyMemory ByVal VarPtr(Item(n)), ByVal VarPtr(ItemData(0)), ItemSize Set buffer = Nothing ' changes to inventory, need to clear any drop menu sDialogue = vbNullString GUIWindow(GUI_CURRENCY).visible = False inChat = False tmpCurrencyItem = 0 CurrencyMenu = 0 ' clear ' Error handler Exit Suberrorhandler: HandleError "HandleUpdateItem", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
santa-clause Posted July 16, 2013 Author Share Posted July 16, 2013 RESERVED Link to comment Share on other sites More sharing options...
lauk Posted July 16, 2013 Share Posted July 16, 2013 What language is this? Link to comment Share on other sites More sharing options...
Wortel Angels Posted July 16, 2013 Share Posted July 16, 2013 VB6… Heres everything in vb6...Jasper ill check it later ;-) Link to comment Share on other sites More sharing options...
santa-clause Posted July 16, 2013 Author Share Posted July 16, 2013 > VB6… Heres everything in vb6...> Jasper ill check it later ;-)tnx> What language is this?english and vb6 Link to comment Share on other sites More sharing options...
santa-clause Posted July 16, 2013 Author Share Posted July 16, 2013 *BUMP*I really need some help whit this. Link to comment Share on other sites More sharing options...
Stein Posted July 17, 2013 Share Posted July 17, 2013 Is it actually saving the items? May want to look at that first. Link to comment Share on other sites More sharing options...
santa-clause Posted July 17, 2013 Author Share Posted July 17, 2013 > Is it actually saving the items? May want to look at that first.I looked for that yesterday and i already sayd i don't know it started when i added the item and i've put everything i've done in the thread ;)And i can't seem to fix it at all i've tried everything i know :( Link to comment Share on other sites More sharing options...
zomb88 Posted July 17, 2013 Share Posted July 17, 2013 Did you change the list values of the combo box? Link to comment Share on other sites More sharing options...
santa-clause Posted July 17, 2013 Author Share Posted July 17, 2013 > Did you change the list values of the combo box?Yes i've added them to the list Link to comment Share on other sites More sharing options...
rodney2008 Posted July 17, 2013 Share Posted July 17, 2013 Hi jasper :biker: Link to comment Share on other sites More sharing options...
santa-clause Posted July 17, 2013 Author Share Posted July 17, 2013 > Hi jasper :biker:LOOL Link to comment Share on other sites More sharing options...
abhi2011 Posted July 17, 2013 Share Posted July 17, 2013 I know that the Stein posted this,but actually check whether the data is being saved. You can create an application in VB6 and load the item into the item rec. Then check the values. (Use the immediate window or use form printing or print to the immediate window.) Link to comment Share on other sites More sharing options...
santa-clause Posted July 17, 2013 Author Share Posted July 17, 2013 > I know that the Stein posted this,> > but actually check whether the data is being saved. You can create an application in VB6 and load the item into the item rec. Then check the values. (Use the immediate window or use form printing or print to the immediate window.)It is being saved as far as i know cuz if i use dropbox and the server is saving the items then i see a message from dropbox item1.bat savedIf i put debug mode off it marks this line first:Private Sub HandleUpdateItem(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)In clienterror = subscript out of range```CopyMemory ByVal VarPtr(Item(n)), ByVal VarPtr(ItemData(0)), ItemSize```n=1Itemsize = 744itemdata(0) = subscript out of range```Private Sub HandleUpdateItem(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim n As LongDim buffer As clsBufferDim ItemSize As LongDim ItemData() As Byte ' 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 ' Update the item ItemSize = LenB(Item(n)) ReDim ItemData(ItemSize - 1) ItemData = buffer.ReadBytes(ItemSize) CopyMemory ByVal VarPtr(Item(n)), ByVal VarPtr(ItemData(n)), ItemSize Set buffer = Nothing ' changes to inventory, need to clear any drop menu sDialogue = vbNullString GUIWindow(GUI_CURRENCY).visible = False inChat = False tmpCurrencyItem = 0 CurrencyMenu = 0 ' clear ' Error handler Exit Suberrorhandler: HandleError "HandleUpdateItem", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
Growlith1223 Posted July 17, 2013 Share Posted July 17, 2013 Have you tried it with a new source? also make sure to do breakpoints in the vb6 ide. they help a lot when fixing errors(imo). Link to comment Share on other sites More sharing options...
santa-clause Posted July 17, 2013 Author Share Posted July 17, 2013 > Have you tried it with a new source? also make sure to do breakpoints in the vb6 ide. they help a lot when fixing errors(imo).I have tried breakpoints that's how i know there is a problem with the Spellsize because it's different but it normally has to be exactly the same for as far as i know.So i think it has something to do with types tnx to frankenStein i know that ;)I hope he also wants to help me more ;) Link to comment Share on other sites More sharing options...
santa-clause Posted July 18, 2013 Author Share Posted July 18, 2013 I just started to remake this engine with the engine i made before EA reborn and now my engine is what it was with this bug but now it works perfectly i only have a little bug with convertor i'll post that :)Bug with convertor also fixed :) 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