Computer Science Canada

Functions And/Or Processes

Author:  Archi [ Wed Aug 06, 2003 11:37 pm ]
Post subject:  Functions And/Or Processes

I'm wanting to condense my enemy stat type procedure so that I can quickly change it later on.
Right now I have a procedure that gets called before I battle to create the stats. Now, for one of my quests, I'm wanting the enemies to be strong and instead of having to retype each of the enemy stats out with their additions, i was hoping there would be someway i could do it in bulk?

Author:  AsianSensation [ Thu Aug 07, 2003 1:35 pm ]
Post subject: 

huh? what? could you elaborate that please? maybe better sentence structure would help people to understand better?

so from what I gather, (please rephrase the question, it's really hard to understand) You have a procedure that creates all the stats for your enemy before you go into battle.

now for one of your quests.......and then I'm lost

and how does the title relate to this question?

I am so lost.......

This is arguablly worse than trying to understand Dan's messages...At least it was only spelling....

Author:  Archi [ Thu Aug 07, 2003 3:52 pm ]
Post subject: 

lol...OK
I have a procedure which gets called everytime I go into battle. It randomizes the enemies stats based on the players level and such. Well for one quest, I want to make the enemies significantly harder so the quest is harder to accomplish. The way I have things set up now means i'd have ot make a whole new procedure for the quest enemy stats. Is there a way that I can make the enemy stat procedure into a function or something, and when it comes time for the player to participate in the quest, I can make changes to the function as a whole?

Like during the quest I want the enemies to be 1.5 times stronger. Would that be possibile to do if i make the enemy stat randomization procedure into a function?

Author:  rizzix [ Thu Aug 07, 2003 4:14 pm ]
Post subject: 

seriously man i don't understand u at all. if i take what ur saying literally, ur crazy, thats not possible. but obvoiusly ur trying to say something that i can't really figure out what!?

Author:  Archi [ Thu Aug 07, 2003 4:41 pm ]
Post subject: 

Whats not possible??????

Author:  kmd-10 [ Thu Aug 07, 2003 5:57 pm ]
Post subject: 

what i would do is for each stat, i would have a global variable, initialized to 1:
code:

var multiplier : double := 1.0

as the game progressed, i would increment this variable. for example, at the part of the code dealing with your quest, then:
code:

multiplier := 1.5

now, in your procedure, you'll need to use something like this:
code:

randint(attackDamage,3,7)
attackDamage *= multiplier

if you wanted, you could have attackMult, defMult, and so on.
i think that's what you're looking for -- if not, i'll try again. Smile

Author:  AsianSensation [ Thu Aug 07, 2003 7:02 pm ]
Post subject: 

ok, you can just implement a flag, and use if statements

first, generate all the stats

statgenerate (or whatever you call that procedure)

if questflag then

multiply all the stats by 1.5

end if

and keep the flag true for as long as you needed to be

Author:  PaddyLong [ Thu Aug 07, 2003 7:26 pm ]
Post subject: 

or... not have a global variable and have a parameter that you have on each call to the procedure


: