Game Development Community

Integrating Stats and Breaking MaxHealth

by Richard Preziosi · in Torque Game Engine · 04/22/2008 (6:38 pm) · 5 replies

Has anyone been able to successfully integrate these two resources in 1.5.2, I've been able to get the scripted stats working, but unable to get the Breaking MaxHealth to work to where my HP functions will actually work.

Scripted Experience and Attributes System www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13020

Breaking MaxHealth and Energy from the Datablock www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9774

Also in the Breaking MaxHealth resource, it says "Do a global search and replace for mDataBlock->MaxDamage and replace it w/ mMaxDamage". I'm not fimiliar with C++ and that really has nothing to do with this question, but does he mean to search for "mDataBlock->MaxDamage" and replace it with "mDataBlock->mMaxDamage", or to search for "MaxDamage" and replace it with "mMaxDamage". I did the latter of the two, seeing how the first option led to a build failing. Other than that I followed the resources to a perfect "T" to no avail.

Thanks for any and all help.

#1
04/23/2008 (9:41 am)
RE your mDataBlock->maxDamage problem, the author means to search for 'mDataBlock->maxDamage' and replace each instance of that with 'mMaxDamage'. mDatablock is a pointer in each ShapeBase object that refers to it's datablock, so whenever mDataBlock->maxDamage is used, it means 'my datablock's maxDamage value'. mMaxDamage is an object-specific field, so it's saying 'my very own personal mMaxDamage value'.
#2
04/23/2008 (8:21 pm)
Thank you Daniel, will try this momentarily. I'll have to take the resources more literally from now on, i thought it was a typo or the poster being lazy typing just "mMaxDamage". Thank you again.
#3
04/23/2008 (9:20 pm)
Ok i got it to work, or atleast i am assuming, because I have no maxDamage set and my character will take damage before dying, where as he wouldnt' before, he had 0 hp. I still cannot get it to display HP in the "c" statsgui though. It is mentioned in the comments to do the Breaking MaxHealth thing and add "%this.setMaxDamage(maxHP);" to my update attributes and it should work. However it isn't working at all in that sense. Any ideas would be greatly appreciated.
#4
04/23/2008 (9:25 pm)
Ok i just opened game.cs and altered my base attribute for STA = 10; to STA = 50;. Which should give me 500 life, and while jumping from the same spot through various tries I still take just as much damage as i did with STA = 10;. This leads me to believe that it is not working, or that the 2 resources do not work with eachother right out of the box so to speak. So again, any ideas greatly appreciated.
#5
04/24/2008 (9:28 pm)
Anyone have any idea as to why the second resource is not working as is in 1.5.2? Thanks.