Fires of Heaven Guild Message Board  

Go Back   Fires of Heaven Guild Message Board > Fires of Heaven Related Forums > Uberworlds Development Forum
User Name
Password
ForumSpy Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 03-27-2008, 05:35 AM   #76 (permalink)
devoir
Registered User
 
Join Date: Apr 2007
Posts: 16
+0 Internets
I would be dead happy if tomorrow I could be coding XNA games and tools in C# for game development. I guess I could be in a couple of years if I really got my act together, but I get paid well for doing what I do now so taking a paycut to do game development is not a super attractive proposition. At the very least I'll be keeping an eye on your project, all the concepts that you've pulled together in such a short time is really quite impressive, while trying to fit my own brushing up of skills in somewhere.

You could probably even write a book yourself after a few more months on how to learn basic XNA2.0 and C# concepts from scratch
devoir is offline   Reply With Quote
Old 03-27-2008, 04:49 PM   #77 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
How do you make a while loop exit if one of variables meets a criteria? or just make a program exit entirely from within the while loop?

nevermind, break; it is.

Last edited by Saban : 03-27-2008 at 04:51 PM.
Saban is offline   Reply With Quote
Old 03-27-2008, 05:15 PM   #78 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
So actually sitting down and making your own text rpg as soon as you learn the most basic things makes it so much more fun.

So far i've got the most basic fight against the player and an npc, 3 command options and crit system.

next up, refining my code and making more sensible loops.
Saban is offline   Reply With Quote
Old 03-27-2008, 05:41 PM   #79 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
Quote:
Originally Posted by Saban View Post
So actually sitting down and making your own text rpg as soon as you learn the most basic things makes it so much more fun.

So far i've got the most basic fight against the player and an npc, 3 command options and crit system.

next up, refining my code and making more sensible loops.
Yeah thats how I learned, and it makes things MUCH more interesting. Once you learn a concept, plug it in!

good example, when you learn about for loops, make an exp table that uses arrays.

for (int i = 0; i < (iMaxLevel + 1); i++)
{
int exp; //declares the exp variable

exp = i * 350; //sets the amnt of exp needed for that level
iExpTable[i] = exp; //fills in the exp table with the exp needed
}//end Exp Table

You just did in 6 lines of code, what i used to do in 60 (with 60 levels in my game) ... simple

foreach is another great one
Cloud9_ is offline   Reply With Quote
Old 03-27-2008, 05:54 PM   #80 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
i'm more interested in making a decent combat system that can call in new enemies instead of having the program exit after i win or lose against by single opponent, and have a couple classes too.

All in due time.
Saban is offline   Reply With Quote
Old 03-27-2008, 05:56 PM   #81 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
You're already making a more complex text RPG then I made Mine was just an elaborate character generation system.
Cloud9_ is offline   Reply With Quote
Old 03-27-2008, 06:54 PM   #82 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
is there no "or"?

like,

if (x >= 1) or (x <= 18)

apparently its ||?

Last edited by Saban : 03-27-2008 at 07:03 PM.
Saban is offline   Reply With Quote
Old 03-27-2008, 07:02 PM   #83 (permalink)
Cynno
Registered User
 
Join Date: Jun 2005
Posts: 520
-8 Internets
I'm gonna assume it's like other programming languages and say...

if(X>10) || (x<20)
Then Do some crazy batman swinging superman punch!
Cynno is offline   Reply With Quote
Old 03-27-2008, 07:05 PM   #84 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
Yea, but i'm still having this problem, i have 3 if's, one for if crit is above 17, one if crit is 1 for critical fails, and an if for anything in between. the problem is when i crit or critically fail, the if for the normal damage still goes.

every time i try to stick an else or something in there, compiler shits a brick.

Spoiler Alert, click show to read:

if (command == "Attack")
{
//damage is random 1 to 6, crit is 1 to 20, anything over 17 is a crit for double damage
damage = (int)(basedamage.NextDouble() * 6) + 1;
crit = (int)(critchance.NextDouble() * 20) + 1;
Console.WriteLine("crit chance = {0}", crit);
//if statement for crits
if (crit >= 17)
{
critdamage = (damage * 2);
Console.WriteLine("Critical Hit, you deal {0} Damage!", critdamage);
goblin = (goblin - damage);
}
// critical failure procedure
else if (crit == 1)
{
Console.WriteLine("Critical Failure, you stab yourself in the testicle");
health = (health - damage);
Console.WriteLine("You stab yourself for {0} damage", damage);
Console.WriteLine("you now have {0} health left", health);
}
//else statement if no crits
else
{
Console.WriteLine("You deal {0} Damage to the Goblin", damage);
goblin = (goblin - damage);
}
// goblins damage turn, standard 1 to 6 random damage, no crit table
Console.WriteLine("Goblin has {0} health left", goblin);
goblindamage = (int)(basedamage.NextDouble() * 6) + 1;
health = (health - goblindamage);
Console.WriteLine("Goblin deals {0} damage to you", goblindamage);
Console.WriteLine("you have {0} health left", health);
Console.WriteLine();
Console.WriteLine();
}


oh ho ho fixed it.

Last edited by Saban : 03-27-2008 at 07:16 PM.
Saban is offline   Reply With Quote
Old 03-27-2008, 07:18 PM   #85 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
have you tried 'stepping through' to see what everything is doing, line by line?

goto the 'if attack' line, hit f9, Run... it will stop there... just keep hitting f11 (or the 'step into' button) and go through it line by line.
Cloud9_ is offline   Reply With Quote
Old 03-27-2008, 07:21 PM   #86 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
ah, there we go, this solved my next problem too.

So many {} brackets sitting around, one of my if's got buried a little deep.

Last edited by Saban : 03-27-2008 at 07:27 PM.
Saban is offline   Reply With Quote
Old 03-27-2008, 07:42 PM   #87 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
yeah in the section im currently writing, i have a LOT of {}'s Once i have it working I'm going to try and re-work it so I dont have as many crazy statements.
Cloud9_ is offline   Reply With Quote
Old 03-27-2008, 08:40 PM   #88 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
I need to learn how to call functions so i can make my main a little less hueg.
Saban is offline   Reply With Quote
Old 03-27-2008, 09:01 PM   #89 (permalink)
Cloud9_
Registered User
 
Join Date: Jul 2002
Location: Los Angeles California
Posts: 228
+9 Internets
Send a message via ICQ to Cloud9_
what do you mean? whats tripping you up?
Cloud9_ is offline   Reply With Quote
Old 03-27-2008, 09:03 PM   #90 (permalink)
Saban
Registered User
 
Join Date: Dec 2003
Posts: 1,978
+15 Internets
Well, nothing really. It's just i find my code to be cleaner if i can call functions instead of having a really huge main().

So say i need to have a combat resolved, instead of copy/pasting the combat code i can just call a function that resolves it.
Saban is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
uberguilds network



All times are GMT -7. The time now is 05:26 PM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6