Help - Search - Members - Calendar
Full Version: Difficulty Script
RPG RPG Revolution Forums > Scripting > Script Development and Support > Script Requests
BleachBummer
Before I ask, I want to say that if it is impossible or way to difficult to make, I will understand and drop my request.

I was wondering if their could be a difficulty script that gives you an option to pick your difficulty to start the game and modifies the enemies according to the difficulty. And example of this could be like certain stats you pick are halfed on Easy, stay the same on Normal, and doubled on Hard.

Again, if it can't be done, I will understand. I just think it would be cool if it could.
TNinja
I remember there was a dificulty scrip from the KCG. I guess it was called "KCG_BattleDifficulty"?

The script doesn't work alone, and needs some other KCG scripts I recall.
munkis
No, it'll work by itself, the two scripts mentioned in its header are optional.

http://www.rpgrevolution.com/forums/index....showtopic=36210

Or you could use this one:

http://www.rpgrevolution.com/forums/index....showtopic=47514
BleachBummer
QUOTE (munkis @ Jan 6 2012, 04:40 AM) *
No, it'll work by itself, the two scripts mentioned in its header are optional.

http://www.rpgrevolution.com/forums/index....showtopic=36210

Or you could use this one:

http://www.rpgrevolution.com/forums/index....showtopic=47514


OK, I looked at the scripts and am a little confused on trying to figure out how to get them to work as well as how to make each one use only three difficulties?
BleachBummer
Never mind, I figured it out already. My only questions now is why is the HP lowered to 1 when you choose a difficulty?

And is there anyway to make certain events trigger depending what difficulty you are on?

Thanks.
munkis
Sorry for the late reply, but...

QUOTE
why is the HP lowered to 1 when you choose a difficulty?


My difficulty script changes the actor's stats, not the monster's.

CODE
  def base_maxhp
    n = actor.parameters[0, @level]
    n *= $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]]; n /= 100
    return n
  end


That code sets the inital maxHP to whatever the variable is equal to. But since we dividing 100/100, it's set equal to 1.

CODE
  def setup(actor_id)
    munkis_setup(actor_id)
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] = MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[1]
  end


This sets the variable to whatever value you tell it to.

CODE
  def choice_1
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] += 15
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end
  def choice_2
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end
  def choice_3
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] -= 15
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end
  def choice_4
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] -= 30
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end


This part makes any final changes you need to make.

QUOTE
And is there anyway to make certain events trigger depending what difficulty you are on?


Yes there is a way to do that. I think that may be where that random $game_switches line came from, but I'd recommend you use a different switch ID for each difficulty.
BleachBummer
QUOTE (munkis @ Mar 4 2012, 07:34 AM) *
CODE
  def base_maxhp
    n = actor.parameters[0, @level]
    n *= $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]]; n /= 100
    return n
  end


That code sets the inital maxHP to whatever the variable is equal to. But since we dividing 100/100, it's set equal to 1.

CODE
  def setup(actor_id)
    munkis_setup(actor_id)
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] = MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[1]
  end


This sets the variable to whatever value you tell it to.

CODE
  def choice_1
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] += 15
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end
  def choice_2
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end
  def choice_3
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] -= 15
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end
  def choice_4
    $game_switches[MNK_Difficulty_Select::SELECTION_MADE] = true
    $game_variables[MNK_Difficulty_Select::DIFFICULTY_STAT_VAR[0]] -= 30
    Audio.se_play("audio/se/"+MNK_Difficulty_Select::SELECTION_SE,100,100)
    $game_switches[6] = true
    return_scene
  end


This part makes any final changes you need to make.



I see, so in order to change it so it start on Max HP, I just need to make the change to the top part? Or is there a little more than that? If so, can you give an example while I try to see if I can figure it out.

QUOTE (munkis @ Mar 4 2012, 07:34 AM) *
Yes there is a way to do that. I think that may be where that random $game_switches line came from, but I'd recommend you use a different switch ID for each difficulty.


Do you mind giving me an example for using a different swtch ID for each difficulty?
munkis
Sorry for the late reply, but here goes:

QUOTE (BleachBummer @ Mar 10 2012, 09:41 AM) *
I see, so in order to change it so it start on Max HP, I just need to make the change to the top part? Or is there a little more than that? If so, can you give an example while I try to see if I can figure it out.


No, all you need to do is change the second value in this array

CODE
  #[In-game variable id, value]
  DIFFICULTY_STAT_VAR = [4,100]


to whatever you want it to be. This will change all of the non-HECO stats, it won't allow you to only change certain ones.

QUOTE (BleachBummer @ Mar 10 2012, 09:41 AM) *
QUOTE (munkis @ Mar 4 2012, 07:34 AM) *
Yes there is a way to do that. I think that may be where that random $game_switches line came from, but I'd recommend you use a different switch ID for each difficulty.


Do you mind giving me an example for using a different swtch ID for each difficulty?


CODE
$game_switches[n] = true


where n is an in-game switch id, and can be any positive integer. Just look at the "Control Switches" event command to see what I mean.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.