killerminx Posted September 14, 2009 Author Share Posted September 14, 2009 I have tried to learn source and cant so im sticking with sadscript, anyways like the class bar, i want 2 more bars one to choose elemnt type and the other to choose like a second class, but i want the choice to be sent as a```putvar(index, "scripts/char/" & getplayername(index) & ".ini" , "STATS", element, 1-5)``````putvar(index, "scripts/char/" & getplayername(index) & ".ini" , "STATS", class2, 1-20)```how can this be done? Link to comment Share on other sites More sharing options...
shadowwulf Posted September 14, 2009 Share Posted September 14, 2009 little side note:they are like 90% the same. You just need to look around a little more to find the stuff you need.Like in Announcements>All Commands…> Call PutVar(File, Header, Var, Value)> > Call Putvar("file.ini", "header", "variable", 4)> file.ini = file variable goes into> header = header variable is under> Example of header => [header]> variable = 4> variable = the variable that it is set in> 4 = the value set in variable> this command saves a variableso try losing the index you put there. At first it does seem like you always use it… but in this cast you don't Link to comment Share on other sites More sharing options...
killerminx Posted September 14, 2009 Author Share Posted September 14, 2009 no i don't need to know how to make an ini file i know that read what i wrote "newchar form" the page where you make a new character i want to know how to add a bar like the class bar where you choose the element and the data is sent to the ini file i put up there above. Link to comment Share on other sites More sharing options...
killerminx Posted September 14, 2009 Author Share Posted September 14, 2009 Sorry my computer wouldn't let me modify…so srry for double post anyways heres an example to show what i need help with![](http://i153.photobucket.com/albums/s233/killermniko/example-1.jpg) Link to comment Share on other sites More sharing options...
killerminx Posted September 17, 2009 Author Share Posted September 17, 2009 ok so i found out the easy way to add choices to the combo box. I just use .additem in form load , anywho wil putvar work in source i don't think it will```Private Sub cmbElement_Click()If cmbElement = "Fire" ThenEnd IfEnd Sub```i don't know what to put in there to store the data to my ini file? Link to comment Share on other sites More sharing options...
shadowwulf Posted September 18, 2009 Share Posted September 18, 2009 putvar and getvar do work in source. I beleive there syntax is a little different.You can do a search for any command you want to use to see how its used elsewhere in the system Link to comment Share on other sites More sharing options...
balliztik1 Posted September 18, 2009 Share Posted September 18, 2009 You don't want to use PutVar in this case. This will generate a .ini file separate from the players' data. What you'd want to do is make new properties of the PlayerRec Type. Just add "Element" and "Class2" to the list of properties found in modTypes. Then, you can get the value whenever you need, just by using "Player(index).Char(Player(index).CharNum).Element", instead of having to read in the variable. This way is much more efficient, and it's much easier to write into the source. Link to comment Share on other sites More sharing options...
killerminx Posted September 18, 2009 Author Share Posted September 18, 2009 Balliztik yea that would be the smart way to go. but if i do that id need a command to retrive that value for me and a command to change that value. As i stated im not that good in source and if i went the putvar and getvar route i already have those to commands and id rather script over source anyday. but ill try it the source way first and see if i can make a command to go along with the data. Link to comment Share on other sites More sharing options...
killerminx Posted September 18, 2009 Author Share Posted September 18, 2009 ```Function GetPlayerClass2(ByVal Index As Long) As Long GetPlayerClass2 = Player(Index).Char(Player(Index).CharNum).ClassEnd FunctionSub SetPlayerClass2(ByVal Index As Long, ByVal ClassNum As Long) Player(Index).Char(Player(Index).CharNum).Class2 = ClassNumEnd Sub``````Function GetPlayerElement(ByVal Index As Long) As Long GetPlayerElement = Player(Index).Char(Player(Index).CharNum).ElementEnd FunctionSub SetPlayerElement(ByVal Index As Long, ByVal ElementNum As Long) Player(Index).Char(Player(Index).CharNum).Element = ElementNumEnd Sub```i placed that in clsCommands server side``` Class2 As Long Element As Long```I placed that below PlayerRec``` If cmbClass = "Warrior" Then cmbClass2.Clear cmbClass2.addItem "Knight" cmbClass2.ItemData(cmbClass2.NewIndex) = 1 cmbClass2.addItem "Samuria" cmbClass2.ItemData(cmbClass2.NewIndex) = 2 ElseIf cmbClass = "Mage" Then cmbClass2.Clear cmbClass2.addItem "White Mage" cmbClass2.ItemData(cmbClass2.NewIndex) = 3 cmbClass2.addItem "Black Mage" cmbClass2.ItemData(cmbClass2.NewIndex) = 4 cmbClass2.addItem "Red Mage" cmbClass2.ItemData(cmbClass2.NewIndex) = 5 End If```I placed that under Private Sub cmbClass_Click()```cmbElement.addItem "Fire"cmbElement.ItemData(cmbElement.NewIndex) = 1cmbElement.addItem "Wind"cmbElement.ItemData(cmbElement.NewIndex) = 2cmbElement.addItem "Water"cmbElement.ItemData(cmbElement.NewIndex) = 3cmbElement.addItem "Earth"cmbElement.ItemData(cmbElement.NewIndex) = 4cmbElement.addItem "Lightning"cmbElement.ItemData(cmbElement.NewIndex) = 5```i placed that under Private Sub Form_Load()``` If cmbElement = "" Then MsgBox "You need to choose an element." Exit Sub End If If cmbClass2 = "" Then MsgBox "You need to choose a Primary Class." Exit Sub End If```in add character section``` cmbClass2.ItemData(cmbClass2.ListIndex) = Player(Index).Char(Player(Index).CharNum).Class2 cmbElement.ItemData(cmbElement.ListIndex) = Player(Index).Char(Player(Index).CharNum).Element```the line above Call MenuState(MENU_STATE_ADDCHAR)In the add character button area.anything looking wrong? Link to comment Share on other sites More sharing options...
balliztik1 Posted September 19, 2009 Share Posted September 19, 2009 Looks pretty solid so far, except you left a 2 off your class2 in the GetPlayerClass2 command. Link to comment Share on other sites More sharing options...
killerminx Posted September 22, 2009 Author Share Posted September 22, 2009 okay im trying to change```cmbClass2.ItemData(cmbClass2.NewIndex) = 1```to```Player(index).Char(Player(index).CharNum).Class2 = 1```but im having problems```Player(index).Char(Player(index).CharNum).Class2 = 1```wouldn't work cause the Char(Player(index).CharNum) wasn't defind so VB6 wouldn't let me even make a client.```Player(Index).Class2 = 1```Same problem so tried this```Player(NewIndex).Class2 = 1```I ended up with a RTE 9```Player(cmbClass2.Index).Class2 = 1```Now im geting a RTE 343 which says"Object not an arrayIm confused on how to set the data in mod type–----------------------------------------------------for now i went bk to the method of storeing data bycmbClass2.itemdata blah blah blah way but when creating a newchar it freezes so look below to help me copy what they do in class combobox Link to comment Share on other sites More sharing options...
killerminx Posted September 24, 2009 Author Share Posted September 24, 2009 ``` frmNewChar.cmbClass.Clear For i = 0 To Max_Classes If Class(i).Locked = 0 Then frmNewChar.cmbClass.addItem Trim$(Class(i).Name) End If Next i frmNewChar.cmbClass.ListIndex = 0 frmNewChar.lblClassDesc = Class(0).desc If ClassesOn = 1 Then frmNewChar.cmbClass.Visible = True frmNewChar.lblClassDesc.Visible = True ElseIf ClassesOn = 0 Then frmNewChar.cmbClass.Visible = False frmNewChar.lblClassDesc.Visible = False End If```in that code im wondering if``` frmNewChar.cmbClass.addItem Trim$(Class(i).Name)```is putting out a number or the name?ok second questionwhat is it doing here``` frmNewChar.cmbClass.ListIndex = 0```don't tell me its giving it a val i understand that, i mean why they add it here Link to comment Share on other sites More sharing options...
Kimimaru Posted September 25, 2009 Share Posted September 25, 2009 ```frmNewChar.cmbClass.addItem Trim$(Class(i).Name)```From what it looks like, this code is putting out a name. The name is the name of the class.```frmNewChar.cmbClass.ListIndex = 0```This tells you that you've selected the first class, or class 0\. In the combo box, this is the first option on the list. This code is referring to the default combo box that comes with frmNewChar, which is the combo box for selecting your class.I hope that helps. Link to comment Share on other sites More sharing options...
killerminx Posted September 26, 2009 Author Share Posted September 26, 2009 Thanks it helped.Wells here what i got in my game.**Client side****frmnewchar**I added 2 combo boxes named one cmbPath and cmbElementPrivate Sub Form_Load()'Add this to the bottom of this```cmbElement.addItem "Fire"cmbElement.addItem "Wind"cmbElement.addItem "Water"cmbElement.addItem "Earth"cmbElement.addItem "Lightning"```Private Sub picAddChar_Click()'Add this right under where you dim i As Long``` If cmbElement = "" Then MsgBox "You need to choose an element." Exit Sub End If If cmbPath = "" Then MsgBox "You need to choose a ninja path to follow." Exit Sub End If```Private Sub cmbClass_Click()'add at the botom above end sub``` If cmbClass = "Konoha" Then cmbPath.Clear cmbPath.addItem "Naruto's Goal" cmbPath.addItem "Uchiha Destiny" cmbPath.addItem "Lee's Path" ElseIf cmbClass = "Suna" Then cmbPath.Clear cmbPath.addItem "Puppeteer" cmbPath.addItem "Fan User" cmbPath.addItem "Sand Controller" End If```**Modgamelogic**Sub MenuState(ByVal State As Long)"changed the 1st to the second``` Case MENU_STATE_ADDCHAR frmNewChar.Visible = False If ConnectToServer Then Call SetStatus("Connected. Creating Character...") If frmNewChar.optMale.Value Then Call SendAddChar(frmNewChar.txtName, 0, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1, frmNewChar.HScroll1.Value, frmNewChar.HScroll2.Value, frmNewChar.HScroll3.Value) Else Call SendAddChar(frmNewChar.txtName, 1, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1, frmNewChar.HScroll1.Value, frmNewChar.HScroll2.Value, frmNewChar.HScroll3.Value) End If End If```replaced with this``` Case MENU_STATE_ADDCHAR frmNewChar.Visible = False If ConnectToServer Then Call SetStatus("Connected. Creating Character...") If frmNewChar.optMale.Value Then Call SendAddChar(frmNewChar.txtName, 0, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1, frmNewChar.HScroll1.Value, frmNewChar.HScroll2.Value, frmNewChar.HScroll3.Value, frmNewChar.cmbPath.ListIndex + 1, frmNewChar.cmbElement.ListIndex + 1) Else Call SendAddChar(frmNewChar.txtName, 1, frmNewChar.cmbClass.ListIndex, frmChars.lstChars.ListIndex + 1, frmNewChar.HScroll1.Value, frmNewChar.HScroll2.Value, frmNewChar.HScroll3.Value, frmNewChar.cmbPath.ListIndex + 1, frmNewChar.cmbElement.ListIndex + 1) End If End If```**Modhandledata**Sub HandleData(ByVal Data As String) ' :::::::::::::::::::::::: ' :: Player data packet :: ' ::::::::::::::::::::::::'Iadded this at the botom of the packets``` Call SetPlayerClass2(i, Val(parse(18))) Call SetPlayerElement(i, Val(parse(19)))```**ModclientTCP**Changed```Sub SendAddChar(ByVal Name As String, ByVal Sex As Long, ByVal ClassNum As Long, ByVal slot As Long, ByVal HeadC As Long, ByVal BodyC As Long, ByVal LegC As Long) Call SendData("addchar" & SEP_CHAR & Trim$(Name) & SEP_CHAR & Sex & SEP_CHAR & ClassNum & SEP_CHAR & slot & SEP_CHAR & HeadC & SEP_CHAR & BodyC & SEP_CHAR & LegC & END_CHAR)End Sub```'to```Sub SendAddChar(ByVal Name As String, ByVal Sex As Long, ByVal ClassNum As Long, ByVal slot As Long, ByVal HeadC As Long, ByVal BodyC As Long, ByVal LegC As Long, ByVal Class2Num As Long, ByVal ElementNum As Long) Call SendData("addchar" & SEP_CHAR & Trim$(Name) & SEP_CHAR & Sex & SEP_CHAR & ClassNum & SEP_CHAR & slot & SEP_CHAR & HeadC & SEP_CHAR & BodyC & SEP_CHAR & LegC & END_CHAR & Class2Num & END_CHAR & ElementNum & END_CHAR)End Sub```**Moddatabase**```Function GetPlayerClass2(ByVal Index As Long) As Long GetPlayerClass2 = Player(Index).PathEnd FunctionSub SetPlayerClass2(ByVal Index As Long, ByVal ClassNum As Long) Player(Index).Path = ClassNumEnd SubFunction GetPlayerElement(ByVal Index As Long) As Long GetPlayerElement = Player(Index).elementEnd FunctionSub SetPlayerElement(ByVal Index As Long, ByVal ClassNum As Long) Player(Index).element = ClassNumEnd Sub```'I added these at the bottom.**ModTypes**I added this at Type PlayerRec at the end``` Path As Long Element As Long```–------------------------------------------------------------------------------------------------------**Serverside**–-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------**ModTypes**Add this at the end of PlayerRec``` Path As Integer Element As Integer```**ModDatabase**Sub AddChar'Ichanged```Sub AddChar(ByVal Index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Byte, ByVal CharNum As Long, ByVal headc As Long, ByVal bodyc As Long, ByVal logc As Long)```to```Sub AddChar(ByVal Index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Byte, ByVal CharNum As Long, ByVal headc As Long, ByVal bodyc As Long, ByVal logc As Long, ByVal Class2Num As Byte, ByVal ElementNum As Byte)```'I added``` Player(Index).Char(CharNum).Path = Class2Num Player(Index).Char(CharNum).Element = ElementNum```under Player(Index).Char(CharNum).Class = ClassNumPost at the bottom of maddatabase```Function GetPlayerClass2(ByVal Index As Long) As Long GetPlayerClass2 = Player(Index).Char(Player(Index).CharNum).PathEnd FunctionSub SetPlayerClass2(ByVal Index As Long, ByVal ClassNum As Long) Player(Index).Char(Player(Index).CharNum).Path = ClassNumEnd SubFunction GetPlayerElement(ByVal Index As Long) As Long GetPlayerElement = Player(Index).Char(Player(Index).CharNum).ElementEnd FunctionSub SetPlayerElement(ByVal Index As Long, ByVal ClassNum As Long) Player(Index).Char(Player(Index).CharNum).Element = ClassNumEnd Sub```**clsCommands**Add this at the bottom```Function GetPlayerClass2(ByVal Index As Long) As Long GetPlayerClass2 = Player(Index).Char(Player(Index).CharNum).PathEnd FunctionSub SetPlayerClass2(ByVal Index As Long, ByVal ClassNum As Long) Player(Index).Char(Player(Index).CharNum).Path = ClassNumEnd SubFunction GetPlayerElement(ByVal Index As Long) As Long GetPlayerElement = Player(Index).Char(Player(Index).CharNum).ElementEnd FunctionSub SetPlayerElement(ByVal Index As Long, ByVal CharNum As Long) Player(Index).Char(Player(Index).CharNum).Element = CharNumEnd Sub```'At the bottom ofSub SendPlayerData(ByVal Index As Long)add these 2 below packet = packet & GetPlayerPaperdoll(Index) & SEP_CHAR``` packet = packet & GetPlayerClass2(Index) & SEP_CHAR packet = packet & GetPlayerElement(Index) & SEP_CHAR```**modServerTCP**Under Sub SendJoinMap(ByVal Index As Long)Change this``` packet = packet & GetPlayerLevel(I) & SEP_CHAR packet = packet & END_CHAR```to``` packet = packet & GetPlayerLevel(I) & SEP_CHAR packet = packet & GetPlayerClass2(Index) & SEP_CHAR packet = packet & GetPlayerElement(Index) & SEP_CHAR packet = packet & END_CHAR```'At the bottom ofSub SendPlayerData(ByVal Index As Long)add these 2 below packet = packet & GetPlayerPaperdoll(Index) & SEP_CHAR``` packet = packet & GetPlayerClass2(Index) & SEP_CHAR packet = packet & GetPlayerElement(Index) & SEP_CHAR```**ModHandleData**Under Sub HandleData(ByVal Index As Long, ByVal Data As String)I changed``` Case "addchar" Call Packet_AddCharacter(Index, Parse(1), Val(Parse(2)), Val(Parse(3)), Val(Parse(4)), Val(Parse(5)), Val(Parse(6)), Val(Parse(7))) Exit Sub```to``` Case "addchar" Call Packet_AddCharacter(Index, Parse(1), Val(Parse(2)), Val(Parse(3)), Val(Parse(4)), Val(Parse(5)), Val(Parse(6)), Val(Parse(7)), Val(Parse(8)), Val(Parse(9))) Exit Sub```At Public Sub Packet_AddCharacterI changed```Public Sub Packet_AddCharacter(ByVal Index As Long, ByVal Name As String, ByVal Sex As Long, ByVal Class As Long, ByVal CharNum As Long, ByVal Head As Long, ByVal Body As Long, ByVal Leg As Long)```to```Public Sub Packet_AddCharacter(ByVal Index As Long, ByVal Name As String, ByVal Sex As Long, ByVal Class As Long, ByVal CharNum As Long, ByVal Head As Long, ByVal Body As Long, ByVal Leg As Long, ByVal Class2 As Long, ByVal Element As Long)```then i changed```Call AddChar(Index, Name, Sex, Class, CharNum, Head, Body, Leg)```to```Call AddChar(Index, Name, Sex, Class, CharNum, Head, Body, Leg, Class2, Element)```–---------------------------------------------Anywho after doing all of this everytime i click add character at the character screen it stays inStatus "Connected. Creating Character..."which means my problems start at Clint side Sub MenuState but i just cant seem to figure it out sorry id like some help....like i said im a source newbie Link to comment Share on other sites More sharing options...
Kimimaru Posted September 26, 2009 Share Posted September 26, 2009 Try going on again in a little bit. I remember that happened to me once for no apparent reason. I just waited a little bit and then tried to create a new character later, and it worked. 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