sgwee
New Member
Posts: 7
Currently working on Incremental RPG using Unity and C#
Posts: 7
|
Post by sgwee on Jun 9, 2015 23:40:11 GMT
Hi I'll be around these forums for a while since this pooling system is a big part of the incremental idle RPG game I am working on. (think cookie clicker, clicker heroes)
I wanted to know what the best way to set up the passive damage calculations. For click damage I figured that out pretty easy since it is something you have already built in with click damage 2D script. Essentially for passive damage though it would have to be able to take in damage as soon as the killable prefab is spawned. I have to be able to run the DPS as a coRoutine, to let it only damage once per second. Where do I calculate this coRoutine? Do i need to establish some kind of listener script on the killable? The DPS and Damage Per Click (DPC) will be set up as World Variables to make calculating damage easier. Though I also am trying to figure out how to calculate those variables since they are based on a referenced weapon in my hero game object. I am a low level C# programmer but am willing to learn and write my own scripts, just don't want to mess up anything established in your code.
In short I need -To Calculate base damage based on weapon (my scripts) -extend that to world variables -Have Enemies spawned to take passive damage as soon as they are spawned
|
|
|
Post by DarkTonic Dev on Jun 10, 2015 1:09:15 GMT
1) Calculate damage based on weapon: go right ahead. 2) I don't know mean by "extend that to world variables". Please explain what you want to do. I'm not sure why World Variables are involved here? 3) Take passive damage: You can either make a subclass of KillableListener.cs and override method "Spawned" so you can call the TakeDamage method (and put that new subclass on the same game object as the Killable) or make a subclass of Killable if you think you'll be wanting to override other things, as the Listener is more limited.
|
|
sgwee
New Member
Posts: 7
Currently working on Incremental RPG using Unity and C#
Posts: 7
|
Post by sgwee on Jun 11, 2015 21:25:00 GMT
hm. I never thought of making my own killable sub class. Is it as easy as just making a new class and inheriting from killable?
well I guess I thought it would work better if my damage variables are represented by world variables. but I suppose its not necessary if I'm going to be tweaking the killable or listener code directly, I can just take it from my Hero Class. thank you for quick response. Is there another thread where you explained making subclasses? I don't want to eat up too much of your time if you've already answered that question a billion times. I was a bit overwhelmed by the readme document the first time. I'll figure it out eventually though.
|
|
|
Post by DarkTonic Dev on Jun 11, 2015 22:08:37 GMT
There are 1 or 2 subclass files in the example scenes. You can spot them by "subclass" I'm the filename. You just inherit a class (Killable in your case), and override only virtual methods you want to change. Then add anything else you want too.
Subclasses are not specific to CGK. It's a fundamental aspect of C#. You can google it if you need more info but I've given you the very basics.
|
|
sgwee
New Member
Posts: 7
Currently working on Incremental RPG using Unity and C#
Posts: 7
|
Post by sgwee on Jun 12, 2015 0:08:50 GMT
yeah I understand the basics of it. I haven't had a chance to look into the actual killable class yet, I was wondering if there was some virtual/abstract stuff in there. Good to know. will look at it tonight
|
|
|
Post by DarkTonic Dev on Jun 12, 2015 0:44:08 GMT
Yeah there is tons of virtual stuff to override there. For Triggered Spawners too.
|
|
sgwee
New Member
Posts: 7
Currently working on Incremental RPG using Unity and C#
Posts: 7
|
Post by sgwee on Jun 23, 2015 21:58:55 GMT
Okay got a listener to work that allows dps as soon as it spawns! Now its just a matter of learning the core of using coregamekit, all the levels and waves  thanks for all the hard work and info Right now I'm trying to figure out how to make this wave truly endless, eventually it always seems to stop. I'm probably missing something. will I need to create a listener to get it to reset the wave?
|
|
|
Post by DarkTonic Dev on Jun 23, 2015 22:24:24 GMT
Let's see your global wave setup and spawners wave setup that should be endless. Screen shots please.
No coding should be necessary for that.
|
|