Repercussionist Posted February 10, 2011 Author Share Posted February 10, 2011 A pretty simple feature, and my first solo edit. Any words of wisdom would be warmly welcomed.0-Male1-Female2-BothCLIENT SIDE/////Open frmEditor_Item and add a HScrlBar just below the Level Req. scroll bar.Name this scrlSexReq and set the Max to 2.Create a label to the left of this scrollbar.Name it lblSexReq and set the caption to "Sex req: 0" .Next, double click your new scrollbar and add this in the selected sub:```  ' If debug mode, handle error then exit out  If Options.Debug = 1 Then On Error GoTo errorhandler  If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub  lblSexReq.Caption = "Sex req: " & scrlSexReq.Value  Item(EditorIndex).SexReq = scrlSexReq.Value  ' Error handler  Exit Suberrorhandler:  HandleError "scrlSexReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext  Err.Clear  Exit Sub```Then in modDatabase, add this function somewhere:```Function GetPlayerSex(ByVal Index As Long) As Long  ' If debug mode, handle error then exit out  If Options.Debug = 1 Then On Error GoTo errorhandler  If Index > MAX_PLAYERS Then Exit Function  GetPlayerSex = Player(Index).Sex  ' Error handler  Exit Functionerrorhandler:  HandleError "GetPlayerSex", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext  Err.Clear  Exit FunctionEnd Function```In modGameEditors, add this to ItemEditorInit (under ' Basic requirements)```frmEditor_Item.scrlSexReq.Value = .SexReq```In modTypes add this at the bottom of Private Type ItemRec```SexReq As Byte```And this under Player Rec```Sex As Byte```SERVER SIDE//////In modPlayer add this function somewhere```Function GetPlayerSex(ByVal index As Long) As Long  If index > MAX_PLAYERS Then Exit Function  GetPlayerSex = Player(index).SexEnd Function```and also in modPlayer, find the Public Sub UseItem. You should see```Select Case Item(itemnum).Type```just a few lines down.Now put this code under the cases that you want the sex requirement attribute to be active on. In any case where you don't put this, the SexReq will be arbitrary.```' sex requirement        If Item(itemnum).SexReq < 2 And GetPlayerSex(index) <> Item(itemnum).SexReq Then          PlayerMsg index, "You are not the right sex to equip this item.", BrightRed          Exit Sub        End If```And finally, in modTypes, at the bottom of Private Type ItemRec add:```SexReq As Byte``` Link to comment Share on other sites More sharing options...
Fbu Posted February 11, 2011 Share Posted February 11, 2011 I was going to do this over the weekend O: thanks for this Link to comment Share on other sites More sharing options...
crzyone9584 Posted February 11, 2011 Share Posted February 11, 2011 Just so you know, when you add something to the UDTs you will have to delete the files. So with this edit you will have to delete all your items. But very nicely done. Link to comment Share on other sites More sharing options...
Robin Posted February 11, 2011 Share Posted February 11, 2011 @crzyone9584:> Just so you know, when you add something to the UDTs you will have to delete the files. So with this edit you will have to delete all your items. But very nicely done.Only if you add them in to the existing order. Add them to the end of the UDT and it'll load them just fine. Link to comment Share on other sites More sharing options...
Repercussionist Posted February 11, 2011 Author Share Posted February 11, 2011 Hmm.. You're right. I thought I had tried that, but now that I think about it, I only recall changing it on one side. Thanks for bringing that to my attention guys. Link to comment Share on other sites More sharing options...
crzyone9584 Posted February 11, 2011 Share Posted February 11, 2011 @Rainbow:> Only if you add them in to the existing order. Add them to the end of the UDT and it'll load them just fine.You'd thing after messing around with the players udt I'd figure that out by now. Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2011 Share Posted February 11, 2011 Personally I think this would be a bit of an annoying system. I.e. a monster would drop a female piece of armour and a male wouldn't be able to use it, etc. Link to comment Share on other sites More sharing options...
crzyone9584 Posted February 11, 2011 Share Posted February 11, 2011 Its just like any other drop. You kill a monster and he drops a level 1 weapon when your level 10 with a level 8 weapon. So what do you do with that level 1? you sell it. This will just make it so that people can make more money along with the ability to have specific armor paper dolls so they will always look like a women. Link to comment Share on other sites More sharing options...
Repercussionist Posted February 11, 2011 Author Share Posted February 11, 2011 From the tone of your post, it sounds like you're planning on it being a consistently identical drop for each kill. If it randomly drops something you can't use, then sell it. It's the same way for class requirements.Besides, my idea for this was character customization (hair, clothes, etc.) that was separate from armor. Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2011 Share Posted February 11, 2011 Well, having customization in-game would be alright but I'd do it during char creation if I was you, jus' sayin. Link to comment Share on other sites More sharing options...
Repercussionist Posted February 11, 2011 Author Share Posted February 11, 2011 Eh, it allows for easy changing in game. They buy the clothes they want from a shop and equip it at their leisure.And that was just how I was planning on using it. Take a look at WonderKing. Most all of their equips are gender based. :P Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2011 Share Posted February 11, 2011 Mmm, yeah in-game customization would be nice, once or twice. I don't know, I just don't think having gender based items is such a good idea, but that's just my opinion. Link to comment Share on other sites More sharing options...
Robin Posted February 11, 2011 Share Posted February 11, 2011 Personally I'd prefer simply have two paperdolls set. One which shows on females, one which shows on males. Link to comment Share on other sites More sharing options...
Repercussionist Posted February 12, 2011 Author Share Posted February 12, 2011 That's a neat idea, but that would only work if there was a counterpart for each sex. If it was something you wanted only one sex to have, maybe something that the other sex couldn't /possibly/ use, you'd have to use a restriction. Link to comment Share on other sites More sharing options...
crzyone9584 Posted February 12, 2011 Share Posted February 12, 2011 You could always modify the drops so it checks to see if its armor dropping then to see if the player is male or female then if its male only drop the male item and vice versa. Link to comment Share on other sites More sharing options...
Fbu Posted February 12, 2011 Share Posted February 12, 2011 Then players could trade it between males and females. Link to comment Share on other sites More sharing options...
Sickey Posted April 19, 2011 Share Posted April 19, 2011 hmm seems great but I dont get that scroll when im opening it so I cant edit it Link to comment Share on other sites More sharing options...
gdog12356 Posted April 25, 2011 Share Posted April 25, 2011 i get an error when compiling here in mod database - GetPlayerSex = Player(Index).Sex Link to comment Share on other sites More sharing options...
shadowwulf Posted April 26, 2011 Share Posted April 26, 2011 i read the title and immediately though of the error "You haven't had enough sex to use this!" lulz Link to comment Share on other sites More sharing options...
Sickey Posted May 3, 2011 Share Posted May 3, 2011 @Robin:> Personally I'd prefer simply have two paperdolls set. One which shows on females, one which shows on males.What? You can add multiple PDs on one item? please tell me how to do that :) Link to comment Share on other sites More sharing options...
Repercussionist Posted May 25, 2011 Author Share Posted May 25, 2011 @im66sickYou have to create that scrollbar.@gianniAddSex As Byteinto the client modTypes, under player rec. Silly mistake on my part. Link to comment Share on other sites More sharing options...
Sickey Posted June 6, 2011 Share Posted June 6, 2011 @Repercussionist:> @im66sick> > You have to create that scrollbar.I did create the scrollbar. I meant I can't see it ingame so I can't edit the items :/ Link to comment Share on other sites More sharing options...
Repercussionist Posted June 6, 2011 Author Share Posted June 6, 2011 @Im66sick:> I did create the scrollbar. I meant I can't see it ingame so I can't edit the items :/Is the visibility set to false? Did you compile the client/server? Link to comment Share on other sites More sharing options...
Sickey Posted June 7, 2011 Share Posted June 7, 2011 @Repercussionist:> Is the visibility set to false? Did you compile the client/server?I think I might have found the problem :P Will test when I back home. And yes I recently found out that you need to compile lol I have been saving the project only.*Edit. How weird.. When I compile it I can see it, but when I run the client, I can't see it? :huh: 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