Link Posted August 11, 2013 Author Share Posted August 11, 2013 **Please be sure to read the contents of the Spoiler, VERY IMPORTANT!**>! Hi, I did say I'd re-release this tutorials sooner or later, but it's an old tutorial I made a while back and took down, but more well written. So basically here today I'll be releasing an RPG styled team system also known as a recruitment system to "_Pokemon Mystery Dungeon_" based games! This will be a basic version, though it's made for Pokemon it could be easily shaped up for any game! Per say you wanted to make a Final Fantasy type game, this system is definitely for you!>! >! The example I'll be showing today is mainly for "_Pokemon Mystery Dungeon"_ games, so most of what you'll see will indeed be related to that. This system was once widely sought after by many on the eclipse forums, I don't know if that's the case today, but I know people were willing to pay good amounts for it. Do not be confused though, as I said, this is the basic version! If you want a full detailed version or anything further I can discuss pay with you over skype or here at eclipse as I've done it before.>! >! **Contact information:**>! **Skype;** zarachi6>! >! So, let's get down to the basics, I'll answer most of your questions here and now! ->! >! **What does this even do?** It's as simple as this! In the npc editor you'll be able to set an Npc as recruit-able, for now there's a set recruit chance which is out of ten! So there's a 1/10 chance of being able to Recruit the Npc!>! >! **What does it mean to recruit the NPC?** Well, when you hit that 1/10 chance a box will appear in which the NPC will ask to join your team! You then have the option of accepting or denying this request. Upon accepting the Npc would join your team (current maximum of four) Your team will be displayed somewhere on your client, that's your choice, upon clicking on anyone of these recruited team members you then get to switch to that team member! So it's a basic sprite switching system, nothing too fancy for this basic release!>! >! In any case it has that Final Fantasy or PMD feel of having more than one playable character at a time! So now that that's out of the way let's move on to the what and not! Also Note: Basic or not, I'm the first to release this system with this much detail, and I don't mind! I do plan to release an advanced RPG team styled system, which I already have for a game I'm working on! Also, this should work with Eclipse 2.0 and possibly 3.0, it's been fully tested with Dragon Eclipse. Be sure to brace yourself, this isn't a short tut! >! **What this will include -**>! - Basic Sprite Switching Style ->! - Team of four excluding your starting character! ->! - Visual interface with switching and recruiting! ->! - Team switching at any time ->! - RPG Final Fantasy Feel! ->! >! **What this wont include -**>! - Individual stats for the recruited characters! ->! - Team storage (To have more than four team members) excluding your starting char. ->! - Less complex switching method - Now let's get down to the best parts! You'll need to start by downloading this attachment! here -> [!Recruitment!](http://www.mediafire.com/download/jwkmqosqugwgp1c/modRecruitment.bas) <- This Module needs to be added to your project! You'll need it for this to work. If you have any further questions of errors feel free to pm me about them!Now, let's get physical! We'll start with the visual side in the client! We're not at the code yet though!>! **Step 1:** You'll need to create a picture box in the "pic-screen" name it **"_picRecruitNPC_"** and inside that picture box, another picture box, name that one **"_picRecruitFace_"** and create a label with the caption being "The Pokemon would like to join your team" or whatever you want it to say.>! Now you need two labels (Yes/No) the labels will have to be indexed 1 and 2\. Name them both **"lblRecOpt"** Set **"Yes"** index to **1** and **"No"** index to **2**. Here's an example of what it should look like!>! >! ![](http://i41.tinypic.com/154dlzs.png)>! >! Step 2: Now you'll need to create your team menu or space if you'd like to call it that. This will require four picture boxes, note I'm just using my old game as an example, it no longer looks this way. Click the following link for the example - [TeamMenu](http://i46.tinypic.com/2n8csuw.png "External link") Each picture box should be named "_picRecruited_" with an index of 1 - 4!>! >! Now let's move on to coding shall we? Via Client side source! First make sure you have ctrl + f prepared, we'll be using this a lot.>! >! **- Client Side -**>! Start by going into **modTypes** now while you're there and have ctrl + f open search for **Private Type PlayerRec** , now above where it says>! **' projectiles** add the following code:>! ```>! ' RecruitmentRecruitments(1 To MAX_RECRUITMENTS) As Long ''RecruitmentPlayerNum As Long ''Recruitment>! ```Now while we're still in **modTypes** search for **Private Type NpcRec** once you're there look for **Spell(1 To MAX_NPC_SPELLS) As Long** once you've found it, directly below it add the following code:>! ```>! 'RecruitmentType As Byte 'Pokemon System>! '' Recruitment System' Link's programming notes - 'Type will determine if the Pokemon is a Pokemon and is or is not recruit-able. 'If the type is not set to Pokemon in the editor, it can't be recruitedRecruitable As Boolean 'RecruitmentType1 As ByteType2 As ByteSwitchAnim As Long 'Recruitment>! ```We're done here for now, so next we'll go to **modText** using our useful ctrl + f tool, search for Public Sub **DrawPlayerName****(ByVal Index As Long)** Now below the list of things being declared or all of those "dim" listings, add the following code:>! ```>! ' Link's notes, this does the obvious and is pretty much self explanatory. 'If you don't know, here we're basically going to show the recruit-able Pokemon's names as a special color!Dim NpcName As String 'recruitment SystemDim NpcColor As Long 'recruitment SystemDim NpcTextX As Long 'recruitment systemDim NpcTextY As Long 'recruitment system ' This will be used later, it's not needed right now.>! ```While still in **modText** we'll be searching for **Public Sub DrawNpcName(ByVal Index As Long)** now find **npcnum= MapNpc(Index).num** and below it you'll add the following code:>! ```>! 'Link's notes - This will let us know if the npc type is or isn't recruit-able. If Npc(npcnum).Type = NPC_TYPE_NORMAL Then ''recruitment system Select Case Npc(npcnum).Behaviour>! ```We'll be moving on to **modHandleData** at the bottom of **Public Sub InitMessages()** you'll need to add these!>! ```>! ' RecruitmentHandleDataSub(SNpcRecruit) = GetAddress(AddressOf HandleNpcRecruit)HandleDataSub(SShowBox) = GetAddress(AddressOf HandleShowBox)>! ```While we're still in **modHandleData** we'll be searching for **Private Sub HandlePlayerData(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)** once you've found that look for **Call SetPlayerClass(i, Buffer.ReadLong)** now below it you'll be adding this code:>! ```>! Call SetPlayerNum(i, Buffer.ReadLong) ''recruitmentFor k = 1 To MAX_RECRUITMENTS ''recruitment SetPlayerRecruitValue i, k, Buffer.ReadLongNext>! ```Now at the very bottom of **modHandleData** we'll be adding the following code:>! ```>! Private Sub HandleNpcRecruit(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBufferDim i As Long>! ' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandler>! Set Buffer = New clsBufferBuffer.WriteBytes Data()i = Buffer.ReadLongSet Buffer = NothingCall RecruitableNpcKilled(i)>! ' Error handlerExit Suberrorhandler:HandleError "HandleHotbar", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub 'Special thanks to deathbeam for helping with the snippet below!Private Sub HandleShowBox(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim npcnum As LongDim Buffer As clsBufferSet Buffer = New clsBufferBuffer.WriteBytes Data()RecruitNpcNum = Buffer.ReadLongSet Buffer = NothingfrmMain.picRecruitNPC.Visible = TruefrmMain.picRecruitFace.Picture = LoadPicture(App.Path & GFX_PATH & "\faces\" & Npc(RecruitNpcNum).Sprite & ".bmp")>! End Sub>! ```Now we're moving on to **modGlobals** here you'll search for **Public EditorShop As Long** once you've found it, below it you'll add the following code snippet:>! ```>! Public SpawnNpcRecruitable As Boolean>! ```Now at the bottom of **modGlobals** we'll add this code:>! ```>! 'RecruitmentPublic RecruitNpcNum As Long>! ```Now we'll make our way to **modGameEditors** and search for this code **IffrmEditor_Map.optNpcSpawn.Value Then** now once you've found it, look for **.Data2 = SpawnNpcDir** below that we'll add the following:>! ```>! .Data3 = SpawnNpcRecruitable>! ```While we're still in **modGameEditors** we'll now search for . **txtDamage.text = Npc(EditorIndex).Damage** and below that we'll add this following code:>! ```>! .cmbType.ListIndex = Npc(EditorIndex).Type ''Recruitment .scrlSwitchAnim.Max = MAX_ANIMATIONS ''Recruitment>! ```Hold on, we're still in **modGameEditors** but now we'll be searching for the following code **Call EditorNpc_BltSprite** you'll need to scroll down and find this bit of code:>! ```>! For i = 1 To Stats.Stat_Count - 1 .scrlStat(i).Value = Npc(EditorIndex).Stat(i) Next>! ```Once you've found that "bit of code" below it we're going to actually add some code! like so ->>! ```>! '''''''''''''''''''' ''Recruitment '''' '''''''''''''''''''' z = Npc(EditorIndex).Type1 - 1 If Npc(EditorIndex).Recruitable = True Then ''Recruitment .chkRecruitable.Value = 1 Else .chkRecruitable.Value = 0 End If .cmbPkmnType1.ListIndex = z .cmbPkmnType2.ListIndex = Npc(EditorIndex).Type2End With>! ```**Finally we can move past that and into a different module. If you need to, take a break right now, feel free to.**>! >! Ok so back from our break we'll be going into **modEnumerations** now we'll be adding the following two sets of Enums!>! ```>! 'RecruitmentSNpcRecruitSShowBox>! ```and>! ```>! 'RecruitmentCRecruitNpcToTeamCRecruitmentSwitchCRecruitResponse>! ```We're done here, so let's go to **modDatabase** now at the bottom of **modDatabase** we'll add the following code! :3>! ```>! Function GetPlayerRecruitValue(ByVal Index As Long, ByVal RecruitmentSlot As Long) As Long' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerIf Index > MAX_PLAYERS Then Exit FunctionIf RecruitmentSlot = 0 Then Exit FunctionGetPlayerRecruitValue = Player(Index).Recruitments(RecruitmentSlot)>! ' Error handlerExit Functionerrorhandler:HandleError "GetPlayerRecruitmentSlotValue", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit FunctionEnd FunctionSub SetPlayerRecruitValue(ByVal Index As Long, ByVal RecruitmentSlot As Long, ByVal npcnum As Long)' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerIf Index > MAX_PLAYERS Then Exit SubPlayer(Index).Recruitments(RecruitmentSlot) = npcnum>! ' Error handlerExit Suberrorhandler:HandleError "SetPlayerRecruitValue", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubSub SetPlayerNum(ByVal Index As Long, ByVal PlayerNum As Long) ''Recruitment' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerIf Index > MAX_PLAYERS Then Exit SubPlayer(Index).PlayerNum = PlayerNum>! ' Error handlerExit Suberrorhandler:HandleError "SetPlayerNum", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubFunction GetPlayerNum(ByVal Index As Long) As Long' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerIf Index > MAX_PLAYERS Then Exit FunctionGetPlayerNum = Player(Index).PlayerNum>! ' Error handlerExit Functionerrorhandler:HandleError "GetPlayerNum", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit FunctionEnd Function>! ```See, it's not too hard so far is it? If you're still with me let's move on!! So, we'll be going to **modConstants** now we'll be in the **' General Constants** section at the bottom of the **' General Constants** we'll add the following:>! ```>! 'Link's notes - this represents the number of team members you can have, feel free to try and change it, but be sure you know what you're doing!Public Const MAX_RECRUITMENTS As Long = 4 >! ```now at the bottom of **modConstants** itself you'll be adding this:>! ```>! ' NPC Type '' RecruitmentPublic Const NPC_TYPE_NORMAL As Byte = 0Public Const NPC_TYPE_POKEMON As Byte = 1>! ```We're done there, we'll be moving to **modTCP** next! at the bottom of **modTCP** add the following:>! ```>! 'Link's notes - Your basic packets! For anyone new, this helps us send and receive information from the server!Public Sub SendRecruit(ByVal PlayerInput As Long)Dim Buffer As clsBufferSet Buffer = New clsBuffer>! Buffer.WriteLong CRecruitResponseBuffer.WriteLong PlayerInputSendData Buffer.ToArraySet Buffer = NothingEnd Sub>! ```Now we'll be going out of the module section for a bit, we'll be heading over to **frmMain** remember those two labels we made earlier? Yes and No? We'll now be working on those! Double click either one and add the following code:>! ```>! Private Sub lblRecOpt_Click(Index As Integer)Dim i As LongDim k As LongSelect Case IndexCase 1Call sendRecruitNpc(MyIndex, RecruitNpcNum)RecruitNpcNum = 0frmMain.picRecruitNPC.Visible = FalseCase 2RecruitNpcNum = 0frmMain.picRecruitNPC.Visible = FalseEnd SelectFor i = 1 To MAX_RECRUITMENTSk = GetPlayerRecruitValue(MyIndex, i)If k > 0 ThenfrmMain.picRecruited(i).Picture = LoadPicture(App.Path & "\data files\graphics\faces\" & k & ".bmp")End IfNextEnd Sub>! ```Now back into **frmMain** and double click on the "picRecruited" boxes! and add the following code:>! ```>! Private Sub picRecruited_Click(Index As Integer)Select Case IndexCase 1 If Player(MyIndex).Recruitments(1) > 0 Then Call RecruitmentSwitch(MyIndex, (Player(MyIndex).Recruitments(1)), 1, Player(MyIndex).PlayerNum) End IfCase 2 If Player(MyIndex).Recruitments(2) > 0 Then Call RecruitmentSwitch(MyIndex, (Player(MyIndex).Recruitments(2)), 2, Player(MyIndex).PlayerNum) End IfCase 3 If Player(MyIndex).Recruitments(3) > 0 Then Call RecruitmentSwitch(MyIndex, (Player(MyIndex).Recruitments(3)), 3, Player(MyIndex).PlayerNum) End IfCase 4 If Player(MyIndex).Recruitments(4) > 0 Then Call RecruitmentSwitch(MyIndex, (Player(MyIndex).Recruitments(4)), 4, Player(MyIndex).PlayerNum) End IfEnd SelectEnd Sub>! ```**This is the part where you jump for joy, we're now done with the client side code! Feel free to take a short break?** Now it's time to work via server side source!>! >! **- Server Side -**>! We'll be going into **modTypes** and then we'll use our handy ctrl + f and search for ** Private Type NpcRec** and within that code we'll be adding this at the bottom :>! ```>! Type As Byte '' Recruitment'>! ''Recruitment SystemRecruitable As Boolean ''RecruitmentType1 As ByteType2 As ByteSwitchAnim As Long ''RecruitmentEnd Type>! ```Now search for ** Private Type MapNpcRec** and within that code at the bottom we'll be adding the following:>! ```>! 'Recruitment'Recruitable As Boolean ''Recruitment>! ```Now we'll be moving on to **modServerTCP** and search for **Function PlayerData(ByVal index As Long) As Byte()** now below the buffer writelong stuff add the following!>! ```>! 'Recruitment, zarachiFor k = 1 To MAX_RECRUITMENTS buffer.WriteLong GetPlayerRecruitmentNpcNum(index, k)Next'end 'Recruitment Save Pokemon stats'This will save all the npc's(recruited) stats so that it's unique 'This will also make every Pokemon you recruit unique with their own stats 'This is because originally your recruited Pokemon would have the same stats you started out with!>! ```Now at the bottom of **modServerTCP** add:>! ```>! Sub SendShowBox(ByVal index As Long, ByVal npcNum As Long)Dim buffer As clsBufferSet buffer = New clsBufferbuffer.WriteLong SShowBoxbuffer.WriteLong npcNumSendDataTo index, buffer.ToArray()Set buffer = NothingEnd Sub>! ```We'll now be moving on to **modPlayer** and at the bottom of **modPlayer** we'll add the following code:>! ```>! Function FindOpenRecruitmentSlot(ByVal index As Long, ByVal npcNum As Long) As LongDim i As Long' Check for subscript out of rangeIf IsPlaying(index) = False Or npcNum <= 0 Or npcNum > MAX_NPCS Then Exit FunctionEnd IfIf Npc(npcNum).Type = NPC_TYPE_POKEMON Then' If currency then check to see if they already have an instance of the item and add it to that For i = 1 To MAX_RECRUITMENTS If GetPlayerRecruitmentNpcNum(index, i) = 0 Then FindOpenRecruitmentSlot = i Exit Function End If NextEnd IfEnd Function>! Function GetPlayerRecruitmentNpcNum(ByVal index As Long, ByVal RecruitmentSlot As Long) As LongIf index > MAX_PLAYERS Then Exit FunctionIf RecruitmentSlot = 0 Then Exit FunctionGetPlayerRecruitmentNpcNum = Player(index).Recruitments(RecruitmentSlot)End FunctionFunction GetPlayerNum(ByVal index As Long) As Long ''RecruitmentIf index > MAX_PLAYERS Then Exit FunctionGetPlayerNum = Player(index).PlayerNumEnd Function>! ```Now we'll be going to **modHandleData** and we'll find **HandleDataSub(CSwitchesAndVariables) = GetAddress(AddressOf HandleSwitchesAndVariables)** now below it we'll add the following:>! ```>! 'RecruitmentHandleDataSub(CRecruitNpcToTeam) = GetAddress(AddressOf HandleRecruitNpcToTeam)HandleDataSub(CRecruitmentSwitch) = GetAddress(AddressOf HandleRecruitmentSwitch)HandleDataSub(CRecruitResponse) = GetAddress(AddressOf HandleRecruitChance)>! ```Now at the bottom of **modHandleData** add the following blot of code!>! ```>! Sub HandleRecruitNpcToTeam(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim n As LongDim i As LongDim k As LongDim FreeRecSlot As LongDim buffer As clsBufferSet buffer = New clsBufferbuffer.WriteBytes Data()n = buffer.ReadLongi = buffer.ReadIntegerSet buffer = Nothingk = FindOpenRecruitmentSlot(n, i)Player(n).Recruitments(k) = iSendPlayerData indexEnd SubSub HandleRecruitmentSwitch(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim npcNum As IntegerDim SlotNum As LongDim PlayerNum As LongDim mapNum As Long>! Dim buffer As clsBufferSet buffer = New clsBufferbuffer.WriteBytes Data()index = buffer.ReadLongnpcNum = buffer.ReadIntegerSlotNum = buffer.ReadLongPlayerNum = buffer.ReadLong>! Set buffer = Nothing>! Player(index).Sprite = Npc(npcNum).SpritePlayer(index).Recruitments(SlotNum) = PlayerNumPlayer(index).PlayerNum = npcNumSendAnimation mapNum, Npc(Player(index).PlayerNum).SwitchAnim, 0, 0, TARGET_TYPE_PLAYER, index ''Recruitment Switch AnimationSendPlayerData index>! End SubSub HandleRecruitChance(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) 'Carim's Contributions!!!!!! thanks>! Dim buffer As clsBufferDim response As LongDim SelNum As Long, i As Long>! ' Exit out if we have no need to carry on.If Player(index).CanRecruit = False Then Exit Sub>! Set buffer = New clsBufferbuffer.WriteBytes Data()>! response = buffer.ReadLong>! Set buffer = Nothing>! ' Prevent hacking/server takedown efforts.If Player(index).CurRecruit <= 0 Or Player(index).CurRecruit > MAX_NPCS Then Exit Sub>! ' Here, we check if the response is yes or no.If response = 1 Then ' Set SelNum to -1, a number that's not possible to go in the loop. SelNum = -1 ' The reasoning for this is so that if we extend the loop, we can easily ' verify that there's no space! ' Now, assign to the owest possible rec. For i = 1 To MAX_RECRUITMENTS If Player(index).Recruitments(i) = 0 Then ' We've found the lowest possible one to assign to! SelNum = i Exit For End If Next ' The case where we might have extended the loop… If SelNum = -1 Then PlayerMsg index, "You do not have enough space to recruit a new Pokemon!", BrightRed GoTo continue End If ' But from here, it's all good! Set the recruit. Player(index).Recruitments(SelNum) = Player(index).CurRecruit ' And after all of those checks, that's it!Else PlayerMsg index, "The Pokemon went away!", BrightRedEnd Ifcontinue:' After all of this, flag us able to recruit again.Player(index).CanRecruit = True' Flag this to 0, just so we can't attempt to recreate this sub, and we'll' be stopped dead in our tracks by the above prevent hack/server takedown bit.Player(index).CurRecruit = 0End Sub>! ```We'll be going to **modGameLogic** next and then we'll search for this: **Public Sub SpawnNpc(ByVal mapNpcNum As Long, ByVal mapNum As Long, Optional ByVal SetX As Long, Optional ByVal SetY As Long)**when you're there you'll look for **MapNpc(mapNum).Npc(mapNpcNum).Dir = Map(mapNum).Tile(x, y).Data2** below it you'll add the following code:>! ```>! 'Recruitable?MapNpc(mapNum).Npc(mapNpcNum).Recruitable = Map(mapNum).Tile(x, y).Data3Spawned = True>! ```Now we'll go into **modEnumerations** and add the following enum sets!>! ```>! SNpcRecruitSShowBox>! ```and>! ```>! 'RecruitmentCRecruitNpcToTeamCRecruitmentSwitchCRecruitResponse>! ```Moving on to **modDatabase** we'll now search for>! ```>! Sub AddChar(ByVal index As Long, ByVal Name As String, ByVal poontang As Byte, ByVal ClassNum As Long, ByVal Sprite As Long)>! ```Now scroll down until you see:>! ```>! Player(index).Level = 1>! ```Once you've found that, below it you shall add the following code!>! ```>! For k = 1 To MAX_RECRUITMENTSPlayer(index).Recruitments(k) = 0Next>! ```Now like we did in the client side, we'll head to **modConstants** and find **' General Constants** and in the **' General Constants** add the following>! ```>! 'RecruitmentPublic Const MAX_RECRUITMENTS As Long = 4 ' ''Recruitments, again determined number in which can be recruited>! ```Now at the bottom of **modConstants** add the following code:>! ```>! ' NPC Types ''RecruitmentPublic Const NPC_TYPE_NORMAL As Byte = 0Public Const NPC_TYPE_POKEMON As Byte = 1>! ```We'll be moving to **modCombat** now! find this line of code:>! ```>! Public Sub PlayerAttackNpc(ByVal Attacker As Long, ByVal mapNpcNum As Long, ByVal Damage As Long, Optional ByVal SpellNum As Long, Optional ByVal overTime As Boolean = False)>! ```Once you've found it, below it add the following>! ```>! 'This sets the chance of the npc being recruited to a random number or chance out of 10, thanks to Deathbeam for this contribution. 'You can chance the number to be something else instead of 10, but the higher the number the harder the chance(zarachi)Chance = rand(1, 10)If Chance = 10 Then SendShowBox Attacker, npcNum>! ```Now just scroll down a bit until you find this code:>! ```>! 'Loop through entire map and purge NPC from targetsFor i = 1 To Player_HighIndexIf IsPlaying(i) And IsConnected(i) ThenIf Player(i).Map = mapNum ThenIf TempPlayer(i).targetType = TARGET_TYPE_NPC ThenIf TempPlayer(i).target = mapNpcNum ThenTempPlayer(i).target = 0TempPlayer(i).targetType = TARGET_TYPE_NONESendTarget iEnd IfEnd IfEnd IfEnd IfNext>! ```Below this code add the following!>! ```>! ''RecruitmentIf Npc(npcNum).Type = NPC_TYPE_POKEMON ThenIf Npc(npcNum).Recruitable = True ThenIf MapNpc(mapNum).Npc(mapNpcNum).Recruitable = True ThenIf Player(Attacker).CanRecruit = True ThenSet buffer = New clsBufferbuffer.WriteLong SNpcRecruitbuffer.WriteLong npcNumSendDataTo Attacker, buffer.ToArray()Set buffer = NothingPlayer(Attacker).CurRecruit = npcNumPlayer(Attacker).CanRecruit = FalseEnd IfEnd IfEnd IfEnd If>! ```We're now moving on to the final portion of the tutorials! We're going back to the client to finish up a bit of work! So save your code!Now in the client go to frmEditor_NPC now you'll need to use this picture for reference! Here -> [!Example!](http://i48.tinypic.com/r7jej9.png) < - Important!>! >! In the frmEditor_NPC create a Tab window and name one of the tabs Recruitable make sure that's the caption.>! You will create a combobox with the Text and Name both saying cmbType, you'll create a checkbox named "chkRecruitable" with the caption being "Recruitable" or whatever do not worry about the rest it's only for test purposes now double click cmbType and have this code:>! ```>! Private Sub cmbType_Click()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerNpc(EditorIndex).Type = cmbType.ListIndexSelect Case cmbType.ListIndexCase 0chkRecruitable.Value = FalsechkRecruitable.Enabled = FalseCase 1chkRecruitable.Enabled = TrueEnd Select' Error handlerExit Suberrorhandler:HandleError "cmbType_Click", "frmEditor_NPC", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub>! ```Double click "chkRecruitable" and have this code there…>! ```>! Private Sub chkRecruitable_Click()If chkRecruitable.Value = 0 ThenNpc(EditorIndex).Recruitable = FalseElseNpc(EditorIndex).Recruitable = TrueEnd IfEnd Sub>! ```That's it, we got through this together! Please notify me of any errors, or feel free to ask me for help or something! I hope you read everything carefully before adding anything to your project! Also, in case you missed the attatchment at the top for some reason, here it is again! [!Recruitment!](http://www.mediafire.com/download/jwkmqosqugwgp1c/modRecruitment.bas) < - There you are!>! >! - Death Link to comment Share on other sites More sharing options...
PVJsquad Posted August 12, 2013 Share Posted August 12, 2013 this system for EO ? Link to comment Share on other sites More sharing options...
SkywardRiver Posted August 12, 2013 Share Posted August 12, 2013 Looks good! Just a thought, you might want to place the bigger blocks of code in spoilers. Just for organization :D Link to comment Share on other sites More sharing options...
Link Posted August 12, 2013 Author Share Posted August 12, 2013 > this system for EO ?Yes, it's for EO. Also, thanks Sky, I'll definitely consider that! Link to comment Share on other sites More sharing options...
PVJsquad Posted August 14, 2013 Share Posted August 14, 2013 I want to justify what is wrong hereYou forgot in **PlayerRec ServerSide **for add```' RecruitmentRecruitments(1 To MAX_RECRUITMENTS) As Long ''RecruitmentPlayerNum As Long ''Recruitment```and in **Client Work** you forget for add **scrlSwitchAnim**and for what this code ?```.cmbPkmnType1.ListIndex = z.cmbPkmnType2.ListIndex = Npc(EditorIndex).Type2```you not add that in **frmEditor_NPC **sorry for bad english Link to comment Share on other sites More sharing options...
lucas100vzs Posted August 15, 2013 Share Posted August 15, 2013 There are some subs missing like in client~sideSub:"SendRecruitNpc"of modClientTCP… Link to comment Share on other sites More sharing options...
PVJsquad Posted August 15, 2013 Share Posted August 15, 2013 > There are some subs missing like in client~side> > > > Sub:> > > > "SendRecruitNpc"> > > > of modClientTCP…are you sure ,you add this [http://www.mediafire.com/download/jwkmqosqugwgp1c/modRecruitment.bas](http://www.mediafire.com/download/jwkmqosqugwgp1c/modRecruitment.bas) Link to comment Share on other sites More sharing options...
Link Posted August 17, 2013 Author Share Posted August 17, 2013 Download the attachment and add it to the project or you'll be missing things. Death, nothing should be missing code wise, but if it's true, I must have missed it from the original tutorial, though it had no problems before. Link to comment Share on other sites More sharing options...
PVJsquad Posted August 17, 2013 Share Posted August 17, 2013 yes actually this system is great for adding into the EO, but your lack of detail in objects such as the addition of "cmbStyle" You just told him to add it, but I see the listindex takes the contents of ```' NPC Types ''RecruitmentPublic Const NPC_TYPE_NORMAL As Byte = 0Public Const NPC_TYPE_POKEMON As Byte = 1```a little advicebetter to use text instead of images on adding objects:ph34r: sorry for bad english Link to comment Share on other sites More sharing options...
Link Posted August 17, 2013 Author Share Posted August 17, 2013 > yes actually this system is great for adding into the EO, but your lack of detail in objects such as the addition of "cmbStyle" You just told him to add it, but I see the listindex takes the contents of > > ```> > ' NPC Types ''Recruitment> Public Const NPC_TYPE_NORMAL As Byte = 0> Public Const NPC_TYPE_POKEMON As Byte = 1> ```> > a little advice> better to use text instead of images on adding objects> > :ph34r: sorry for bad englishThis is a tutorial I made in 2012\. I just decided to paste everything again, the advanced system I have would step all over this, to say the least, lol. If anyone wanted to make additions or something, that would be cool, but I was just releasing it "again" as some type of start point and something super basic. So in a nut shell, my code was a bit more sloppy back then than it is now, haha.To me there's no point in fixing up something that doesn't have great significance for me, unless a contest comes around with a cash prize, only then would I go all out. But I guess in a way it's more or less something to build off, and for me personally something to look back on as far as a comparison to how I program now.Also, your English is perfectly understandable, lol. Link to comment Share on other sites More sharing options...
Link Posted September 4, 2013 Author Share Posted September 4, 2013 Releasing the advanced version soon, made for an original rpg - Link to comment Share on other sites More sharing options...
PVJsquad Posted September 4, 2013 Share Posted September 4, 2013 I'm not patiently waited formay I know what is in it Link to comment Share on other sites More sharing options...
hisherwin Posted September 5, 2013 Share Posted September 5, 2013 > Releasing the advanced version soon, made for an original rpg -What's in it? Link to comment Share on other sites More sharing options...
Zopto Posted September 6, 2013 Share Posted September 6, 2013 > What's in it?- Individual stats for the recruited characters! -- Team storage (To have more than four team members) excluding your starting char. -- Less complex switching method -I guess that Link to comment Share on other sites More sharing options...
hisherwin Posted September 6, 2013 Share Posted September 6, 2013 > - Individual stats for the recruited characters! -> > - Team storage (To have more than four team members) excluding your starting char. -> > - Less complex switching method -> > > > I guess thatalready got that .. but what do you mean about Less Complex Switching Method? Link to comment Share on other sites More sharing options...
Zopto Posted September 6, 2013 Share Posted September 6, 2013 > already got that .. but what do you mean about Less Complex Switching Method?idk that what is say on first post xD Link to comment Share on other sites More sharing options...
Link Posted September 6, 2013 Author Share Posted September 6, 2013 I've changed my mind, not releasing the advanced version and it includes way more than three things, lol. Link to comment Share on other sites More sharing options...
pkmcvz Posted April 12, 2014 Share Posted April 12, 2014 Help error Client Next '''''''''''''''''''' ''Recruitment '''' '''''''''''''''''''' z = Npc(EditorIndex).Type1 - 1 If Npc(EditorIndex).Recruitable = True Then ''Recruitment .chkRecruitable.Value = 1 Else .chkRecruitable.Value = 0 End If .cmbPkmnType1.ListIndex = z ' here error .cmbPkmnType2.ListIndex = Npc(EditorIndex).Type2 ' here errorEnd With Call EditorNpc_BltSprite NPC_Changed(EditorIndex) = Truehelp My Link to comment Share on other sites More sharing options...
hisherwin Posted April 12, 2014 Share Posted April 12, 2014 > Help error Client > > > > Next> ''''''''''''''''''''> ''Recruitment ''''> ''''''''''''''''''''> z = Npc(EditorIndex).Type1 - 1> If Npc(EditorIndex).Recruitable = True Then ''Recruitment> .chkRecruitable.Value = 1> Else> .chkRecruitable.Value = 0> End If> .cmbPkmnType1.ListIndex = z ' here error> .cmbPkmnType2.ListIndex = Npc(EditorIndex).Type2 ' here error> End With> > Call EditorNpc_BltSprite> NPC_Changed(EditorIndex) = True> > help MyError Description?? Link to comment Share on other sites More sharing options...
Growlith1223 Posted April 12, 2014 Share Posted April 12, 2014 last reply was about 6 months ago. Good job. Link to comment Share on other sites More sharing options...
hisherwin Posted April 12, 2014 Share Posted April 12, 2014 > last reply was about 6 months ago. Good job.well it's better than creating a new post to ask this question :Danyway.. @pkmcvz, we or i can't fix it without the error description Link to comment Share on other sites More sharing options...
pkmcvz Posted April 12, 2014 Share Posted April 12, 2014 is giving error in these lines. cmbPkmnType1.ListIndex = z 'here error. cmbPkmnType2.ListIndex = Npc (EditorIndex). Type2 'here error![](http://oi61.tinypic.com/2hhnl7k.jpg) Link to comment Share on other sites More sharing options...
hisherwin Posted April 12, 2014 Share Posted April 12, 2014 AHm.. Translation please :DEdit: i just use translator, did you make a ComboBox on the frmEditor_NPC ?? you must make 2 combobox with the name of cmbPkmnType1 and cmbPkmnType2 Link to comment Share on other sites More sharing options...
Link Posted April 23, 2014 Author Share Posted April 23, 2014 What's the error in english? 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