Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Atk, PDef, MDef level up
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Tired of being completely defenseless if you forget to equip your characters? Do you miss the days where you could have monk characters that don't wear equipment but still do damage? Have you perhaps sworn off equipment completely, but still want to be able to dish it out as well as take it? Well, worry no more. With some editting, Attack Power, Physical Defense, and Magic Defense will all raise along with your levels, just like HP, Strength and the rest.

First, in Game_Actor, go under 'def base_atk', 'def base_pdef', and 'def base_mdef' and, anywhere BEFORE the 'return', create a variable called 'char_atk', 'char_pdef', and 'char_mdef' for each one respectively. Have each equal 0.

Now, below your newly created variable, create a series of 'if' statements according to the ID of the hero. That is, 'if @actor_id == [actor_id]', where actor_id in brackets is a number. So @actor_id == 1 means Actor #001 in the Database; usually Aluxes, or Arshes depending on which version you have. You must do this with *EACH* character you have, so this could get very tiring if you have a lot of characters.

Anyway, under that if statement, we will change the char_[statname] variable -- with '[statname]' being atk, pdef, or mdef -- with the character's level and whatever you want to do with it. In my case, it's

char_[statname] = @level * [number] + [another number]

or

char_[statname] = @level * ([number / number]) + [another number]

Whatever. Heck, if yuo have a low-stat type of game, you can even have the character's attack simply equal their level. Basically, put whatever formula you want, but make sure you involve the character's level in there or the stat will never level up.

After you've done that, in the return method you add char_[statname]. BUT it's a little different with 'base_atk'; that part that goes 'weapon != nil ? weapon.atk : 0' - it *MUST* be wrapped around in parenthesis or things will mess up. After that, insert '+ char_atk'.

So basically:

char_[statname] = 0
if @actor_id == [actor_id]
char_[statname] = @level * 5, or whatever you have here.
elsif @actor_id == [actor_id], and so on.
end
return (weapon != nil ? weapon.atk : 0) + char_atk
OR
return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + char_pdef (for magic defense, just replace pdef with mdef)


And if you still don't get it, or want to see how it works for yourself, start a new project, and replace Game_Actor with this:

Code


EDIT: I'm sure this could have been done with alias but I don't know how exactly to use it yet. Maybe I can figure it out. (EDIT2: Nope, guess not.) Scratch that, thanks to help in RMXP.org now I know how to alias. :clap:

EDIT3: Just realized I didn't need a series of if statements for @actor_id, just use a case statement. Ah well, I think y'all know how to do that, too.
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Level Up system Jimmie 0 2,288 07-24-2006, 01:00 PM
Last Post: Jimmie
  Gameover based on Level ember2inferno 0 1,946 07-20-2006, 01:00 PM
Last Post: ember2inferno
  Level Up Box and Equipment Skills TsengTsuzaki 0 2,088 05-24-2006, 01:00 PM
Last Post: TsengTsuzaki
  Change Level/Exp/Status name ryujijitei 0 2,037 04-29-2006, 01:00 PM
Last Post: ryujijitei
  Enemies Level UP and Game Difficulty Options Combined DrakoShade 0 2,110 03-27-2006, 01:00 PM
Last Post: DrakoShade
  Enemies that Level Up SephirothSpawn 0 2,155 11-17-2005, 01:00 PM
Last Post: SephirothSpawn



Users browsing this thread: