Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 in? this is a forum post, anyone who has hands and can type is in…. Well aslong as they can pitch in ideas... Link to comment Share on other sites More sharing options...
zearth Posted July 23, 2009 Share Posted July 23, 2009 yeah that should work dennys, is it not working? Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 mmmmmmmmmmmmmmmmmmk! Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 No its not working…... When i test it with a message if i remove it it works if i put it, it dosent work... Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Alright i got PutVar workingthing was that Putvar is all about Strings. and NpcIndex was an Integer so i had to turn it into a string with CStr() Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 Dooooooooooooooooooooooublepost!!! Link to comment Share on other sites More sharing options...
Patrick Posted July 23, 2009 Share Posted July 23, 2009 Did you capitalise the "call"?I'll start by trying to make the npcvsnpc work. Wish me luck. Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Actually this might work, i'm going to get in this project even though i do not know alot in scripting, but I know enough to help. So i'll be watching this topic for any progress and helping on it's way. Link to comment Share on other sites More sharing options...
Patrick Posted July 23, 2009 Share Posted July 23, 2009 @Ridrik:> Actually this might work, i'm going to get in this project even though i do not know alot in scripting, but I know enough to help. So i'll be watching this topic for any progress and helping on it's way.And what would that help include? Link to comment Share on other sites More sharing options...
Pikachu Posted July 23, 2009 Share Posted July 23, 2009 Maybe this should be made as a script and a source edit? Like, adding Pets array to the player struct, then adding a SendPlayerPetsToMap(map, index) so you dont waste any npc slots. Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Scripting most likely, right now i'm learning some scripts, reading tutorials etc. Link to comment Share on other sites More sharing options...
Patrick Posted July 23, 2009 Share Posted July 23, 2009 Yes it is a source edit and a script.Edit:I foudn this this seems something to do with the npc's attacking code. If frmMirage.chkNpcDamage.Value = 1 Then If frmMirage.chkPlayerName.Value = 0 Then If GetTickCount < NPCDmgTime + 2000 Then Call DrawText(TexthDC, (Int(Len(NPCDmgDamage)) / 2) * 3 + NewX + sx, NewY - 22 - ii + sx, NPCDmgDamage, QBColor(BRIGHTRED)) End If Link to comment Share on other sites More sharing options...
Pikachu Posted July 23, 2009 Share Posted July 23, 2009 @üÑÂøчġġεт:> Yes it is a source edit and a script.> > Edit:> I foudn this this seems something to do with the npc's attacking code.> If frmMirage.chkNpcDamage.Value = 1 Then> If frmMirage.chkPlayerName.Value = 0 Then> If GetTickCount < NPCDmgTime + 2000 Then> Call DrawText(TexthDC, (Int(Len(NPCDmgDamage)) / 2) * 3 + NewX + sx, NewY - 22 - ii + sx, NPCDmgDamage, QBColor(BRIGHTRED))> End IfNpc processing code is server side in modGeneral -> Sub GameAI. The npc attack on sight/movement/respawn/health regen is all there Link to comment Share on other sites More sharing options...
Patrick Posted July 23, 2009 Share Posted July 23, 2009 Mod General? Ok I'll start scanning. Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Some usefull commands:Function GetNpcName(ByVal number As Long) As String - Gets the "pet's" nameFunction GetNpcBehavior(ByVal number As Long) As Long - Behavior of the "pet" - needs a new one, so that we can se it to "pet".Function GetNpcExp(ByVal number As Long) As Long - How much the exp will you get for killing exp, but if you flip it around and edit it a bit, that will show how much will pet get exp to level.Function GetNpcDefense(ByVal number As Long) As Long - defence of the "pet"Function GetNpcStrength(ByVal number As Long) As Long - strengh of the "pet"Hope i helped a bit.-Ridrik Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Indeed found all the npc's attacks, very very important. Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 ``` ' ///////////////////////////////////////////// ' // This is used for NPC walking/targetting // ' ///////////////////////////////////////////// ' Make sure theres a npc with the map If Map(Y).NPC(X) > 0 Then If MapNPC(Y, X).num > 0 Then Target = MapNPC(Y, X).Target ' Check to see if its time for the npc to walk If NPC(NPCnum).Behavior <> NPC_BEHAVIOR_SHOPKEEPER Then ' 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) Then If GetPlayerMap(Target) = Y Then DidWalk = False I = Int(Rnd * 4) ' Lets move the npc Select Case I Case 0 ' Up If MapNPC(Y, X).Y > GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_UP) Then Call NpcMove(Y, X, DIR_UP, MOVING_WALKING) DidWalk = True End If End If End If ' Down If MapNPC(Y, X).Y < GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_DOWN) Then Call NpcMove(Y, X, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If End If ' Left If MapNPC(Y, X).X > GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_LEFT) Then Call NpcMove(Y, X, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If End If ' Right If MapNPC(Y, X).X < GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_RIGHT) Then Call NpcMove(Y, X, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If End If Case 1 ' Right If MapNPC(Y, X).X < GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_RIGHT) Then Call NpcMove(Y, X, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If End If ' Left If MapNPC(Y, X).X > GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_LEFT) Then Call NpcMove(Y, X, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If End If ' Down If MapNPC(Y, X).Y < GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_DOWN) Then Call NpcMove(Y, X, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If End If ' Up If MapNPC(Y, X).Y > GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_UP) Then Call NpcMove(Y, X, DIR_UP, MOVING_WALKING) DidWalk = True End If End If End If Case 2 ' Down If MapNPC(Y, X).Y < GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_DOWN) Then Call NpcMove(Y, X, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If End If ' Up If MapNPC(Y, X).Y > GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_UP) Then Call NpcMove(Y, X, DIR_UP, MOVING_WALKING) DidWalk = True End If End If End If ' Right If MapNPC(Y, X).X < GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_RIGHT) Then Call NpcMove(Y, X, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If End If ' Left If MapNPC(Y, X).X > GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_LEFT) Then Call NpcMove(Y, X, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If End If Case 3 ' Left If MapNPC(Y, X).X > GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_LEFT) Then Call NpcMove(Y, X, DIR_LEFT, MOVING_WALKING) DidWalk = True End If End If End If ' Right If MapNPC(Y, X).X < GetPlayerX(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_RIGHT) Then Call NpcMove(Y, X, DIR_RIGHT, MOVING_WALKING) DidWalk = True End If End If End If ' Up If MapNPC(Y, X).Y > GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_UP) Then Call NpcMove(Y, X, DIR_UP, MOVING_WALKING) DidWalk = True End If End If End If ' Down If MapNPC(Y, X).Y < GetPlayerY(Target) Then If DidWalk = False Then If CanNpcMove(Y, X, DIR_DOWN) Then Call NpcMove(Y, X, DIR_DOWN, MOVING_WALKING) DidWalk = True End If End If End If End Select ' Check if we can't move and if player is behind something and if we can just switch dirs If Not DidWalk Then If MapNPC(Y, X).X - 1 = GetPlayerX(Target) Then If MapNPC(Y, X).Y = GetPlayerY(Target) Then If MapNPC(Y, X).Dir <> DIR_LEFT Then Call NpcDir(Y, X, DIR_LEFT) End If End If DidWalk = True End If If MapNPC(Y, X).X + 1 = GetPlayerX(Target) Then If MapNPC(Y, X).Y = GetPlayerY(Target) Then If MapNPC(Y, X).Dir <> DIR_RIGHT Then Call NpcDir(Y, X, DIR_RIGHT) End If End If DidWalk = True End If If MapNPC(Y, X).X = GetPlayerX(Target) Then If MapNPC(Y, X).Y - 1 = GetPlayerY(Target) Then If MapNPC(Y, X).Dir <> DIR_UP Then Call NpcDir(Y, X, DIR_UP) End If End If DidWalk = True End If If MapNPC(Y, X).X = GetPlayerX(Target) Then If MapNPC(Y, X).Y + 1 = GetPlayerY(Target) Then If MapNPC(Y, X).Dir <> DIR_DOWN Then Call NpcDir(Y, X, DIR_DOWN) End If End If DidWalk = True End If ' We could not move so player must be behind something, walk randomly. If Not DidWalk Then I = Int(Rnd * 2) If I = 1 Then I = Int(Rnd * 4) If CanNpcMove(Y, X, I) Then Call NpcMove(Y, X, I, MOVING_WALKING) End If End If End If End If Else MapNPC(Y, X).Target = 0 End If End If Else I = Int(Rnd * 4) If I = 1 Then I = Int(Rnd * 4) If CanNpcMove(Y, X, I) Then Call NpcMove(Y, X, I, MOVING_WALKING) End If End If End If End If End If End If```Found it, this is where we begin.. Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 I'm sorry, but:HOLY FUC K!!!! Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 This is very possible, i'm working on the pet movement, i'll let you know later on what i have made. Stay updated.Edit: This is what i'm working on:1) Trying to replace MAX_NPCS to MAX_PETS, works or not… Link to comment Share on other sites More sharing options...
Pikachu Posted July 23, 2009 Share Posted July 23, 2009 I quickly made this:```Type PlayerPetRec Name As String * NAME_LENGTH AttackSay As String * 100 Sprite As Long Behavior As Byte Range As Byte STR As Long DEF As Long Speed As Long Magi As Long Big As Long MAXHP As Long Exp As Long SpawnTime As Long PetHeldItem As Integer Element As Long SPRITESIZE As ByteEnd Type```Pretty sure all the data needed for the pet is there.The pet processing code would probably be something like this: (server-side in modGeneral -> Sub GameAI)```-normal npc processing code-For i = 1 To MAX_PLAYERS -check if player pet is attack on sight, if so mark closest unfriendly npc as target- -move pet towards npc, if no target set, do nothing as the pet will follow the player- -do the actual attacking- -hp/mp regen-Next i``` Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 Couldn't you simplify that script a little? Link to comment Share on other sites More sharing options...
Patrick Posted July 23, 2009 Share Posted July 23, 2009 Thanks ridrik. Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 23, 2009 Share Posted July 23, 2009 I was talking to Ridrik :P :P Link to comment Share on other sites More sharing options...
zearth Posted July 23, 2009 Share Posted July 23, 2009 @Dᴺᴬ:> I'm sorry, but:> > HOLY FUC K!!!!please resist from merely spamming the thread with 99 font. if you are going to post thats fine, but i reccomend at least using a regular font for using a font that large is merely annoying and doesnt help anythingback on subject: Nice find(s) ridrik, this is definately a good start but npc v npc is going to be the big problem and is probably going to take a few roundabout scripts Link to comment Share on other sites More sharing options...
Patrick Posted July 23, 2009 Share Posted July 23, 2009 Actually I figured something out. What we need to do if we want the npc by the player's side all the time then we just add an npcmove on the key command.eg whewn you press up the character and the player goes up. 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