User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Game Development section within the Software Development category of DaniWeb, a massive community of 402,652 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,164 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Game Development advertiser: Programming Forums
Views: 402 | Replies: 1 | Solved
Reply
Join Date: Apr 2008
Posts: 6
Reputation: Raptoricus is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Raptoricus's Avatar
Raptoricus Raptoricus is offline Offline
Newbie Poster

Text RPG damage

  #1  
Apr 18th, 2008
hi all, this is the same game (if you can call it that yet) that I asked for help with last time (but I sorted it out myself) this time the problem is getting hp off of a monster/character in the combat header Ive already got a damage function that works out how much hp to take off, and wether its a critical hit, the problem is that they are all in different headers and I cant get the referance function to work properly (I think) the fuction that Im tring to get to work is in comment so it will compile anyway. any help appreciated
PS same as last time, to view the files, right click save as, otherwise they dont seem to work!!!
Last edited by Raptoricus : Apr 18th, 2008 at 6:34 pm. Reason: Dodgy links (again :( )
Attached Files
File Type: txt main.cpp.txt (1.8 KB, 10 views)
File Type: txt character.h.txt (1,018 Bytes, 6 views)
File Type: txt monster.h.txt (994 Bytes, 7 views)
File Type: txt combat.h.txt (1.4 KB, 7 views)
"If the facts don't fit the theory, change the facts." Albert Einstein
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 6
Reputation: Raptoricus is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Raptoricus's Avatar
Raptoricus Raptoricus is offline Offline
Newbie Poster

Re: Text RPG damage

  #2  
Apr 21st, 2008
Ive done it again , kindof a noobie error problem 1:
didnt make a takeHP function in monster class
2: After I did I had some learning to do about how to add new variables into an existing function

in conclusion:

made function: takeHP2(int amount){setHP2()-amount};
//set hp sets a new amount of hp
then used it like so in combat function:
takeHP2(amount); //Id already worked out a damage amount function

hope some of my self solved posts help some people sometime, its been a learning experience for me
"If the facts don't fit the theory, change the facts." Albert Einstein
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Game Development Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Game Development Forum

All times are GMT -4. The time now is 3:17 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC