Page 1 of 1

Check through the sourcecode before to specify a class name

Posted: Tue Oct 13, 2015 11:46 pm
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.

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

Posted: Wed Oct 14, 2015 2:03 am
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.

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

Posted: Wed Oct 14, 2015 6:13 am
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'.