|
-
March 12th, 2009, 08:52 AM
#1
[RESOLVED] How to make debug messages
Is there a way to send messages to error box or something. I have some steps in a method that sends feedback to a textbox. The problem is this part
Code:
//If parryroll was greater than their ParrySkill then they failed
if (parry == true) //parry ability true, opponent can Parry!
{
parryrate = parrySkillOpponent; //Opponent's skill in Parry
Random randParry = new Random();
parryroll = Math.Abs(randParry.Next(1, 100));
if (parrySkillOpponent < parryroll)
{
never seems to happen, even when I set parrySkillOpponent over 100.
(BTW) The Parry skill is enabled true by a check box. Maybe I am not correctly checking if the checkbox has been checked? If so what is the correct way to check if a Checkbox has been checked?
Last edited by bixel; March 12th, 2009 at 09:04 AM.
-
March 12th, 2009, 09:02 AM
#2
Re: How to make debug messages
I don't understand what you're saying. parryroll is always between 1 and 100. If you set parrySkillOpponent over 100, how can you expect that something that is greater than 100 be actually less? So of course the second if always evaluates to false.
Instead of looking for hacks, you better debug an analyze your code, see what the actual problems are.
-
March 12th, 2009, 09:09 AM
#3
Re: How to make debug messages
Ohhhh!! I didnt see that hahahaha
-
March 12th, 2009, 09:19 AM
#4
Re: How to make debug messages
Oh wait! That was not my full code. I DO check to see if ParrySkill was greater, and yet it still never seems to happen.
Code:
//Parry Ability true?
if (parry == true)
{
parryrate = parrySkillOpponent;
Random randParry = new Random();
parryroll = Math.Abs(randParry.Next(1, 100));
if (parrySkillOpponent < parryroll)
{
blockedFlag = false; //JUST TO MAKE SURE
if (attackrolled >= armorRatingOpponent)
{
armorFlag = false;
totaldamage = damage;
}
else
{
//Armor Blocked!!
armorFlag = true;
totaldamage = damage / 2;
}
}
// THEY PARRIED!!!
else if (parrySkillOpponent > parryroll)
{
#region //Counter Attack or no?
#endregion
totaldamage = damage / 3;
blockedFlag = true; //They Parried!
}
-
March 12th, 2009, 09:55 AM
#5
Re: How to make debug messages
FOUND THE PROBLEM!!!!
my report function needed an extra catch, Parry was enabled and was used, but the report was getting re-written - so it never gave a report on whether there was a Parry or not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|