Guest Posted March 29, 2011 Share Posted March 29, 2011 Resources level requirement V1.0.2NOW! tested on EO 2.0 And it WorksResult if tutorial complete>! ![](http://img5.imageshack.us/img5/5104/resultd.png)What are you going to do?Client thingsAdd things to the modEditor_Resource.frm formAdd things to the modEditor_Resource.frm sourceAdd things to modTypes.basAdd things to modGameEditors.basServer thingsAdd things to modTypes.basAdd things to modPlayer.basServer things1\. modTypes.bas>! 1\. Open modTypes.bas2\. Search for "Private Type ResourceRec" , without the ".3\. Make a clean rule under "ToolRequired As Long", so it will look like:```Private Type ResourceRec Name As String * NAME_LENGTH SuccessMessage As String * NAME_LENGTH EmptyMessage As String * NAME_LENGTH ResourceType As Byte ResourceImage As Byte ExhaustedImage As Byte ItemReward As Long ToolRequired As Long <<<<<============= Clean rule health As Byte RespawnTime As Long Walkthrough As Boolean Animation As LongEnd Type>! ```4\. Paste this in the clean rule:``` Stat_Req(1 To Stats.Stat_Count - 1) As Byte>! ```2\. modPlayer.bas>! 1\. Open modPlayer.bas2\. Search for "Sub CheckResource", Without the "3\. Add this at the top of this sub, under "Dim Damage As Long".```Dim il as long>! ```4\. Make a clean rule under "If Resource_num > 0 Then"5\. Paste this in the clean rule:``` ' Check if Stat_Req are the same as Stats For il = 1 To Stats.Stat_Count - 1 If GetPlayerStat(index, il) < Resource(Resource_index).Stat_Req(il) Then PlayerMsg index, "Fail: You have not the stat requirement(s)!", BrightRed ' Change here the text and color Exit Sub End If Next>! ```Client things3\. modTypes.bas>! 1\. Open modTypes.bas2\. Search for "Private Type ResourceRec" , without the ".3\. Make a clean rule under "ToolRequired As Long", so it will look like:```Private Type ResourceRec Name As String * NAME_LENGTH SuccessMessage As String * NAME_LENGTH EmptyMessage As String * NAME_LENGTH ResourceType As Byte ResourceImage As Byte ExhaustedImage As Byte ItemReward As Long ToolRequired As Long<<<<<<<============ Clean rule health As Byte RespawnTime As Long Walkthrough As Boolean Animation As LongEnd Type>! ```4\. Paste this in the clean rule:``` Stat_Req(1 To Stats.Stat_Count - 1) As Byte>! ```4\. modGameEditors.bas>! 1\. Open modGameEditors.bas2\. Search for "Public Sub ResourceEditorInit()" , without the ".3\. Add this at the top of this sub, under "Public Sub ResourceEditorInit()":```Dim il As Long```4\. Make a clean rule under```frmEditor_Resource.scrlTool.Value = Resource(EditorIndex).ToolRequired```so it will look like```Public Sub ResourceEditorInit() Dim il As Long>! If frmEditor_Resource.Visible = False Then Exit Sub EditorIndex = frmEditor_Resource.lstIndex.ListIndex + 1 frmEditor_Resource.scrlExhaustedPic.Max = NumResources frmEditor_Resource.scrlNormalPic.Max = NumResources frmEditor_Resource.scrlAnimation.Max = MAX_ANIMATIONS frmEditor_Resource.txtName.text = Trim$(Resource(EditorIndex).Name) frmEditor_Resource.txtMessage.text = Trim$(Resource(EditorIndex).SuccessMessage) frmEditor_Resource.txtMessage2.text = Trim$(Resource(EditorIndex).EmptyMessage) frmEditor_Resource.cmbType.ListIndex = Resource(EditorIndex).ResourceType frmEditor_Resource.scrlNormalPic.Value = Resource(EditorIndex).ResourceImage frmEditor_Resource.scrlExhaustedPic.Value = Resource(EditorIndex).ExhaustedImage frmEditor_Resource.scrlReward.Value = Resource(EditorIndex).ItemReward frmEditor_Resource.scrlTool.Value = Resource(EditorIndex).ToolRequired<<<<<<<<<<<<========== Clean rule frmEditor_Resource.scrlHealth.Value = Resource(EditorIndex).Health frmEditor_Resource.scrlRespawn.Value = Resource(EditorIndex).RespawnTime frmEditor_Resource.scrlAnimation.Value = Resource(EditorIndex).Animation Call ResourceEditorBltSprite Resource_Changed(EditorIndex) = TrueEnd Sub```5\. Paste this in the clean rule:``` For il = 1 To Stats.stat_count - 1 frmEditor_Resource.scrlStatReq(il).Value = Resource(EditorIndex).Stat_Req(il) Next>! ```5\. frmEditor_Resource.frm>! 1\. Open the form of frmEditor_Item.frm2\. Copy lblStatReq(1), lblStatReq(2), lblStatReq(3..4..5..6), scrlStatReq(1), scrlStatReq(2), scrlStatReq(3..4..5..6) Just like:![](http://img837.imageshack.us/img837/6223/copyuj.png)3\. Open the form of frmEditor_Resource.frm4\. Make a place to paste the copied items.5\. Paste the copied items on the place you made for it.6\. Open the source of modEditor_Resource.frm7\. Go to the bottom of the source, just under "End Sub" and paste:```Private Sub scrlStatReq_Change(Index As Integer) Dim text As String Select Case Index Case 1 ' str text = "Str: " Case 2 ' end text = "End: " Case 3 ' vit text = "Vit: " Case 4 ' int text = "Int: " Case 5 ' will text = "Will: " Case 6 ' spr text = "Spr: " End Select lblStatReq(Index).Caption = text & scrlStatReq(Index).Value Resource(EditorIndex).Stat_Req(Index) = scrlStatReq(Index).ValueEnd Sub>! ```Final things6\. Finishing…>! Yes! This is the last part, you need to finish it… You need to finish your Resources.. I mean something else...Before you go to start the server and client, you will have to backup your resources…If you don't have any resources made earlier, then delete the resource files.Let's start with the following:If you want to backup…>! Go to your "Server" folder, open "Data", Copy "resources" folder, and past it somewhere you can remember. >! If you want to delete…>! Go to your "Server" folder, open "Data", Open "resources" folder, delete everything inside. Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2011 Share Posted March 29, 2011 Resources level requirement V2.0.2You need to have the previous version V1.0.2 installed to get this workThis update will just make it possible to let every resource have its own error message given when stats are lower the the required stats.What are you going to go?Client thingsAdd things to the frmEditor_Resource.frm formAdd things to the frmEditor_Resource.frm sourceAdd things to modTypes.basAdd things to modGameEditors.basAdd things to modDatabase.basServer thingsAdd things to modTypes.basAdd things to modDatabase.basAdd things to modPlayer.basClient things1\. modTypes.bas>! 1\. Open modTypes.bas2\. Search for "Private Type ResourceRec" , without the ".3\. Make a clean rule between "EmptyMessage As String * NAME_LENGTH" and "Sound As String * NAME_LENGTH", and add this in that rule:```Msg As String * 100>! ```4\. Now a clean rule between "ResourceType As Byte" and "ResourceImage As Long", and add the following:``` MsgClr As Byte>! ```2\. modDatabase.bas>! 1\. Open modDatabase.bas2\. Search for "Sub ClearResource(ByVal Index As Long)", Without the "3\. Add this under "Resource(Index).EmptyMessage = vbNullString".```Resource(Index).Msg = vbNullString>! ```3\. modGameEditors.bas>! 1\. Open modGameEditors.bas2\. Search for "Public Sub ResourceEditorInit()"3\. Make a clean rule between:```.txtMessage2.text = Trim$(Resource(EditorIndex).EmptyMessage)''''''''''''Çlean rule nr1''''''''''.cmbType.ListIndex = Resource(EditorIndex).ResourceType''''''''''''Clean rule nr2''''''''''.scrlNormalPic.Value = Resource(EditorIndex).ResourceImage'>! ```4\. Now add this in the clean rules nr1 and nr2```.txtMessage2.text = Trim$(Resource(EditorIndex).EmptyMessage).Msg.text = Trim$(Resource(EditorIndex).Msg) ''''''''Clean rule nr1''''''''.cmbType.ListIndex = Resource(EditorIndex).ResourceType.MsgClr = Resource(EditorIndex).MsgClr ''''''''Clean rule nr2''''''''.scrlNormalPic.Value = Resource(EditorIndex).ResourceImage>! ```4\. frmEditor_Resource.frm form>! Add somewhere a TextBox called Msg Here you should type the message will be viewed if stat < stat_reqAdd somewhere a TextBox called MsgClr Here you should choose a number from 0 to 15 as colourAdd somewhere a ComboBox called cmbClr1 This is just so you can see what colour each number have, for msgClr 5\. frmEditor_Resource.frm source>! 1\. Just add this at the bottom of the sorce, under the last"End Sub":```Private Sub Msg_Change() If Options.Debug = 1 Then On Error GoTo errorhandler Resource(EditorIndex).Msg = Trim$(Msg.text) ' Error handler Exit Suberrorhandler: HandleError "Msg_Change", "frmEditor_Resource", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub>! Private Sub MsgClr_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' Boynaar 8 Resource(EditorIndex).MsgClr = MsgClr.text ' Error handler Exit Suberrorhandler: HandleError "MsgClr_Change", "frmEditor_Resource", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub>! ```2\. Search for "Private Sub Form_Load()"3\. Make a clean rule under "If Options.Debug = 1 Then On Error GoTo errorhandler", and add:``` cmbClr1.AddItem "0 Black" ' Boynaar 6 cmbClr1.AddItem "1 Blue" cmbClr1.AddItem "2 Green" cmbClr1.AddItem "3 Cyan" cmbClr1.AddItem "4 Red" cmbClr1.AddItem "5 Magenta" cmbClr1.AddItem "6 Brown" cmbClr1.AddItem "7 Grey" cmbClr1.AddItem "8 DarkGrey" cmbClr1.AddItem "9 BrightBlue" cmbClr1.AddItem "10 BrightGreen" cmbClr1.AddItem "11 BrightCyan" cmbClr1.AddItem "12 BrightRed" cmbClr1.AddItem "13 Pink" cmbClr1.AddItem "14 Yellow" cmbClr1.AddItem "15 White">! ```Server Things6\. modTypes.bas>! 1\. Open modTypes.bas2\. Search for "Private Type ResourceRec" , without the ".3\. Make a clean rule under "EmptyMessage As String * NAME_LENGTH", Then add:```Msg As String * 100>! ```4\. Make a clean rule under "ResourceType As Byte", and add:``` MsgClr As Byte>! ```7\. modDatabase.bas>! 1\. Open modDatabase.bas2\. Search for "Sub ClearResource(ByVal index As Long)" , without the ".3\. Add this under "Resource(index).EmptyMessage = vbNullString":```Resource(index).Msg = vbNullString```8\. modPlayer.bas>! 1\. Open modPlayer.bas2\. Search for "Sub CheckResource(ByVal index As Long, ByVal x As Long, ByVal y As Long)"3\. Add at the top of this sub, just where the dim blabla as long are:```Dim il As long```4\. Add under the "If Resource_num > 0 Then" the next:``` For il = 1 To Stats.Stat_Count - 1 If GetPlayerStat(index, il) < Resource(Resource_index).Stat_Req(il) Then PlayerMsg index, Resource(Resource_index).Msg, Resource(Resource_index).MsgClr ' Change here the text and color Exit Sub End If Next>! ```Final things9\. Finishing…>! Yes! This is the last part, you need to finish it… You need to finish your Resources.. I mean something else...Before you go to start the server and client, you will have to backup your resources…If you don't have any resources made earlier, then delete the resource files.Let's start with the following:If you want to backup…>! Go to your "Server" folder, open "Data", Copy "resources" folder, and past it somewhere you can remember. >! If you want to delete…>! Go to your "Server" folder, open "Data", Open "resources" folder, delete everything inside. Link to comment Share on other sites More sharing options...
Conscientia Posted March 29, 2011 Share Posted March 29, 2011 Far from simple tutorial. Get rid of all the formatting crap and annoying spoilers and uneccessary text etc etc.1/5, check your poll results. Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2011 Share Posted March 29, 2011 I will add the second tutorial in the first one soon… :P Link to comment Share on other sites More sharing options...
Conscientia Posted March 30, 2011 Share Posted March 30, 2011 Naive fool.Well happy too see that alot of people are using this and giving you feedback.. Link to comment Share on other sites More sharing options...
Esmeyana Posted April 5, 2011 Share Posted April 5, 2011 Finally xDIt works with me ;) Link to comment Share on other sites More sharing options...
Esmeyana Posted April 5, 2011 Share Posted April 5, 2011 Can you make the same with monsters?I have a monster, but I want, that if you want to attack the monster you need lvl 20 speed, because he is too fast, can you? Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2011 Share Posted April 5, 2011 @Esmeyana:> Can you make the same with monsters?> I have a monster, but I want, that if you want to attack the monster you need lvl 20 speed, because he is too fast, can you?Its easy, it works the same as what I did with the resources…I will make it ^^ 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