VitinhooxD Posted August 12, 2009 Author Share Posted August 12, 2009 Hello Eclipse.I'm Stuck with a sub of my game someone can help me?Here is itPlease read over the script```Sub MakeRecipe(index , job , recipe)Dim xDim takecountDim itemDim numDim giveDim valueDim chanceDim expDim giveexpDim lvlDim needtoolDim weaponweapon = Int(GetPlayerInvItemNum(index , Int(GetPlayerWeaponSlot(index))))'I tested if Int and it doesn't workedchance = GetVar("Skills\" & job & ".ini" , ""& recipe , "Chance")lvl = GetPlayer2ndJobLvl(index)exp = Int(GetVar("Accounts\" & GetPlayerName(index) & ".ini" , "SecondJob" , "Exp"))'I tested if Int and it doesn't workedgiveexp = GetVar("Skills\" & job & ".ini" , ""& recipe , "GivenExp")x = Int(1)'I tested if Int and it doesn't workedtakecount = GetVar("Skills\" & job & ".ini" , ""& recipe , "TakeCount")'I tested if Int and it doesn't workedneedtool = GetVar("Skills\" & job & ".ini" , ""& recipe , "NeedTool") If GetPlayer2ndJobLvl(index) < Int(GetVar("Skills\" & job & ".ini" , ""& recipe , "LvlNeed")) ThenCall CustomMenuClose(index)Call BattleMsg(index , "You need to be in level " & Int(GetVar("Skills\" & job & ".ini" , ""& recipe , "LvlNeed")) & " in " & job & " to make " & recipe & " here!" , 12 , 0)Exit Sub End If If Int(weapon) <> Int(needtool) ThenCall CustomMenuClose(index)Call BattleMsg(index , "You need to get the right tool to make " & recipe & " here!" , 12 , 0)Exit Sub End If If PercentRand(index , Chance) = false ThenCall CustomMenuClose(Index)Call BattleMsg(index , "You failed to make a " & recipe & " please try again!" , 12 , 0)Exit Sub End If'i tested all the vars that are below this text with int and doesn't worked give = GetVar("Skills\" & job & ".ini" , ""& recipe , "GiveItem")value = GetVar("Skills\" & job & ".ini" , ""& recipe , "GiveValue")Do While Int(x) <= Int(takecount)item = GetVar("Skills\" & job & ".ini" , ""& recipe , "Item" & Int(x))num = GetVar("Skills\" & job & ".ini" , ""& recipe , "Value"& Int(x))'I have those functions If F_Check_Take(index , item , num) Then If PercentRand(index , Chance) = true ThenCall Take_Item(index , item , num) ElseCall AlertJob(index)Exit Sub End If End Ifx = x + 1LoopCall Give_Currency(index , give , value) If Int(exp) = "" ThenCall PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "SecondJob" , "Exp" , ""& giveexp) Elseexp = Int(exp) + giveexp Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "SecondJob" , "Exp" , ""& exp) End If If Int(exp) >= Int(GetVar("Skills\jobexp.ini" , "Exp" , ""& GetPlayer2ndJobLvl(index))) Then Call PutVar("Accounts\" & GetPlayerName(index) & ".ini" , "SecondJob" , "Level" , ""& lvl + 1) End IfCall CustomMenuClose(index)Call CustomMenuShow(index , "Congratulations" , "/GUI/CUSTOM/Confirm.gif" , 1)Call CustomMenuLabel(index , 140 , "You made a " & recipe & " and now have " & exp & " in " & job & " ! " , 0 , 50 , 12 , 0 , 2 , 400 , 200)End Sub'This script is not for personal use'You musn't use this script in your game'2009 Sunshine development studios.All rights reserved```Thanks for reading Link to comment Share on other sites More sharing options...
Bobosk Posted August 12, 2009 Share Posted August 12, 2009 Have you debugged with player messages? often times, that's one of the more usefull tools for debugging..Though i(And the syntax checkers i use) don't see anything wrong with it. although, i do have a few questions. You have Godlord's inventory scripts? If so then, why use F_Check_Take(which i believe is Baron's?)..?Also i'm guessing that you have created a function for "GetPlayer2ndJobLvl(index)"? Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 12, 2009 Author Share Posted August 12, 2009 Yeah i created the function GetPlayer2ndJobLvl(index) , and i'm using the inventory script that are with Barons quest and skill scripts.i didn't debbuged with player msg. Link to comment Share on other sites More sharing options...
Bobosk Posted August 12, 2009 Share Posted August 12, 2009 You should definetly debug with playermsg's… especially after declaring a variable, just to make sure it's getting the correct ones... aswell as "Test - 'First If' -"(Example) after checks and such.. Just a suggestion.Also, when using multiple subs in another sub, you might want to check and debug the ones you're calling, as it might not be a problem with the original sub at all, but the subs it calls. Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 12, 2009 Author Share Posted August 12, 2009 Hm thanks Bobosk i'll try to debug it Link to comment Share on other sites More sharing options...
Bobosk Posted August 14, 2009 Share Posted August 14, 2009 Any luck?? ^^ Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 14, 2009 Author Share Posted August 14, 2009 Yeah , i already debugged it thanks 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