Zappy Posted March 3, 2012 Author Share Posted March 3, 2012 **What It Does**Frustrated trying to make higher tier ores/trees/etc more difficult to collect, purely on the basis of extra health? Want to prevent that bronze pickaxe wielder from mining your rich cobalt deposits? Well then this simple modification is for you!I've simply thrown in a new interacting requirement for resources and items called Tool power.eg:A **bronze pickaxe** will be given a **tool power of 1**, while a deposit of **copper and tin** will also be given a **tool power (required) of 1**. Therefore, anyone wielding at least a **bronze pickaxe** can mine **copper and tin**, but they won't be able to get at that deposit of **iron**, with a **tool power (required) of 2**.Don't worry though, an **iron pickaxe** with **tool power 2** can mine any ore with a **tool power (required) equal too or less than 2!**Now, let's begin the installation.**Server Side**In **modTypes**, in **ItemRec**add to the **BOTTOM**(before End Type):```Toolpower As Long```In **modTypes**, in **ResourceRec**add to the **BOTTOM**(before End Type):```ToolpowerReq As Long```In **modPlayer**, in **Sub CheckResource**Under:``` Dim Damage As Long```Add:``` Dim ToolpowerReq As Long Dim Toolpower As Long```Above:```' check if damage is more than healthIf Damage > 0 Then```Add:```' check if tool power is strong enough If (Resource(Resource_index).ToolpowerReq <= Item(GetPlayerEquipment(index, Weapon)).Toolpower) Then```Under:```Else' too weakSendActionMsg GetPlayerMap(index), "Miss!", BrightRed, 1, (rX * 32), (rY * 32)End If```Add:```Else'Tool power too lowSendActionMsg GetPlayerMap(index), "Tool too weak!", BrightRed, 1, (rX * 32), (rY * 32)Call PlayerMsg(index, "Your " & Trim$(Item(GetPlayerEquipment(index, Weapon)).Name) & " isn't up to the task.", White)End If```And that's all for the server side!**Client Side**In **modTypes**, in **ItemRec**add to the **BOTTOM**(before End Type):```Toolpower As Long```In **modTypes**, in **ResourceRec**add to the **BOTTOM**(before End Type):```ToolpowerReq As Long```In **modGameEditors**Find:```' Basic requirements ```Under that, insert:```frmEditor_Item.scrlToolpower.Value = .Toolpower```Find:``` .scrlAnimation.Value = Resource(EditorIndex).Animation```Underneath, add this:```.scrlPwrReq.Value = Resource(EditorIndex).ToolpowerReq```Now onto the form work._**Form Work**_**1.** Open up frmEditor_Item**2.** Preferably in the frame "Equipment data" add a label somewhere with space**3.** Name it lblToolpwr, change it's caption too "Tool Power: 0"**4.** Underneath that, add a horizontal scroll bar.**5.** Name it scrlToolpower.**6.** (Optional) Set it's Max to 255.**7.** Double click scrlToolpower and add in:```If scrlToolpower.Value > 0 Then lblToolPwr.Caption = "Tool Power: " & scrlToolpower.Value Else lblToolPwr.Caption = "Tool Power: 0" End If Item(EditorIndex).Toolpower = scrlToolpower.Value```**8.** Save frmEditor_Item and now open frmEditor_Resource**9.** Extend the window to make room for a label and scroll bar.**10.** Create a label, name it lblToolpowerReq, set its caption too "Tool Power Required: 0"**11.** Create a horizontal scroll bar,name it scrlPwrReq**12.** (Optional) Set it's Max as 255.**13**. Double click scrlPwrReq and add:```If scrlPwrReq.Value > 0 Then lblToolpowerReq.Caption = "Tool Power Required: " & scrlPwrReq.Value Else lblToolpowerReq.Caption = "Tool Power Required: 0" End If Resource(EditorIndex).ToolpowerReq = scrlPwrReq.Value```Tada! You're done!If you followed the steps correctly, it should be working wonderfully!![](http://img706.imageshack.us/img706/8063/derpyw.png)I'm not a professional coder, this was something small I made for myself and was simply sharing it with people who have trouble! Link to comment Share on other sites More sharing options...
Peter120 Posted March 4, 2012 Share Posted March 4, 2012 Hello!Nice tutorial, but at compile I get Variable not defined lblToolPwr Link to comment Share on other sites More sharing options...
Zappy Posted March 4, 2012 Author Share Posted March 4, 2012 @Peter120:> Hello!> Nice tutorial, but at compile I get Variable not defined lblToolPwrIf you've named your labels something else, replace "lblToolpwr.Caption" with "[insert label name].Caption" in the form work code, or rename your label. lblToolpwr isn't utilized anywhere but the frmEditor_Item. So trouble shoot there, I'm sure you'll find it ;) Link to comment Share on other sites More sharing options...
Peter120 Posted March 4, 2012 Share Posted March 4, 2012 I tired to add into a fresh EO 2.0 but there is noIf (frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_RECIPE) ThenAre you using http://www.touchofdeathforums.com/smf/index.php/topic,64806.0.html ? Link to comment Share on other sites More sharing options...
Zappy Posted March 4, 2012 Author Share Posted March 4, 2012 Hahaha, oops.Ya, throw:```frmEditor_Item.scrlToolpower.Value = .Toolpower```Under:```' Basic requirements```I fixed the tut.My bad Link to comment Share on other sites More sharing options...
Peter120 Posted March 4, 2012 Share Posted March 4, 2012 Still get this:>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/330a17ba7564237dda6c398b893a4b6c.png) Link to comment Share on other sites More sharing options...
Zappy Posted March 4, 2012 Author Share Posted March 4, 2012 You're surely not changing the lbl name.>! ![](http://img690.imageshack.us/img690/2018/derplj.png) Link to comment Share on other sites More sharing options...
Justn Posted March 4, 2012 Share Posted March 4, 2012 Ur label has to be named lblToolPwr not lblToolPower as it says in the tutorial :) Link to comment Share on other sites More sharing options...
Zappy Posted March 4, 2012 Author Share Posted March 4, 2012 @Justn:> Ur label has to be named lblToolPwr not lblToolPower as it says in the tutorial :)That… could also be an issue...Ya, it's kinda hard writing the tut from code you've already implemented, you kinda type things wrong and screw the whole thing up. thanks for catching that ^-^ fixed* Link to comment Share on other sites More sharing options...
Peter120 Posted March 4, 2012 Share Posted March 4, 2012 Okay, now I get this :mad: :>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/a8caf60fcc5ad538dd76de0561078f3a.png) Link to comment Share on other sites More sharing options...
Zappy Posted March 4, 2012 Author Share Posted March 4, 2012 @Peter120:> Okay, now I get this :mad: :> > >! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/a8caf60fcc5ad538dd76de0561078f3a.png)You need the "=" between them silly. I don't know where yours went :3Item(EditorIndex).Toolpower = scrlToolpower.Value Link to comment Share on other sites More sharing options...
Peter120 Posted March 5, 2012 Share Posted March 5, 2012 Thanks! :cheesy: It's works now! Link to comment Share on other sites More sharing options...
or3o Posted April 2, 2012 Share Posted April 2, 2012 It worked perfectly! thank you for a great tut. Link to comment Share on other sites More sharing options...
Mistlight Posted April 9, 2012 Share Posted April 9, 2012 why do i have this error?>! ![](http://i.imgur.com/nx1tw.png) Link to comment Share on other sites More sharing options...
Me Gusta Posted April 9, 2012 Share Posted April 9, 2012 Nice tutorial, but I believe this should be in Source. Link to comment Share on other sites More sharing options...
RyokuHasu Posted April 11, 2012 Share Posted April 11, 2012 @Mistlight:> why do i have this error?> > >! ![](http://i.imgur.com/nx1tw.png)What version of Visual basic 6 are you using? I'm just wondering because it looks a bit off. 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