Most people will find this blog very very dry. It covers my development efforts in the Unreal Development Kit. If you were redirected here while looking for the Naked Tyrants you can catch us on our Facebook page. Leave a comment if you like.
Thought i'd give an update on the progress with screenshots. First thing to notice is that it's a custom game, camera, pawn, controller and weapon (though the weapon doesn't have a mesh yet, it does fire though).
When was my last post? 4 days ago?
Well after 4 days of another exhaustive search on why my custom camera wasn't working i've finally fixed it. The problem lay in extending my controller class and input class from UTPlayerController and UTInputController. Extending them from UDKPlayerController and UDKInput solved the problem.
What a waste of 4 days.
After hours of going through the UDN Forums, unrealscript reference,googling, dev docs i managed to fix the problem i was facing:
1. I hadn't added my custom game type to DefaultGame.ini. Unrealscript was defaulting to UTDeathmatch which is why CoinGame(WorldInfo.Game) always returned zero.
2. The line mentioned in the post before last was fixed by copy pasting the same line off of a website. There were no syntactical differences between the two so i don't know what went wrong there.
Whilst looking for a solution i stumbled upon some material that could help anyone starting off with unrealscript (will add more as i remember them):
Problems in casting and calling classes and functions still persist. Have scoured the community posts but couldn't find anything that offered a specific solution.
The only option is to go the UnrealScript Reference and read it thoroughly. Kind of begs the question; why haven't i read it already? Had to get to it sometime, guess the time is now.
This patch of code here: simulated singular event Touch(Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal) { WorldInfo.Game.Broadcast(self,"Coin touched"); if(Pawn(Other)!=None && Pawn(Other).Controller.bIsPlayer) { if(CoinGame(WorldInfo.Game)!=None) { CoinGame(WorldInfo.Game).CollectedCoins(self); WorldInfo.Game.Broadcast(self,"Coin touched by pawn"); } else { CoinGame(WorldInfo.Game).Broadcast(self,"Huh!?"); WorldInfo.Game.Broadcast(self,"Huh!? World Infor"); } } else { CoinGame(WorldInfo.Game).Broadcast(self,"Okay, my files aren't included"); } }
is giving me errors. Specifically the part marked in red.
It's most probably because i have a custom GameInfo class which extends UDKGame. Going to review Baptism through fire: Adding mod packages again so that my custom classes get compiled better.