Hello fellow developers (or enthusiasts if you do this for the fun)
I decided to try and break into this crazy world of making video games!
My Goals where to learn things that i would actually use or could actually improve on once my knowledge and understanding of things got better!! While i have a begginer understanding of TorqueScript from messing around with Torque2D the change to C+ is proving to have its difficult moments!
So i created some of the Tutorial Projects (The Nightmare Survival Shooter and The Survival Rogue-like) and while i really liked the tutorials i got to the point of copying all the scripts in, Going “Yeah they work” and moving on. Then I Found a tower defense tutorial on “noobtuts” and i completed it.
So i moved on, Created a little defense game of a 3D Castle that has 2D guards defending and 2D Slimes, The original guards (Basically the ones that are around on Map Start) Just run to the final Defensive positions while the Slimes endlessly spawn, every 10 seconds i would spawn another wave of guards who would rush out of the castle to try and stem the wave!! I loved the creation of this, it was great fun but as my knowledge was still in the learning stages and i didn’t understand how to implement in the things i wanted to add i decided to move past this little endless defensive battle onto another project!
(alas the reason for this blog post
Side Note: Everything up to this point i have done offline, I am Close to moving house so we disconnected the internet. All Tutorials i saved the Transcripts offline or for the webpages i had saved to offline viewing. Sure it made things harder but if you want to learn you will not let tiny things such as “internet” stop you!!)
RPG Tutorial: How To Create A Unity RPG - Comprehensive Guide - GameDev Academy
This tutorial is awesome (excuse the language), I followed it as precise as i could! I created the Title scene with no worries, moved onto the town scene (World Map or whatever else you would personally call it) and had no problems there (Besides making the judgement call to not create all the Animations for the Animation Controller, i know how to do that and i didnt have an issue with my Sprite being a Static Object on the town Scene
Then i moved onto the Battle Scene, WOW this was where the major headaches begin!!
First Issue is with my HUDCanvas, i know i have followed the setup correctly as it all looks fine with the object layout and i have the child objects when compared to the source file!
and the scripts i was told to implement i have copied straight from the webpage and i didnt get any compiler errors and yet the script for AddButtonCallback is clearly not working for the buttons i have implemented it on (the HUDCanvas (PhysicalAttack, MagicalAttack)) as whenever i click on a button nothing happens!!
I continued with the tutorial as i decided that even if i manage to do everything the tutorial asks i could fix the issues and bugs at the end.
So i followed the tutorial on without further issues until i reached the creating of the TurnSystem, Same as before i have copied the scripting over from the Source and i have made sure that everything else that should be effecting the code is the same as the source (For instance the only differences between my Battle Scene and the Source are little things like the Background Canvas or the fact that the scene is called “Battle Scene” and not “Battle” like in the source
So here are the error logs in the console
error 1:
NullReferenceException: Object reference not set to an instance of an object
PlayerUnitAction.updateHUD () (at Assets/Scripts/PlayerUnitAction.cs:22)
SelectUnit.selectCurrentUnit (UnityEngine.GameObject unit) (at Assets/Scripts/SelectUnit.cs:31)
TurnSystem.nextTurn () (at Assets/Scripts/TurnSystem.cs:62)
KillDamageText.OnDestroy () (at Assets/Scripts/KillDamageText.cs:16)
And thats pretty much my post!! I understand that my issue could possibly be stemming out of a few different script files such as “PlayerUnitAction” or any of the other scripts that are involved with the turn system and they can all be seen from the tutorial link i posted above.
Maybe this is abit of an Advanced Tutorial for a beginner like me? Maybe the Unity Engine has been changed and therefore some of the scripting commands have changed? Either way i will keep at it but i am really hoping that some of the wonderful forum users could help??
Thanks for reading my first Blogpost/WordDump and thank you for reading this far!
As i continue to work and reach this last error i must admit that i have no idea as to whats going wrong as i can simply go “//playerUnitFace.GetComponent().sprite = this.faceSprite;” and when i reach the battle scene my debug logs: Enemy Unit Acting, calculateNextTurn(x5), Player Unit Acting and then finishes. the game runs but buttons dont work ![]()
Edits: Changing Errorlogs as i continue to “work/experiment” Moved Scripts