Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Wanna turn weapons proficiencies into a skill like woodcutting or mining?


or3o
 Share

Recommended Posts

 
You need to have added this tutorial before you can do this
    http://www.touchofdeathforums.com/smf/index.php/topic,71740.0.html

credit to DJMaxus for his weapons proficiencies tutorial
and a special thanks to Ryoku for showing me how to make resources give exp in the first place.

Here we go, This tutorial works on the assumption that you made a skill called fishing with the weapons proficiencies tutorial but it can be very easily modified for any resource related skill.

  **Server Side**
  First go to modTypes in the ResourcRec
under  **Animation As Long**
Paste
  Dim resourcetype As Byte

Then in **ModPlayer** in sub CheckResources above

**' carry on
  GiveInvItem Index, Resource(Resource_index).ItemReward, 1**

Paste 
```
If Resource(Resource_index).resourcetype = 3 Then
                                      SetPlayerFishingExp Index, GetPlayerFishingExp(Index) + Resource(Resource_index).FiExp
                                      SendEXP Index
                                    End If
```
**Client Side**

  go to modTypes in the ResourcRec
under  **Animation As Long**
paste  FiExp As Long

Then go to ModgameEditors sub ResourceEditorInit
Find  **.scrlAnimation.Value = Resource(EditorIndex).Animation**
```
then add .txtFiExp.text = Resource(EditorIndex).FiExp
```

**Now its time for the form work**
First go to FrmEditor_resource
add a label named lblfiexp and write fishing experience in it.

Then add a textbox (make sure to clear the Text1)
name it txtFiExp

Now double click the text box and paste this
```
' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If Not Len(txtFiExp.text) > 0 Then Exit Sub
    If IsNumeric(txtFiExp.text) Then Resource(EditorIndex).FiExp = Val(txtFiExp.text)

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "txtFiEXP_Change", "frmEditor_NPC", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
```if you have any issues or comments feel free to message me. thank you for reading my first tutorial and i hope you enjoy it.
Link to comment
Share on other sites

  • 3 weeks later...
I updated the tutorial due to an issue a fellow forum member was having, now you just need to set the exp for the resource and it check based on your items fishing req, so to add more skills you wont have to add more scroll bars. also you have to have a success message for it to give you experience, ill fix that next time I edit my server :/
Link to comment
Share on other sites

omg this is worst metod i ever seen for this,u must have only 1 type of resource, like 1 tree, 1 fishing spot etc.  I did this too and i maked checks for types of resource not Resource_Index. Just try to make more ifs and read from cmbType. But nice try :P . I will make tutorial for it if i have time :cheesy:
Link to comment
Share on other sites

you must be busy putting shit on your charlie brown christmas tree.  in the mean time, why not test it out before you say its horrible.  why must we only have 1 type of tree ect?  why would we want more ifs?
Link to comment
Share on other sites

I havent had a problem with it? i can set the exp differently for each resource and since it checks the kind of item im using  I didnt have to make multiple scroll bars for different types of exp.  If you have a better way of doing it I would be happy to check it out.

Resource(EditorIndex).FiExp    <–  that part checks the resources so u can set different exp for different individual resources. 
and thx for lookin out sotvotkong
Link to comment
Share on other sites

if you wanna make it so the higher level your skill is the more damage you do to the resource you can add this

ALL SERVER SIDE

in mod player  sub checkresource
  below```
  rY = ResourceCache(GetPlayerMap(Index)).ResourceData(Resource_num).y
```
replace this```
Damage = Item(GetPlayerEquipment(Index, Weapon)).Data2
```
with this```
itemnum = GetPlayerEquipment(Index, Weapon) 
FI = Item(itemnum).Fishing
                                  If FI > 0 Then
                        Damage = Item(GetPlayerEquipment(Index, Weapon)).Data2 + (GetPlayerFishing(Index) * 2)
                          End If
```and you can add more just by copying this part and renaming the different parts with the different skills you have added. Also if you dont like how much damage this adds  you could easily replace the *2 part with something more fitting.
Link to comment
Share on other sites

  • 1 month later...
@kapsel598:

> next error:
> http://postimage.org/image/lgkm5yg9n/

@or3o:

> This tutorial works on the assumption that you made a skill called fishing with the weapons proficiencies tutorial but it can be very easily modified for any resource related skill.
Link to comment
Share on other sites

im not sure if i remember to put it in the tutorial but you need to put this

```
fiexp as long
```
in mod types under resource recs in both the client and server portion of mod types.

i cant really access my code at the moment but when i get back onto visual basic ill try n see if that was the issue.

If you would run the server and client in visual basic then click save and show me what gets highlighted i could help you easier, right now i basically have to guess.
Link to comment
Share on other sites

no open the client and server in visual basic and click run not compile. its how you can run it before compiling to test it out. up near the top of the screen on the left hand sign it should look like a sideways triangle. try not to triple post i think its agianst forum rules, its better to just modify your last post ok?

also read the third post down on that tutorial you just linked me, that makes it so you can have a woodcutting level requirement.

if you want it to add woodcutting experience then on server side add this
in ModPlayer in sub CheckResources above

' carry on
  GiveInvItem Index, Resource(Resource_index).ItemReward, 1

Paste 
```
                  itemnum = GetPlayerEquipment(Index, Weapon)   
                    FI = Item(itemnum).woodcutting
                                  If FI > 0 Then
                                      SetPlayerwoodcuttingExp Index, GetPlayerwoodcuttingExp(Index) + Resource(Resource_index).FiExp
                                      SendPlayerData Index
                                      SendEXP Index
                                    End If [\code]
```
Link to comment
Share on other sites

  • 3 weeks later...
You deleted your resources out of the server right? ill check n see if i can figure out whats up ok?
I just updated my tutorial to have a better way of determining what skill you are getting experience in if you change the part in server side  mod player, check resource it may fix the issue your having, if that doesnt help just tell me and  ill try n see whats wrong.
Link to comment
Share on other sites

@or3o:

> You deleted your resources out of the server right? ill check n see if i can figure out whats up ok?
> I just updated my tutorial to have a better way of determining what skill you are getting experience in if you change the part in server side  mod player, check resource it may fix the issue your having, if that doesnt help just tell me and  ill try n see whats wrong.

Alright, I'm pretty sure I know the problem, I'm going to retry it. And yes, I cleared resources.

EDIT: you removed the code that actually gives the skill EXP to the player….
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...