Alright I'm currently using rmxp. I was on rpgrevolution and got some help with a character changer.Basically I wanted to be able to cycle through my other party members and have their character graphic appear on the map by simply pressing the shift button.FoeverZero quickly came up with this code and it works fine.
Now I wanted a way for the game to recognize which character graphic is currently on screen.The reason is because I want some NPCs to have different things to say to the characters depending on who they are talking to and I'm hoping to be able to have puzzles that can only be solved by using specific character's abilities..(Think like Wild Arms).What I thought of was to use switches in conjuntion with my code.For each character their would be a corresponding switch.The code would look at the actor id in the first position of the party.And whoever's id is in that spot the switch will be cut on for that character.This is the code that I came up with.But when I tried it and just doesn't work.
No errors occur when the game starts.But none of the switches are ever activated.I can't figure out why.
Code:
class Game_Map
SHIFT_BUTTON = Input::A
# This is the SHIFT button by default.
alias zer0_party_shift_upd update
def update
zer0_party_shift_upd
if Input.trigger?(SHIFT_BUTTON)
$game_party.actors.push($game_party.actors.shift)
$game_player.refresh
end
end
end
Now I wanted a way for the game to recognize which character graphic is currently on screen.The reason is because I want some NPCs to have different things to say to the characters depending on who they are talking to and I'm hoping to be able to have puzzles that can only be solved by using specific character's abilities..(Think like Wild Arms).What I thought of was to use switches in conjuntion with my code.For each character their would be a corresponding switch.The code would look at the actor id in the first position of the party.And whoever's id is in that spot the switch will be cut on for that character.This is the code that I came up with.But when I tried it and just doesn't work.
Code:
#What I want this one to do is to recognize which character is currently
#on the screen and to activate a switch depending on who it is.
class Game_Party
def whos_who
#Get the ID of the hero in position 0
id = @actors[0].id
#now we check that id and depending on who it is we turn the corresponding
#switch on
#--------------------------------------------------------------------------
#Tamara
#--------------------------------------------------------------------------
if id == 9
$game_switch[10] = true
else
$game_switch[10] = false
end
#-------------------------------------------------------------------------
#Shiro
#-------------------------------------------------------------------------
if id == 1
$game_switch[11] = true
else
$game_switch[11] = false
end
#-------------------------------------------------------------------------
#Rhellik
#-------------------------------------------------------------------------
if id == 7
$game_switch[13] = true
else
$game_switch[13] = false
end
#-------------------------------------------------------------------------
#Demetria
#-------------------------------------------------------------------------
if id == 2
$game_switch[12] = true
else
$game_switch[12] = false
end
#-------------------------------------------------------------------------
#Alicia
#-------------------------------------------------------------------------
if id == 6
$game_switch[14] = true
else
$game_switch[14] = false
end
#-------------------------------------------------------------------------
#Felicia
#-------------------------------------------------------------------------
if id == 5
$game_switch[15] = true
else
$game_switch[15] = false
end
#-------------------------------------------------------------------------
#Caleb
#-------------------------------------------------------------------------
if id == 4
$game_switch[16] = true
else
$game_switch[16] = false
end
#-------------------------------------------------------------------------
#Mina
#-------------------------------------------------------------------------
if id == 3
$game_switch[17] = true
else
$game_switch[17] = false
end
end #for my def
end #for my class