Jaiden Posted May 25, 2011 Author Share Posted May 25, 2011 I'm having some trouble compiling code. I looked around the forums and found similar problems but I'm not really sure on how to fix the issue.I added "Sex Based Requirements for Equips" to the source.http://www.touchofdeathforums.com/smf/index.php/topic,68906.0.htmlThe game runs in VB6 fine but I can't compile it due to the error "Compile Error: Method or data member not found."The function is:```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```It highlights .sex in the following line. I'm assuming something is undeclared.```GetPlayerSex = Player(Index).Sex``` Link to comment Share on other sites More sharing options...
Repercussionist Posted May 25, 2011 Share Posted May 25, 2011 Well, I went back and looked it over and I got the same problem on compile. I took that function out entirely and it fixed the problem, from what I can tell. It seems that there's a lot of loose code in my tutorial. I'll have to go back and clean that up. If you could try it and let me know what you get that would be appreciated. Link to comment Share on other sites More sharing options...
Jaiden Posted May 25, 2011 Author Share Posted May 25, 2011 You're right. I removed the line completely and it compiled fine. But I think that's odd that it happened in the first place and I dont like the idea of loose code.Thank you though. Link to comment Share on other sites More sharing options...
Robin Posted May 25, 2011 Share Posted May 25, 2011 You didn't add it to the UDT.Of course, removing that line of code _makes the function completely useless and will destroy the system._It's just a dodgy tutorial. You get those around. Post on the thread and hope someone helps you. In the mean time learn to do things for yourself. Link to comment Share on other sites More sharing options...
Dzastin Posted May 25, 2011 Share Posted May 25, 2011 You must add to PlayerRec this:Sex As Byte…in modTypes Link to comment Share on other sites More sharing options...
Jaiden Posted May 25, 2011 Author Share Posted May 25, 2011 @Robin:> You didn't add it to the UDT.> > Of course, removing that line of code _makes the function completely useless and will destroy the system._> > It's just a dodgy tutorial. You get those around. Post on the thread and hope someone helps you. In the mean time learn to do things for yourself.Thank you, I was afraid it was something like that.Yes I need to learn to do things for myself, I suppose my method of learning is asking questions though. I don't have a problem working with the source, I just don't have a complete understanding of how everything works and where to find what I need to find.@aℓνιη:> You must add to PlayerRec this:> > Sex As Byte> > …in modTypesI believe this is what I was looking for. I'll try it out, thanks! Link to comment Share on other sites More sharing options...
Repercussionist Posted May 25, 2011 Share Posted May 25, 2011 Oops. Was looking at the wrong set of UDT's. Sex is defined in the server, not the client. Adding it to the UDT was the first thing I suspected, but it doesn't help if I'm looking in the wrong window.:embarrassed: Link to comment Share on other sites More sharing options...
Jaiden Posted May 26, 2011 Author Share Posted May 26, 2011 It worked, thank you Alvin! 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