Computer Science Canada

EoE - Help Thread

Author:  .hack [ Sat Feb 21, 2004 5:54 pm ]
Post subject:  EoE - Help Thread

I'm making an RPG for my end opf the year project. Right now I am just working out the different character properties.

For now, its going to be rather small, so I made it so the class gets 5 weapons total, throughout the game. Should I create the weapons as Records?

here is an Example.

var reDarkHalo
record
HPMod: int := 0
MPMod: int := 0
StrMod: int := 10
DefMod: int := 0
MagAMod: int := 0
MagDMod: int := 0
EvadeMod: int := 0
LuckMod: int := 0
ExpMod: int := 0
end record


I also noticed you can't set values for the variables in the record, which peeves me, is there any way I can do this (like how it has StrMod : int := 10. Can I set a value without it giving me an error?

And should I continue using records for each weapon data.

Author:  Cervantes [ Sat Feb 21, 2004 6:00 pm ]
Post subject: 

records are good. Definately use them. They aren't hard to learn and you gotta learn them sometime, so might as well Smile

if all those Mod's that you have there are for one weapon, you're going to have a lot of variables. Another thing you could do is make those an array, and comment which element of the array is what.

Author:  BioHazardousWaste [ Sat Feb 21, 2004 10:25 pm ]
Post subject: 

What is EoE, the name of your game or something?

Yes... you should definetaly make an array of a record, or you will have way the hell too many variables.

Author:  Delos [ Sun Feb 22, 2004 11:43 am ]
Post subject: 

Records are the way to go...for sure.

But...

Instead of just plain records...go for types, thus ways you can at least make arrays. You'll need those for the multitude of chars you may have...

code:

type rpgChar:
record
name : string
type : string
minHP : int
maxHP : int
moveList : array 1..5 of string
movePwr : array 1..5 of int
end record

var randomChar : array 1..10 of rpgChar

% initialize here...
% eg
% randomChar(1).name := "Muwahaha"
% Etc...maybe use a for loop for the numbers parts.



There...have fun...good luck.


: