• NOW LIVE! Into the Woods--new character species, eerie monsters, and haunting villains to populate the woodlands of your D&D games.

[RPG] Secrets of the Code

MerricB

Eternal Optimist
Supporter
Gaining Levels

When you gain a level, you gain between 3-15 points in each of HP, MP, STR and DEF. :)

Cheers!
 

log in or register to remove this ad

I believe both Morrus and I have mentioned this in other threads (I know I've mentioned it at least twice) and Morrus has it in the Monster Stats thread at the beginning. :P
 

Heh - how did I miss it? :)

Anyway... there are some really messy bits in this code, but I think I might be able to clean it up greatly. ^_^

Cheers!
 

Remember that tournament we tried running. I've just found this text in the code... "You may not surrender tournament battles". :)

Guess he got that one wrong!

Cheers!
 


:D

Standards? What are they?

Actually, what he needs is to use more functions and procedures... the tournament code is incredible. Vast slabs of code are repeated...

Cheers!
 

One of the tricky points I'm facing at the moment is the XP code. It's an integer between 0 and 100.

Now, it should prove difficult to make that like D&D, however the game uses a template to show your stats - which isn't in the code Morrus sent me - and that assumes a value between 0 and 100 for XP.

At least, I think that's how it works. The code's messy! :)

Oh, by the way... I've worked out a way to fix the bank and job timers so that if you don't check your daily job for 3 days, you get paid three times. :D

Cheers!
 

Yeah, definitely, like placing comments consistantly BEFORE or AFTER the bit they refer to not at random locations somewhere nearby.
 

MerricB said:
One of the tricky points I'm facing at the moment is the XP code. It's an integer between 0 and 100.

Now, it should prove difficult to make that like D&D, however the game uses a template to show your stats - which isn't in the code Morrus sent me - and that assumes a value between 0 and 100 for XP.

Alright, given the above, since the interface is a template which assumes 0 to 100, why not create a method that returns a value from 0 to 100? I realize that he didn't use methods (functions) in his code originally, so you'll have to do it awkwardly, but it should be easy to have the variable returned be a number from 0 to 100 and have the "real" number for level ups be based on the actual information.

That way theres no need to edit the template, you just need to declare new variables and have the 0 to 100 value "just" be the value returned to the template. Wouldn't that work?

Edit:

Alright, assuming since this program doesn't use methods that the template just reads exp for it's display (0 to 100), then here is what I would do (supposing this would work, correct me where I'm wrong). First, leave the exp variable initialized, and delete all use of exp and replace it with the method "SetExperience". SetExperience will be called for when every instance of "gain 1 to 5 exp) occurs in the code, except that SetExperience uses our rules instead of the games current rules. When SetExperience is called, it should edit the current characters experience (a new variable) unless it is a creature, in which case nothing happens. Once this is done (and that's the most difficult part, finding all of the instances and properly changing them), and the method is finished, include in the method have the old exp variable equal (experience/experience needed to level up). This way, every time experience is updated, the exp variable (0 to 100) is updated to display the % (rounded to an integer).
 
Last edited:

MerricB said:
Standards? What are they?

Depends on which standards you subscribe to. My uni uses the same standards as Kalanyr's, I think, but I don't know what they are called. I know there are different sets of rules from different lines of thought, but the ones I've been taught are for both programming and for designing an algorithm. They are just rules for commenting, formatting your code, and details like the order to put methods and classes into (highest to lowest basically).
 

Into the Woods

Remove ads

Top