Check through the sourcecode before to specify a class name

Discussions about UT99
Post Reply
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Check through the sourcecode before to specify a class name

Post by PrinceOfFunky »

Yesterday I created a class called "Commander" for a mutator I'm making, when I tried to operate on it, it gave me a lot of errors, I tried my best to solve all the errors it gave me.
It gave me especially these kinds of error: "Type mismatch" and "Unrecognized member"
I made one topic here about it but the problems persisted and I didn't get why, after some hours I tough: "Wait, what if the class Commander already exists?".
These were the type of faces I was having chronologically:
Spoiler
  • When I did the question to myself: :shock:
  • When I changed the name to the class and it started to compile: :|
  • When, in the middle of the compilation, I remembered about the class Commander(subclass of PlayerPawn): :agree1:
  • When the compiler didn't give me any error: :)
  • When I tested the mutator and everything worked fine finally: 8)
  • Now that I'm writing this post: :lol:
  • When I'll announce the mutator: :rock:
So what I wanted say with this post is: Always check through the sourcecode before to specify a class name, cause the name may have already been used!

NOTE: You can still use a class name that have already been used, but when you try to operate on it, you've to specify the package.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Check through the sourcecode before to specify a class n

Post by Chamberly »

Yep. & if you try to use a name that it has been used by other, it can mess up and probably spit out accesse nones as well.

Which is why I remember why FD say nasty things can happens. Or something like that, from reading his tutorial description in the development school sub forum.
Image
Image
Image Edit: Why does my sig not work anymore?
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Check through the sourcecode before to specify a class n

Post by JackGriffin »

This is why it's a good idea to never use generic names in your classes and especially mods. I use 'go' in a lot of stuff, not because I want the glory, but to keep it unique enough that it won't conflict. Find something that works for you and use that in your naming conventions. Even if you use super generic names like 'SniperRifle' or 'ScubaGear' You can make them perfectly acceptable by calling them 'gorifle' or 'goScuba'.
So long, and thanks for all the fish
Post Reply