Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 for this to work:If Map(Y).Pet(X) > 0 Then If MapPet(Y, X).num > 0 Then Target = MapPet(Y, X).TargetDont you need to Add this:Pet(1 To 20) As Integerto Type MapRecWell Depends on the MAX_MAP_PETSPublic Const MAX_MAP_NPCS = 51Public Const MAX_MAP_PETS = 20???Also in the client you need this in GLobalS:Public MapPet(1 To MAX_MAP_PETS) As MapPetRecAND THIS IN ModTypes:Type MapPetRec num As Long Target As Long HP As Long MaxHp As Long MP As Long SP As Long Map As Long X As Byte y As Byte Dir As Byte Big As Byte ' Client use only xOffset As Integer yOffset As Integer Moving As Byte Attacking As Byte AttackTimer As LongEnd TypeAnd this in constants:Public Const MAX_MAP_PETS = 20I know you added a MAX_PETS earlier but thats for the world right? This should be Per Map Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 23, 2009 Share Posted July 23, 2009 Um, why is this in the Scripting Board? That's Visual Basic, not vbscript.EDIT: Since you guys aren't really making a pure script, I should move this to the Source Boards; I mean, I'm seeing alot of source edits in this topic. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Well it started out as pure script then it turned to the SOurce code Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 23, 2009 Share Posted July 23, 2009 @Bloodmyst:> Well it started out as pure script then it turned to the SOurce codeYea, which defeats the purpose of a "pet script" (actually, I already said a number of times, and even told you guys, it's better to source a pet system because it simply cannot be easily scripted).Either way, I'll get this topic out of the Scripting Boards. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 OK? thats why we are sourcing it lol…. I know source is better than Script and i never said this was a Pet Script i said it was a pet System... Which requires both SOurce and Script, i just dint think it would need so much source so i put it in Scripts Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 23, 2009 Share Posted July 23, 2009 Well, the scripting boards are designed for pure sadscript; the reason we even have sadscript, and the main.txt, is because not everyone can edit the source code, but everyone can edit the Main.txt@Bloodmyst:> i never said this was a Pet Script i said it was a pet System…If I may refer to the title of your post,_Pet System **script**_, or moreso:@Bloodmyst:> Hey guys im **scripting** a pet systemA System does not necessarily mean "script and code"; I made a Leveling Spells system entirely scripted, as well as a Gun System (no, not using arrows) that's entirely scripted; according to the [Dictonary](http://dictionary.reference.com/browse/System), a system is defined as "_an assemblage or combination of things or parts forming a complex or unitary whole_"; this could range from scripts and source, to multiple scripted subs working together, etc. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Well isint the source code also made up of scripts? therefore Scripting dosent necessarily reefer to Sadscripting…. Anyways as i said In the beginning this was a Pure SadScript System, but now its gotten more complicated. it dosent matter it was moved to source Code. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 23, 2009 Share Posted July 23, 2009 In one post you said it started as "pure script", then in the next post you said "i never said this was a Pet Script", which got me confused.Also, technically scripting is an interpreted language (vbscript, javascript, php, etc), while in VB, the codes are compiled (yes, the syntax to vbscript and vb is similar, and the sadscript commands are the same, but it's still compiled in the end).Either way, yea, it's in the correct board now. Hope this works out, would still be a benefit to the community. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 it should work, Everything ABout Pet movement and Spawning has been worked out by ridrik Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 No not everything have worked out, still working on it right now. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Did you take a look at this post?:http://www.touchofdeathforums.com/smf/index.php/topic,48799.msg504652.html#msg504652 Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Yes just added, still there's lots of errors when trying to start up the client, because the client doesn't know what "Pet" is. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Yeah, i think you shoudl post every script you have written so i can revise and check to see if everythign has been defined Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 This goes in database under SetPlayerName:```Sub SetPetName(ByVal Index As Long, ByVal Name As String) pet(Index).Name = NameEnd SubSub GetPetName(ByVal Index As Long, ByVal Name As String) pet(Index).Name = NameEnd Sub```This goes in the constants, under NPC constants.```' PET constantsPublic Const PET_BEHAVIOR_ATTACKONSIGHT = 0Public Const PET_BEHAVIOR_ATTACKWHENATTACKED = 1Public Const PET_BEHAVIOR_FRIENDLY = 2Public Const PET_BEHAVIOR_SHOPKEEPER = 3Public Const PET_BEHAVIOR_GUARD = 4Public Const PET_BEHAVIOR_SCRIPTED = 5Public Const PET_BEHAVIOR_RELAXED = 6```Both to client side. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Oh wow i wrote Publix instead of Public and it gave me an error lolAnyways inorder for Those subs to work you need this Right above MapPetRec in ModTypes:Type PetRec Name As String * NAME_LENGTH AttackSay As String * 100 Sprite As Long SpawnSecs As Long Behavior As Byte Range As Byte SpriteSize As Long STR As Long DEF As Long speed As Long MAGI As Long Big As Long MaxHp As Long Exp As Long SpawnTime As Long Spell As Long Element As LongEnd TypeAnd Also you need:Public Pet() As PetRecRIght underPublic Item() As ItemRecPublic Npc() As NpcRecIn ModGLobals Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Found lots of errors, fixed almost all of them. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 I dint get any errors lols Did you do what i said in previous post? Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 ANyways I need the Scripts on Spawning the Pets, YOU got them? or is someone else doing that.Woops sorry for double post.Anyways im Missing SOme Subs Like The SpawnPet in server side i thinkEDIT3:It coudl be im missing some codes Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 frmServer.tmrPet.Enabled = True - gives me an error on this, this command is to start the Public Sub Pet()EDIT: in in server, general, search for```frmServer.tmrGameAI.Enabled = True```And right under that put```frmServer.tmrPet.Enabled = True```Also add this after CheckMapNpc```Call ClearMapPets Call SetStatus("Clearing pets...")```Add this in database:```Sub ClearMapPets() Dim X As Long Dim Y As Long For Y = 1 To MAX_MAPS For X = 1 To MAX_MAP_PETS Call ClearMapPet(X, Y) Next X Next YEnd Sub``` Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Dont we need to Add that timer? I need the TImer. Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Most likely, but fix the error about the pet sub.EDIT: At very bottom, database add this :```Function GetPlayerTargetPet(ByVal index As Long) As Long GetPlayerTargetPet = Player(index).TargetPETEnd Function```Also we can make a new folder in server and add this:```Sub LoadPets() Dim FileName As String Dim I As Integer Dim f As Long Call CheckNpcs For I = 1 To MAX_PETS temp = I / MAX_PETS * 100 Call SetStatus("Loading pets... " & temp & "%") FileName = App.path & "\Pets\pet" & I & ".dat" f = FreeFile Open FileName For Binary As #f Get #f, , PET(I) Close #f Next IEnd Sub``` Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Ridrik you need to fully tell Everythign not just add this but also everythign that comes with it…. LIke for exaple @Ridrik:> Most likely, but fix the error about the pet sub.> > EDIT: At very bottom, database add this :> > ```> Function GetPlayerTargetPet(ByVal index As Long) As Long> GetPlayerTargetPet = Player(index).TargetPET> End Function> ```YOu also need "TargetPET As Long" At ModTYpes ifnot the Player(Inded).TargetPET wont work Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Okay we are kinda working together so help out, tnx. Link to comment Share on other sites More sharing options...
Dennys Posted July 23, 2009 Author Share Posted July 23, 2009 Iam Helping out…. Im telling you everythign you need inorder for the Subs your makign to work Link to comment Share on other sites More sharing options...
Ridrik Posted July 23, 2009 Share Posted July 23, 2009 Well then, let's just keep working. okay?EDIT: In modtypes, search for 'Vitals, and replace it with this:```' Vitals HP As Long MP As Long SP As Long PETHP As Long``` 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