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

eric9

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

eric9's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ok, I understand why you would say that. You have answered my question. Basically, if you have no idea how to program at all (like me,) then trying to add multiple ones together is pointless and just going to cause head-achs.
  2. When following some of these source tutorials for VB6, I noticed some include an attached file for the Form work. Some just go step by step telling you how to make that form. My question is what if I want to add two or more tutorials together that have the form work included in attachments? Do I have to open up the Form Work in VB6 and find the changes and then add them? Or if I just copy and paste the Form work in VB6 will it notice the changes and offer to add only the changes? Is there a tutorial to teach people how to add multiple source tutorials together?
  3. lol…. I'm not giving up on this one. I'm still hoping someone can help me out on this
  4. Still need help on this one. ^Bump^
  5. I followed this guide and everything worked fine, but I never said thank you. So… Thank you very much.
  6. >! Private Sub UpdateMapLogic() Dim i As Long, x As Long, mapnum As Long, n As Long, x1 As Long, y1 As Long Dim TickCount As Long, Damage As Long, DistanceX As Long, DistanceY As Long, npcNum As Long Dim target As Long, targetType As Byte, DidWalk As Boolean, Buffer As clsBuffer, Resource_index As Long Dim TargetX As Long, TargetY As Long, target_verify As Boolean, y As Long >! For mapnum = 1 To MAX_MAPS ' items appearing to everyone For i = 1 To MAX_MAP_ITEMS If MapItem(mapnum, i).Num > 0 Then If MapItem(mapnum, i).playerName vbNullString Then ' make item public? If MapItem(mapnum, i).playerTimer < GetTickCount Then ' make it public MapItem(mapnum, i).playerName = vbNullString MapItem(mapnum, i).playerTimer = 0 ' send updates to everyone SendMapItemsToAll mapnum End If ' despawn item? If MapItem(mapnum, i).canDespawn Then If MapItem(mapnum, i).despawnTimer < GetTickCount Then ' despawn it ClearMapItem i, mapnum ' send updates to everyone SendMapItemsToAll mapnum End If End If End If End If Next ' Close the doors If TickCount > TempTile(mapnum).DoorTimer + 5000 Then For x1 = 0 To Map(mapnum).MaxX For y1 = 0 To Map(mapnum).MaxY If Map(mapnum).Tile(x1, y1).Type = TILE_TYPE_KEY And TempTile(mapnum).DoorOpen(x1, y1) = YES Then TempTile(mapnum).DoorOpen(x1, y1) = NO SendMapKeyToMap mapnum, x1, y1, 0 End If Next Next End If ' check for DoTs + hots For i = 1 To MAX_MAP_NPCS If MapNpc(mapnum).Npc(i).Num > 0 Then For x = 1 To MAX_DOTS HandleDoT_Npc mapnum, i, x HandleHoT_Npc mapnum, i, x Next End If Next >! ' Respawning Resources If ResourceCache(mapnum).Resource_Count > 0 Then For i = 0 To ResourceCache(mapnum).Resource_Count Resource_index = Map(mapnum).Tile(ResourceCache(mapnum).ResourceData(i).x, ResourceCache(mapnum).ResourceData(i).y).Data1 >! If Resource_index > 0 Then If ResourceCache(mapnum).ResourceData(i).ResourceState = 1 Or ResourceCache(mapnum).ResourceData(i).cur_health < 1 Then ' dead or fucked up If ResourceCache(mapnum).ResourceData(i).ResourceTimer + (Resource(Resource_index).RespawnTime * 1000) < GetTickCount Then ResourceCache(mapnum).ResourceData(i).ResourceTimer = GetTickCount ResourceCache(mapnum).ResourceData(i).ResourceState = 0 ' normal ' re-set health to resource root ResourceCache(mapnum).ResourceData(i).cur_health = Resource(Resource_index).health SendResourceCacheToMap mapnum, i End If End If End If Next End If >! If PlayersOnMap(mapnum) = YES Then TickCount = GetTickCount For x = 1 To MAX_MAP_NPCS npcNum = MapNpc(mapnum).Npc(x).Num >! ' ///////////////////////////////////////// ' // This is used for ATTACKING ON SIGHT // ' ///////////////////////////////////////// ' Make sure theres a npc with the map If Map(mapnum).Npc(x) > 0 And MapNpc(mapnum).Npc(x).Num > 0 Then >! ' If the npc is a attack on sight, search for a player on the map If Npc(npcNum).Behaviour = NPC_BEHAVIOUR_ATTACKONSIGHT Or Npc(npcNum).Behaviour = NPC_BEHAVIOUR_GUARD Then ' make sure it's not stunned If Not MapNpc(mapnum).Npc(x).StunDuration > 0 Then For i = 1 To Player_HighIndex If IsPlaying(i) Then If GetPlayerMap(i) = mapnum And MapNpc(mapnum).Npc(x).target = 0 And GetPlayerAccess(i) ! ' ///////////////////////////////////////////// ' // 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 target = MapNpc(mapnum).Npc(x).target targetType = MapNpc(mapnum).Npc(x).targetType ' Check to see if its time for the npc to walk If Npc(npcNum).Behaviour NPC_BEHAVIOUR_SHOPKEEPER Then If targetType = 1 Then ' player ' Check to see if we are following a player or not If target > 0 Then ' Check if the player is even playing, if so follow'm If IsPlaying(target) And GetPlayerMap(target) = mapnum Then DidWalk = False target_verify = True TargetY = GetPlayerY(target) TargetX = GetPlayerX(target) Else MapNpc(mapnum).Npc(x).targetType = 0 ' clear MapNpc(mapnum).Npc(x).target = 0 End If End If ElseIf targetType = 2 Then 'npc If target > 0 Then If MapNpc(mapnum).Npc(target).Num > 0 Then DidWalk = False target_verify = True TargetY = MapNpc(mapnum).Npc(target).y TargetX = MapNpc(mapnum).Npc(target).x Else MapNpc(mapnum).Npc(x).targetType = 0 ' clear MapNpc(mapnum).Npc(x).target = 0 End If End If End If If target_verify Then i = Int(Rnd * 5) ' Lets move the npc Select Case i Case 0 ' Up If MapNpc(mapnum).Npc(x).y > TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_UP) Then Call NpcMove(mapnum, x, DIR_UP, MOVING_WALKING) DidWalk = True End If End If ' Down If MapNpc(mapnum).Npc(x).y < TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_DOWN) Then Call NpcMove(mapnum, x, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If ' Left If MapNpc(mapnum).Npc(x).x > TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_LEFT) Then Call NpcMove(mapnum, x, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If ' Right If MapNpc(mapnum).Npc(x).x < TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_RIGHT) Then Call NpcMove(mapnum, x, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If Case 1 ' Right If MapNpc(mapnum).Npc(x).x < TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_RIGHT) Then Call NpcMove(mapnum, x, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If ' Left If MapNpc(mapnum).Npc(x).x > TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_LEFT) Then Call NpcMove(mapnum, x, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If ' Down If MapNpc(mapnum).Npc(x).y < TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_DOWN) Then Call NpcMove(mapnum, x, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If ' Up If MapNpc(mapnum).Npc(x).y > TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_UP) Then Call NpcMove(mapnum, x, DIR_UP, MOVING_WALKING) DidWalk = True End If End If Case 2 ' Down If MapNpc(mapnum).Npc(x).y < TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_DOWN) Then Call NpcMove(mapnum, x, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If ' Up If MapNpc(mapnum).Npc(x).y > TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_UP) Then Call NpcMove(mapnum, x, DIR_UP, MOVING_WALKING) DidWalk = True End If End If ' Right If MapNpc(mapnum).Npc(x).x < TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_RIGHT) Then Call NpcMove(mapnum, x, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If ' Left If MapNpc(mapnum).Npc(x).x > TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_LEFT) Then Call NpcMove(mapnum, x, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If Case 3 ' Left If MapNpc(mapnum).Npc(x).x > TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_LEFT) Then Call NpcMove(mapnum, x, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If ' Right If MapNpc(mapnum).Npc(x).x < TargetX And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_RIGHT) Then Call NpcMove(mapnum, x, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If ' Up If MapNpc(mapnum).Npc(x).y > TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_UP) Then Call NpcMove(mapnum, x, DIR_UP, MOVING_WALKING) DidWalk = True End If End If ' Down If MapNpc(mapnum).Npc(x).y < TargetY And Not DidWalk Then If CanNpcMove(mapnum, x, DIR_DOWN) Then Call NpcMove(mapnum, x, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If End Select ' Check if we can't move and if Target is behind something and if we can just switch dirs If Not DidWalk Then If MapNpc(mapnum).Npc(x).x - 1 = TargetX And MapNpc(mapnum).Npc(x).y = TargetY Then If MapNpc(mapnum).Npc(x).Dir DIR_LEFT Then Call NpcDir(mapnum, x, DIR_LEFT) End If DidWalk = True End If If MapNpc(mapnum).Npc(x).x + 1 = TargetX And MapNpc(mapnum).Npc(x).y = TargetY Then If MapNpc(mapnum).Npc(x).Dir DIR_RIGHT Then Call NpcDir(mapnum, x, DIR_RIGHT) End If DidWalk = True End If If MapNpc(mapnum).Npc(x).x = TargetX And MapNpc(mapnum).Npc(x).y - 1 = TargetY Then If MapNpc(mapnum).Npc(x).Dir DIR_UP Then Call NpcDir(mapnum, x, DIR_UP) End If DidWalk = True End If If MapNpc(mapnum).Npc(x).x = TargetX And MapNpc(mapnum).Npc(x).y + 1 = TargetY Then If MapNpc(mapnum).Npc(x).Dir DIR_DOWN Then Call NpcDir(mapnum, x, DIR_DOWN) End If DidWalk = True End If ' We could not move so Target must be behind something, walk randomly. If Not DidWalk Then i = Int(Rnd * 2) If i = 1 Then i = Int(Rnd * 4) If CanNpcMove(mapnum, x, i) Then Call NpcMove(mapnum, x, i, MOVING_WALKING) End If End If End If End If Else i = Int(Rnd * 4) If i = 1 Then i = Int(Rnd * 4) If CanNpcMove(mapnum, x, i) Then Call NpcMove(mapnum, x, i, MOVING_WALKING) End If End If End If End If End If End If >! ' ///////////////////////////////////////////// ' // This is used for npcs to attack targets // ' ///////////////////////////////////////////// ' Make sure theres a npc with the map If Map(mapnum).Npc(x) > 0 And MapNpc(mapnum).Npc(x).Num > 0 Then target = MapNpc(mapnum).Npc(x).target targetType = MapNpc(mapnum).Npc(x).targetType >! ' Check if the npc can attack the targeted player player If target > 0 Then If targetType = 1 Then ' player ' Is the target playing and on the same map? If IsPlaying(target) And GetPlayerMap(target) = mapnum Then TryNpcAttackPlayer x, target Else ' Player left map or game, set target to 0 MapNpc(mapnum).Npc(x).target = 0 MapNpc(mapnum).Npc(x).targetType = 0 ' clear End If ElseIf targetType = 2 Then ' lol no npc combat :( DATS WAT YOU THINK If Map(mapnum).Npc(x) > 0 And MapNpc(mapnum).Npc(x).Num > 0 Then If Npc(MapNpc(mapnum).Npc(x).Num).Behaviour = NPC_BEHAVIOUR_PET And Npc(MapNpc(mapnum).Npc(target).Num).Behaviour = NPC_BEHAVIOUR_PET Then If CanNpcAttackNpc(mapnum, x, MapNpc(mapnum).Npc(x).target) = True Then Call PetAttackPet(mapnum, x, MapNpc(mapnum).Npc(x).target, Npc(Map(mapnum).Npc(x)).Damage) End If ElseIf Npc(MapNpc(mapnum).Npc(x).Num).Behaviour = NPC_BEHAVIOUR_PET Then If CanNpcAttackNpc(mapnum, x, MapNpc(mapnum).Npc(x).target) = True Then Call PetAttackNpc(mapnum, x, MapNpc(mapnum).Npc(x).target, Npc(Map(mapnum).Npc(x)).Damage) End If End If End If If Map(mapnum).Npc(target) > 0 And MapNpc(mapnum).Npc(target).Num > 0 Then If Npc(MapNpc(mapnum).Npc(target).Num).Behaviour = NPC_BEHAVIOUR_PET And Npc(MapNpc(mapnum).Npc(x).Num).Behaviour = NPC_BEHAVIOUR_PET Then MapNpc(mapnum).Npc(target).target = x MapNpc(mapnum).Npc(target).targetType = TARGET_TYPE_NPC If CanNpcAttackNpc(mapnum, target, MapNpc(mapnum).Npc(target).target) = True Then Call PetAttackPet(mapnum, target, MapNpc(mapnum).Npc(target).target, Npc(Map(mapnum).Npc(target)).Damage) End If ElseIf Npc(MapNpc(mapnum).Npc(target).Num).Behaviour NPC_BEHAVIOUR_PET Then MapNpc(mapnum).Npc(target).target = x MapNpc(mapnum).Npc(target).targetType = TARGET_TYPE_NPC If CanNpcAttackNpc(mapnum, target, MapNpc(mapnum).Npc(target).target) = True Then Call NpcAttackPet(mapnum, target, MapNpc(mapnum).Npc(target).target, Npc(Map(mapnum).Npc(target)).Damage) End If End If End If End If End If Else End If ' Spell Casting For i = 1 To MAX_NPC_SPELLS If Npc(npcNum).Spell(i) > 0 Then If MapNpc(mapnum).Npc(x).SpellTimer(i) + (Spell(Npc(npcNum).Spell(i)).CastTime * 1000) < GetTickCount Then NpcSpellPlayer x, target, i End If End If Next ' //////////////////////////////////////////// ' // This is used for regenerating NPC's HP // ' //////////////////////////////////////////// ' Check to see if we want to regen some of the npc's hp If Not MapNpc(mapnum).Npc(x).stopRegen Then If MapNpc(mapnum).Npc(x).Num > 0 And TickCount > GiveNPCHPTimer + 10000 Then If MapNpc(mapnum).Npc(x).Vital(Vitals.HP) > 0 Then MapNpc(mapnum).Npc(x).Vital(Vitals.HP) = MapNpc(mapnum).Npc(x).Vital(Vitals.HP) + GetNpcVitalRegen(npcNum, Vitals.HP) ' Check if they have more then they should and if so just set it to max If MapNpc(mapnum).Npc(x).Vital(Vitals.HP) > GetNpcMaxVital(npcNum, Vitals.HP) Then MapNpc(mapnum).Npc(x).Vital(Vitals.HP) = GetNpcMaxVital(npcNum, Vitals.HP) End If End If End If End If >! ' //////////////////////////////////////////////////////// ' // This is used for checking if an NPC is dead or not // ' //////////////////////////////////////////////////////// ' Check if the npc is dead or not 'If MapNpc(y, x).Num > 0 Then ' If MapNpc(y, x).HP 0 And Npc(MapNpc(y, x).Num).DEF > 0 Then ' MapNpc(y, x).Num = 0 ' MapNpc(y, x).SpawnWait = TickCount ' End If 'End If ' ////////////////////////////////////// ' // This is used for spawning an NPC // ' ////////////////////////////////////// ' Check if we are supposed to spawn an npc or not If MapNpc(mapnum).Npc(x).Num = 0 And Map(mapnum).Npc(x) > 0 Then If TickCount > MapNpc(mapnum).Npc(x).SpawnWait + (Npc(Map(mapnum).Npc(x)).SpawnSecs * 1000) Then Call SpawnNpc(x, mapnum) End If End If >! Next >! End If >! DoEvents Next >! ' Make sure we reset the timer for npc hp regeneration If GetTickCount > GiveNPCHPTimer + 10000 Then GiveNPCHPTimer = GetTickCount End If >! ' Make sure we reset the timer for door closing If GetTickCount > KeyTimer + 15000 Then KeyTimer = GetTickCount End If >! End Sub
  7. Edit: just in case I should have said something, this error comes up after I try to run the client with the server. So when I open the server via run on VB6 on its own it is fine. Then when I try to run the client after that, it brings up that run time error 9\. The server will actually run fine on its own. Just thought I'd make that clear. npcNum=0 i=1 Another Edit: If I move the yellow arrow on the left down and highlight x, it says x=2 and mapnum=11. Thanks for helping me with this much! Next time I have troubles I'll know to do all this stuff before asking questions.
  8. Here you go, sorry tired of uploading to photobucket. If it bugs anyone much, I'll go back to uploading.
  9. Ok! Phew! Finally got it all to compile…. Bring up no error's... But now I can't get it to run correctly. I get run time error 9\. Server side looks like. >! ![](http://i30.photobucket.com/albums/c345/valiustrigger/new.jpg) Also if I don't hit ok, and try to walk around none of the NPC move on their own, atttack, or anything; however, I can talk to them.
  10. >! ![](http://i30.photobucket.com/albums/c345/valiustrigger/Temppichelp-1.jpg) Should I put a large number in place of "MAX_NPC_SPELLS" ? Edit! Hey DJ Maxus, I haven't even said thanks for sharing and replying, to fix that last problem I added As per-Ryoku Hasu in previous post (page five I think.) >! In modConstants Find: Code: [Select] >! Public Const MAX_PARTY_MEMBERS As Long = 4 >! Underneath it, add: Code: [Select] Code: [Select] >! ' NPC Spells Public Const MAX_NPC_SPELLS As Long = 5
  11. So I finished the the server side and got it to compile. But after doing the client side and trying to compile it I got this. >! ![](http://i30.photobucket.com/albums/c345/valiustrigger/Temppichelp.jpg) I'm using Starlight custom version. I think the ModificationS Nove 2.6 Pet's and Quests is messing with it. the pets part. I added show NPC levels. Took out drop items on death. I think that's all. I think this will be a long night for me….. Any help guys?
  12. Never did figure out the, GetPlayerMaxVital function. I'll be taking a closer look at it later, but did figure out the items part.
  13. Ok I see, I'm new with this. But from what you said, I figured it out. It showed me a million errors but afterwards it worked just fine.
  14. Yeah I've been looking all night =( I do have enough common sense to do that. This Forum isn't nearly as much of a mess as some other places I've been; however, I'm still having troubles finding it. I think I found the items dropped on death one ( I noticed it doesn't work originally anyways, but on a custom version I'm trying, it does,) but when I change it and save it, it doesn't seem to make a difference and the game still makes me drop my items when I die.
×
×
  • Create New...