Chdonga
Pixel Artist/Spriter
- 24
- Posts
- 13
- Years
- Newgrounds
- Seen Dec 2, 2022
I'm trying to make a difficulty mode that uses a variable. Since global switches will always be seen as false according to the wiki.
This is the outcome I want:
Battle:
Storage:
These are the changes I've made to the scripts (highlighted):
PokeBattle_Battle
Line 1242
Pokemon_Storage
Line 186
Line 206
PScreen_PokemonStorage
Line 1729
Line 1759
It doesn't seem to matter what I change the value to. It doesn't seem to matter if I change it to "if... == 2" or "if... = 2". The game always treats the value like it's set to 2. And I'm not that sadistic. How do I fix this?
This is the outcome I want:
Battle:
- If variable 14 = 2, Set battle style
- If variable 14 = 1, Switch battle style, but it won't tell you the opponent's next Pokemon.
- If variable 14 = 0, normal Switch battle style.
Storage:
- If variable 14 = 2, Pokemon won't be healed when you place them in a box, and something you just caught won't get healed when it gets sent to storage.
- If variable 14 != 2, then it's a normal storage system.
These are the changes I've made to the scripts (highlighted):
PokeBattle_Battle
Spoiler:
Line 1242
Code:
if [S-HIGHLIGHT]!$game_variables[014]==2[/S-HIGHLIGHT] && firstbattlerhp>0 && @opponent &&
@internalbattle && pbCanChooseNonActive?(0) && pbIsOpposing?(index) &&
@battlers[0].effects[PBEffects::Outrage]==0
[S-HIGHLIGHT] if $game_variables[014]==1
pbDisplayPaused(_INTL("{1} is about to send in a new Pokémon.",opponent.fullname,pbParty(index)[newenemyname].name))[/S-HIGHLIGHT]
else
[S-HIGHLIGHT] if $game_variables[014]==0[/S-HIGHLIGHT]
pbDisplayPaused(_INTL("{1} is about to send in {2}.",opponent.fullname,pbParty(index)[newenemyname].name))
if pbDisplayConfirm(_INTL("Will {1} change Pokémon?",self.pbPlayer.name))
newpoke=pbSwitchPlayer(0,true,true)
if newpoke>=0
newpokename=newpoke
if isConst?(@party1[newpoke].ability,PBAbilities,:ILLUSION)
newpokename=pbGetLastPokeInTeam(0)
end
pbDisplayBrief(_INTL("{1}, that's enough! Come back!",@battlers[0].name))
pbRecallAndReplace(0,newpoke,newpokename)
switched.push(0)
end
end
end
[S-HIGHLIGHT] end
end[/S-HIGHLIGHT]
Pokemon_Storage
Spoiler:
Line 186
Code:
pkmn = self[boxSrc,indexSrc]
if !pkmn
raise "Trying to copy nil to storage"
end
[S-HIGHLIGHT] if $game_variables[014]= 2 #Don't Heal Boxed Mons
pkmn.heal
end [/S-HIGHLIGHT]
pkmn.formTime = nil if pkmn.respond_to?("formTime") && pkmn.formTime
self[boxDst,indexDst] = pkmn
end
return true
end
Line 206
Code:
def pbMoveCaughtToBox(pkmn,box)
for i in 0...maxPokemon(box)
if self[box,i]==nil
if box>=0
[S-HIGHLIGHT] if $game_variables[014] = 2 #Don't Heal Boxed Mons
pkmn.heal
end[/S-HIGHLIGHT]
pkmn.formTime = nil if pkmn.respond_to?("formTime") && pkmn.formTime
end
self[box,i] = pkmn
return true
end
end
return false
end
PScreen_PokemonStorage
Spoiler:
Line 1729
Code:
if box>=0
[S-HIGHLIGHT] if $game_variables[014] = 2 #Don't Heal Boxed Mons
@heldpkmn.heal
end[/S-HIGHLIGHT]
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime") && @heldpkmn.formTime
end
@scene.pbPlace(selected,@heldpkmn)
@storage[box,index] = @heldpkmn
if box==-1
@storage.party.compact!
end
@scene.pbRefresh
@heldpkmn = nil
end
Code:
if box>=0
[S-HIGHLIGHT] if $game_variables[014] = 2 #Don't Heal Boxed Mons
@heldpkmn.heal
end[/S-HIGHLIGHT]
@heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime") && @heldpkmn.formTime
end
It doesn't seem to matter what I change the value to. It doesn't seem to matter if I change it to "if... == 2" or "if... = 2". The game always treats the value like it's set to 2. And I'm not that sadistic. How do I fix this?
Last edited: