View Full Version : [Pokéstarter Kit - Question]: Pokémon following character
ArthurMaker
June 27th, 2009, 05:11 PM
Hello!
I have a question.
I would like to know how to do it for a selected menu of Pokémon Pokemons walk behind the Hero / Heroine, as in the remake.
Example:
You Take the option on when I select a Pokémon on my team in the Menu of pokemons. Next select the option and leave the menu. The Pokémon commeça selected me to follow. When I do not want to follow me no more Pokémon, I pokemons from the menu again and choose a Pokémon who is walking behind me. Instead of appearing to follow option now appears not to follow. Select this option, leave the menu disappears and the Pokémon back to the Hero / Heroine.
I ask for you to help me solve this question.
Thanks already!
Goodbye!
Alexandre
June 27th, 2009, 11:54 PM
First, this question doesn't require a new thread. Post all questions regarding the starterkit in the Starterkit thread. Second, the following the character thing is fairly easy to do in events.However all the "caterpillar" scripts out there for rmxp will not work with Essentials due to the fact that Essentials doesn't use the basic actor calls, etc.
ArthurMaker
June 28th, 2009, 02:26 PM
Hum .. Sorry, did not know ...
But still, someone can solve my question?
Note: I will post my question on the topic.
tImE
June 28th, 2009, 03:01 PM
First, this question doesn't require a new thread. Post all questions regarding the starterkit in the Starterkit thread. Second, the following the character thing is fairly easy to do in events.However all the "caterpillar" scripts out there for rmxp will not work with Essentials due to the fact that Essentials doesn't use the basic actor calls, etc.
Actually, since late 2008, they changed the dependent-event script in Pokemon Essentials.
A dependent-event can now follow you outside of the map.
About how to make a menu on the pokemon party screen I don't know, xP
I'm a RGSS Newbie, lol
//44tim44
Alexandre
June 28th, 2009, 11:13 PM
Actually, since late 2008, they changed the dependent-event script in Pokemon Essentials.
A dependent-event can now follow you outside of the map.
About how to make a menu on the pokemon party screen I don't know, xP
I'm a RGSS Newbie, lol
//44tim44
I know that, but it is still a partner, and it enters battle with you, I suppose that can be fixed with a bit of scripting, but IMO its too much hassle.
tImE
June 29th, 2009, 11:50 AM
I know that, but it is still a partner, and it enters battle with you, I suppose that can be fixed with a bit of scripting, but IMO its too much hassle.
No, it only adds a partner if you want to.
Check this:
pbAddDependency2(@event_id,"Brawly",2)
pbRegisterPartner(PBTrainers::LEADER_Brawly,
"BRAWLY")
pbAddDependency2(@event_id,"Brawly",2) adds a follower.
pbRegisterPartner(PBTrainers::LEADER_Brawly,"BRAWLY") adds a partner trainer.
If you only use the first one, then you can sort of have a Ash-Pikachu follow event.
venom12
June 29th, 2009, 02:42 PM
You can just add this
pbAddDependency2(@event_id,"Brawly",2)
Change "Brawly" to yours pokemon id and pokemon will follow you
ArthurMaker
June 29th, 2009, 04:55 PM
This does not ...
I found a bug when I tested.
The hero / heroine can not use the surf ...
Somebody help me!
Alexandre
June 30th, 2009, 01:08 AM
You can just add this
pbAddDependency2(@event_id,"Brawly",2)
Change "Brawly" to yours pokemon id and pokemon will follow you
Yeah, but this still causes a problem with the fact that you need an event on each map :/
Surf
June 30th, 2009, 01:09 AM
You don't need the event on another map, it's a common event.
Alexandre
June 30th, 2009, 08:17 AM
You don't need the event on another map, it's a common event.
Oh. I learnt something today :D
Shadow-Lucario
October 25th, 2009, 04:36 PM
i keep getting this error when i try this
---------------------------
Pokemon Shadow Aura
---------------------------
Exception: RuntimeError
Message: Script error within event 8, map 8 (Pallet Town):
(eval):2:in `pbExecuteScript'compile error
(eval):2: syntax error
(@event_id,"Brawly",2)
^
***Line '(@event_id,"Brawly",2)' shouldn't begin with '(', try putting '(' at
the end of the last line
***Full script:
pbAddDependency2
(@event_id,"Brawly",2)
Interpreter:258:in `pbExecuteScript'
Interpreter:1652:in `command_355'
Interpreter:496:in `execute_command'
Interpreter:190:in `update'
Interpreter:104:in `loop'
Interpreter:195:in `update'
Scene_Map:100:in `update'
Scene_Map:98:in `loop'
Scene_Map:111:in `update'
Scene_Map:67:in `main'
This exception was logged in errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
and what do you mean by the pokemons ID?
Vaskituh
October 26th, 2009, 05:41 PM
Plus the thing is, even with we do use the Dependency, we still need a Menu that lets us choose our partner, or that it automatically goes grab the current sprite of the First Pokemon on the Team. We already got the Sprites thanks to a Rip from HGSS, but we still need the Script.
Someone please help ?
Maruno
October 27th, 2009, 03:53 PM
i keep getting this error when i try this
---------------------------
Pokemon Shadow Aura
---------------------------
Exception: RuntimeError
Message: Script error within event 8, map 8 (Pallet Town):
(eval):2:in `pbExecuteScript'compile error
(eval):2: syntax error
(@event_id,"Brawly",2)
^
***Line '(@event_id,"Brawly",2)' shouldn't begin with '(', try putting '(' at the end of the last line
***Full script:
pbAddDependency2
(@event_id,"Brawly",2)
Interpreter:258:in `pbExecuteScript'
Interpreter:1652:in `command_355'
Interpreter:496:in `execute_command'
Interpreter:190:in `update'
Interpreter:104:in `loop'
Interpreter:195:in `update'
Scene_Map:100:in `update'
Scene_Map:98:in `loop'
Scene_Map:111:in `update'
Scene_Map:67:in `main'
This exception was logged in errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
and what do you mean by the pokemons ID?
Your script currently looks like:
pbAddDependency2
(@event_id,"Brawly",2)As the error message suggests, try moving the open brackets to the end of the first line, like so:
pbAddDependency2(
@event_id,"Brawly",2)A pokémon's ID is the index number it has. For example, in a default game, Bulbasaur is 001, Ivysaur is 002, Pikachu is 025, Arceus is 493, etc.
jackofalltrades
November 19th, 2009, 06:30 PM
hmm this seems interesting enough. I like the idea of having the option of having it follow or not, but for my script i'd need it a bit more specific... ie one event pokemon would have the option to follow
SpawnHyuuga
November 20th, 2009, 01:14 AM
So what if we don't have that specific pokemon? Will the script check for it? I have to admit this is awesome if this will work, but how do we make it so the game behaves like normal all HM's usable, unable to follow if it's not present in the party? or ability to have the first slot only follow, this small code snippet confuses me.
Meowth
November 20th, 2009, 08:34 AM
The problem with this script, and I have it in MSB and you can try it yourself, is that the following pokemon is glitchy. If you run, it lags behind and will run through buildings if you go far enough ahead and turn.
Also, it likes to hop over event tiles, even if nothing's active on it.
jackofalltrades
November 21st, 2009, 03:16 AM
The problem with this script, and I have it in MSB and you can try it yourself, is that the following pokemon is glitchy. If you run, it lags behind and will run through buildings if you go far enough ahead and turn.
Also, it likes to hop over event tiles, even if nothing's active on it.
thats definatly not good lol
Meowth
November 21st, 2009, 03:28 AM
Indeed. Only Peter himself could work up a real caterpillar script that functions with his pokemon system, since he knows his own code.
help-14
November 23rd, 2009, 04:51 AM
In PokemonScreen Find: (line 1300)
if cmdSummary>=0 && command==cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdSwitch>=0 && command==cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid=pkmnid
pkmnid=@scene.pbChoosePokemon(true)
if pkmnid>=0 && pkmnid!=oldpkmnid
pbSwitch(oldpkmnid,pkmnid)
end
Add Below
#Pokemon Following Character by Help-14
pbMoveRoute($game_map.events[004],[
PBMoveRoute::Graphic,@party[0].name.to_s+".png",0,2,0
])
Kernel.pbRemoveDependency2("Dependent")
Kernel.pbAddDependency2(004, "Dependent", 3)
#Pokemon Following Character by Help-14
Dependent: Name of Dependent event
004: ID of Dependent event
3: Number of Common Event when you talk to it
Extract this to Graphics Folder: mediafire.com/?0lvu4zbnuzg
Done ! When you change the first Pokemon, Dependent event will change graphic
SpawnHyuuga
November 23rd, 2009, 04:01 PM
In PokemonScreen Find: (line 1300)
if cmdSummary>=0 && command==cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdSwitch>=0 && command==cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid=pkmnid
pkmnid=@scene.pbChoosePokemon(true)
if pkmnid>=0 && pkmnid!=oldpkmnid
pbSwitch(oldpkmnid,pkmnid)
end
Add Below
#Pokemon Following Character by Help-14
pbMoveRoute($game_map.events[004],[
PBMoveRoute::Graphic,@party[0].name.to_s+".png",0,2,0
])
Kernel.pbRemoveDependency2("Dependent")
Kernel.pbAddDependency2(004, "Dependent", 3)
#Pokemon Following Character by Help-14
Dependent: Name of Dependent event
004: ID of Dependent event
3: Number of Common Event when you talk to it
Extract this to Graphics Folder: mediafire.com/?0lvu4zbnuzg
Done ! When you change the first Pokemon, Dependent event will change graphic
So if I follow these exact steps, I get caterpillar? *goes to try it* Anything else we need to know. Extreme credits to you if it works!
Crazyninjaguy
November 23rd, 2009, 04:08 PM
Oh my...
That my friend is amazing!
Who knew it could be made with just 4 lines of code!
This is going in my game for sure, i'll be sure to add you in the credits list :)
SpawnHyuuga
November 23rd, 2009, 04:18 PM
Help-14, you wouldn't happen to know how to make like an "options" event where the player can set how many poke'mon to have following them. Like maybe one player wants 1, another wants 3, and another doesn't want any...
Also, how do I make it so the sprite, doesn't sit at the plot and make the point more obscure where it can't be seen? Just extend the map sizes a little and make it like (1,0,0)
BTW: Thanks you VERY much for the overworld pokemon sprites. I've been looking for like a year now and haven't found anything!
Meowth
November 23rd, 2009, 06:45 PM
In PokemonScreen Find: (line 1300)
if cmdSummary>=0 && command==cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdSwitch>=0 && command==cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid=pkmnid
pkmnid=@scene.pbChoosePokemon(true)
if pkmnid>=0 && pkmnid!=oldpkmnid
pbSwitch(oldpkmnid,pkmnid)
end
Add Below
#Pokemon Following Character by Help-14
pbMoveRoute($game_map.events[004],[
PBMoveRoute::Graphic,@party[0].name.to_s+".png",0,2,0
])
Kernel.pbRemoveDependency2("Dependent")
Kernel.pbAddDependency2(004, "Dependent", 3)
#Pokemon Following Character by Help-14
Dependent: Name of Dependent event
004: ID of Dependent event
3: Number of Common Event when you talk to it
Extract this to Graphics Folder: mediafire.com/?0lvu4zbnuzg
Done ! When you change the first Pokemon, Dependent event will change graphic
Wow, that's awesome! Only problem I see is when turning certain ways, the second character behind jumps a lot. (when two pokemon are behind, such as would happen in MSB)
Vaskituh
November 23rd, 2009, 06:56 PM
In PokemonScreen Find: (line 1300)
if cmdSummary>=0 && command==cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdSwitch>=0 && command==cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid=pkmnid
pkmnid=@scene.pbChoosePokemon(true)
if pkmnid>=0 && pkmnid!=oldpkmnid
pbSwitch(oldpkmnid,pkmnid)
end
Add Below
#Pokemon Following Character by Help-14
pbMoveRoute($game_map.events[004],[
PBMoveRoute::Graphic,@party[0].name.to_s+".png",0,2,0
])
Kernel.pbRemoveDependency2("Dependent")
Kernel.pbAddDependency2(004, "Dependent", 3)
#Pokemon Following Character by Help-14
Dependent: Name of Dependent event
004: ID of Dependent event
3: Number of Common Event when you talk to it
Extract this to Graphics Folder: mediafire.com/?0lvu4zbnuzg
Done ! When you change the first Pokemon, Dependent event will change graphic
Mate i get this error when trying your script.
http://img99.imageshack.us/img99/6865/pokewi.jpg
What can i do ?
Shikamaru88
November 23rd, 2009, 07:55 PM
The catapiller script posted is easy to do if you study ruby you'll know that you guys should try reading beginners articles, books and/or tutorials ruby is easy to learn and quite fun too... and the menu thing i dont quite get what your asking: are you asking, for a menu that allows you to change the pokemon following you? or are you asking for a switch to chose when the pokemon is following you and when he is not. if you want the switch that doesnt require a script but will require you add alot of events, but scripting is always less work in the end. And FYI anyone can script n improve policci's starter kit, its not perfect but it is stable n basically everything you need to make a standard pokemon game...
ayevdayev
November 23rd, 2009, 08:51 PM
my pokemon walks behind the dependent event how do i make it walk on the dependent event?
help-14
November 24th, 2009, 04:24 AM
Mate i get this error when trying your script.
http://img99.imageshack.us/img99/6865/pokewi.jpg
What can i do ?
Did you make a dependent event before change first pokemon ?
Vaskituh
November 24th, 2009, 08:31 AM
Yeah, anyway it only happens when i try to change the pokemon inside a house for some reason
poccil
November 24th, 2009, 11:12 AM
The way dependent events are implemented, the events are not added to the map's event array but rather stored in an internal array. I've improved the dependent events system in the current version and added the following function:
pbGetDependency(name) - Returns a Game_Character object associated with the dependent event with the given name. Returns nil if the dependent event doesn't exist.
Meowth
November 24th, 2009, 07:40 PM
The way dependent events are implemented, the events are not added to the map's event array but rather stored in an internal array. I've improved the dependent events system in the current version and added the following function:
pbGetDependency(name) - Returns a Game_Character object associated with the dependent event with the given name. Returns nil if the dependent event doesn't exist.
Does that mean that we could use move route events with the follower even off the map it was implemented on, or not?
help-14
December 1st, 2009, 04:42 AM
Here is the new version.
Step 1: Remove old script (or replace it with script in step 2). Creat a dependent event name "Dependent"
Step 2: In PokemonScreen find (line 1300)
next if havecommand
if cmdSummary>=0 && command==cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdSwitch>=0 && command==cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid=pkmnid
pkmnid=@scene.pbChoosePokemon(true)
if pkmnid>=0 && pkmnid!=oldpkmnid
pbSwitch(oldpkmnid,pkmnid)
end
Add below
#Pokemon Following v1.1 By Help-14
pbMoveRoute(pbGetDependency("Dependent"),[PBMoveRoute::Graphic,@party[0].name.to_s+".png",0,2,0])
Kernel.pbAddDependen(pbGetDependency("Dependent"), "Dependent4", 3)
Kernel.pbRemoveDependency2("Dependent")
Kernel.pbAddDependen(pbGetDependency("Dependent4"), "Dependent", 3)
Kernel.pbRemoveDependency2("Dependent4")
#Pokemon Following v1.1 By Help-14
Step 3: In DependentEvents find
def pbGetDependency(eventName)
return $PokemonTemp.dependentEvents.getEventByName(eventName)
end
If don't have, find
class PokemonTemp
attr_accessor :dependentEvents
def dependentEvents
@dependentEvents=DependentEvents.new if !@dependentEvents
return @dependentEvents
end
end
Add below
#Pokemon Following v1.1 By Help-14
def pbGetDependency(eventName)
return $PokemonTemp.dependentEvents.getEventByName(eventName)
end
#Pokemon Following v1.1 By Help-14
Now find:
def getEventByName(name)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]==name # Arbitrary name given to dependent event
return @realEvents[i]
end
end
return nil
end
if don't have, find
def addEvent(event,eventName=nil,commonEvent=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][0]==$game_map.map_id &&
events[i][1]==event.id
# Already exists
return
end
end
# Original map ID, original event ID, current map ID,
# event X, event Y, event direction, event's filename,
# event's hue, event's name, common event ID
eventData=[
$game_map.map_id,event.id,$game_map.map_id,
event.x,event.y,event.direction,
event.character_name.clone,
event.character_hue,eventName,commonEvent
]
newEvent=createEvent(eventData)
events.push(eventData)
@realEvents.push(newEvent)
@lastUpdate+=1
event.erase
end
Add below
#Pokemon Following v1.1 By Help-14
def getEventByName(name)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]==name # Arbitrary name given to dependent event
return @realEvents[i]
end
end
return nil
end
#Pokemon Following v1.1 By Help-14
Step 4: In DependentEvents find
class PokemonTemp
attr_accessor :dependentEvents
def dependentEvents
@dependentEvents=DependentEvents.new if !@dependentEvents
return @dependentEvents
end
end
Add below
#Pokemon Following v1.1 By Help-14
def pbAddDependen(event, eventName, commonEvent)
$PokemonTemp.dependentEvents.addEvent2(event,eventName,commonEvent)
end
#Pokemon Following v1.1 By Help-14
Now find:
def addEvent(event,eventName=nil,commonEvent=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][0]==$game_map.map_id &&
events[i][1]==event.id
# Already exists
return
end
end
# Original map ID, original event ID, current map ID,
# event X, event Y, event direction, event's filename,
# event's hue, event's name, common event ID
eventData=[
$game_map.map_id,event.id,$game_map.map_id,
event.x,event.y,event.direction,
event.character_name.clone,
event.character_hue,eventName,commonEvent
]
newEvent=createEvent(eventData)
events.push(eventData)
@realEvents.push(newEvent)
@lastUpdate+=1
event.erase
end
Add below
#Pokemon Following v1.1 By Help-14
def addEvent2(event,eventName=nil,commonEvent=nil)
events=$PokemonGlobal.dependentEvents
eventData=[
$game_map.map_id,event.id,$game_map.map_id,
event.x,event.y,event.direction,
event.character_name.clone,
event.character_hue,eventName,commonEvent
]
newEvent=createEvent(eventData)
events.push(eventData)
@realEvents.push(newEvent)
@lastUpdate+=1
event.erase
end
#Pokemon Following v1.1 By Help-14
Done. What's news in this version ? When change Pokemon, new pokemon don't run away, A few edit, you can make 4 pokemon follow you, easy change number of following pokemons, ... . Now I am testing it.
Ty 101
December 1st, 2009, 08:48 PM
I am happy to see that this thread is still going.
I haven't posted in awhile but there is now an actual script available.
(Thanks for that by the way)
I don't know whether I'll use it or not but if I do I might add some stuff.
help-14
December 2nd, 2009, 04:32 AM
Updated how to install v1.1
Vaskituh
December 2nd, 2009, 01:26 PM
Theres still one problem mate, when a pokemon evolves, the overworld char that's following doesn't automatically change, also, when you first receive a pokemon in the beginning it doesn't automatically start following you.
Can that be fixed too mate ?
help-14
December 3rd, 2009, 04:22 AM
oh, fix it is very easy. Here is demo video of next version, what do you think ?
bgqyp0frfOc
Vaskituh
December 3rd, 2009, 08:36 AM
So you will fix it mate ?
Also i noticed another bug, whenever i don't have a pokemon following me i can enter all the houses, but when i have a pokemon following me i can't seem to enter some of the houses, but the code is the exact same for all the houses except for the fact that it teleports to different places obviously
The video looks GREAT mate, you are awesome :D
Peeky Chew
December 3rd, 2009, 09:24 AM
If every glitch is fixed in that code I'll certainly be using it.
Just gotta learn RGSS first...
Birdybot
December 3rd, 2009, 04:22 PM
I get this error when I try to switch Pokémon using your most recent script;
Script 'DependantEvents' line 450: NoMethodError occurred.
undefined method 'x' for nil:NilClass
I think it's because I don't really know what you mean by creating a dependant event because I'm such a total noob. Help?
help-14
December 4th, 2009, 04:20 AM
Pokemon Following Character v2.0 is out ! Before read anything, watch this video.
uXuf1rT237U
Step 1: Remove old Script. Extract this to Graphics Folder: http://mediafire.com/?0lvu4zbnuzg (If don't have)
Step 2: Creat new script above main.
http://i177.photobucket.com/albums/w222/pokemonfan14/ScriptEditor.jpg
###########################################
#### Config Script For Your Game Here ####
###########################################
Animation_Come_In = 447 #<= ID of Animation When Pokemon Come In PokeBall
Animation_Come_Out = 446 #<= ID of Animation When Pokemon Come Out PokeBall
Default_Following_Pokemon_Number = 1 #<= Default Number Of Following Pokemon
Pokemon_1_ID = 142 #<= ID Of Event Use To Make First Pokemon, Should Over 200
Pokemon_2_ID = 143 #<= ID Of Event Use To Make Second Pokemon, Should Over 200
Pokemon_3_ID = 144 #<= ID Of Event Use To Make Third Pokemon, Should Over 200
Pokemon_4_ID = 145 #<= ID Of Event Use To Make Fourth Pokemon, Should Over 200
Pokemon_5_ID = 146 #<= ID Of Event Use To Make Fifth Pokemon, Should Over 200
Pokemon_6_ID = 147 #<= ID Of Event Use To Make Sixth Pokemon, Should Over 200
Common_Event_1 = 3 #<= ID of Common Event When You Talk To First Pokemon
Common_Event_2 = 3 #<= ID of Common Event When You Talk To Second Pokemon
Common_Event_3 = 3 #<= ID of Common Event When You Talk To Third Pokemon
Common_Event_4 = 3 #<= ID of Common Event When You Talk To Fourth Pokemon
Common_Event_5 = 3 #<= ID of Common Event When You Talk To Fifth Pokemon
Common_Event_6 = 3 #<= ID of Common Event When You Talk To Sixth Pokemon
#####################################################
#### Pokemon Following Character v2.0 By Help-14 ####
#####################################################
def auto_change_with_animation
if $pokenum==nil
$pokenum = Default_Following_Pokemon_Number
end
if $pokenum>=1
pbMoveRoute(pbGetDependency("Dependent0"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
if $pokenum==1
$scene.spriteset.addUserAnimation(Animation_Come_Out,pbGetDependency("Dependent0").x,pbGetDependency("Dependent0").y)
end
pbMoveRoute(pbGetDependency("Dependent0"),[PBMoveRoute::Graphic,$Trainer.party[0].name.to_s+".png",0,2,0])
else
if $pokenum==0
$scene.spriteset.addUserAnimation(Animation_Come_In,pbGetDependency("Dependent0").x,pbGetDependency("Dependent0").y)
end
pbMoveRoute(pbGetDependency("Dependent0"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent0"), "Dependent6", Common_Event_1)
Kernel.pbRemoveDependency2("Dependent0")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent0", Common_Event_1)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=2 && $Trainer.party.length >= 2
if $pokenum==2
$scene.spriteset.addUserAnimation(Animation_Come_Out,pbGetDependency("Dependent1").x,pbGetDependency("Dependent1").y)
end
pbMoveRoute(pbGetDependency("Dependent1"),[PBMoveRoute::Graphic,$Trainer.party[1].name.to_s+".png",0,2,0])
else
if $pokenum==0 && $Trainer.party.length >= 2
$scene.spriteset.addUserAnimation(Animation_Come_In,pbGetDependency("Dependent1").x,pbGetDependency("Dependent1").y)
end
pbMoveRoute(pbGetDependency("Dependent1"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent1"), "Dependent6", Common_Event_2)
Kernel.pbRemoveDependency2("Dependent1")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent1", Common_Event_2)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=3 && $Trainer.party.length >= 3
if $pokenum==3
$scene.spriteset.addUserAnimation(Animation_Come_Out,pbGetDependency("Dependent2").x,pbGetDependency("Dependent2").y)
end
pbMoveRoute(pbGetDependency("Dependent2"),[PBMoveRoute::Graphic,$Trainer.party[2].name.to_s+".png",0,2,0])
else
if $pokenum==0 && $Trainer.party.length >= 3
$scene.spriteset.addUserAnimation(Animation_Come_In,pbGetDependency("Dependent2").x,pbGetDependency("Dependent2").y)
end
pbMoveRoute(pbGetDependency("Dependent2"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent2"), "Dependent6", Common_Event_3)
Kernel.pbRemoveDependency2("Dependent2")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent2", Common_Event_3)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=4 && $Trainer.party.length >= 4
if $pokenum==4
$scene.spriteset.addUserAnimation(Animation_Come_Out,pbGetDependency("Dependent3").x,pbGetDependency("Dependent3").y)
end
pbMoveRoute(pbGetDependency("Dependent3"),[PBMoveRoute::Graphic,$Trainer.party[3].name.to_s+".png",0,2,0])
else
if $pokenum==0 && $Trainer.party.length >= 4
$scene.spriteset.addUserAnimation(Animation_Come_In,pbGetDependency("Dependent3").x,pbGetDependency("Dependent3").y)
end
pbMoveRoute(pbGetDependency("Dependent3"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent3"), "Dependent6", Common_Event_4)
Kernel.pbRemoveDependency2("Dependent3")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent3", Common_Event_4)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=5 && $Trainer.party.length >= 5
if $pokenum==5
$scene.spriteset.addUserAnimation(Animation_Come_Out,pbGetDependency("Dependent4").x,pbGetDependency("Dependent4").y)
end
pbMoveRoute(pbGetDependency("Dependent4"),[PBMoveRoute::Graphic,$Trainer.party[4].name.to_s+".png",0,2,0])
else
if $pokenum==0 && $Trainer.party.length >= 5
$scene.spriteset.addUserAnimation(Animation_Come_In,pbGetDependency("Dependent4").x,pbGetDependency("Dependent4").y)
end
pbMoveRoute(pbGetDependency("Dependent4"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent4"), "Dependent6", Common_Event_5)
Kernel.pbRemoveDependency2("Dependent4")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent4", Common_Event_5)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum==6 && $Trainer.party.length == 6
$scene.spriteset.addUserAnimation(Animation_Come_Out,pbGetDependency("Dependent5").x,pbGetDependency("Dependent5").y)
pbMoveRoute(pbGetDependency("Dependent5"),[PBMoveRoute::Graphic,$Trainer.party[5].name.to_s+".png",0,2,0])
else
if $pokenum==0 && $Trainer.party.length == 6
$scene.spriteset.addUserAnimation(Animation_Come_In,pbGetDependency("Dependent5").x,pbGetDependency("Dependent5").y)
end
pbMoveRoute(pbGetDependency("Dependent5"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent5"), "Dependent6", Common_Event_6)
Kernel.pbRemoveDependency2("Dependent5")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent5", Common_Event_6)
Kernel.pbRemoveDependency2("Dependent6")
end
################################################################################
def change_number
if $pokenum==nil
$pokenum=Default_Following_Pokemon_Number
end
$pokenum+=1
if $pokenum==7
$pokenum=0
end
end
################################################################################
def auto_change_without_animation
if $pokenum==nil
$pokenum = Default_Following_Pokemon_Number
end
if $pokenum>=1
pbMoveRoute(pbGetDependency("Dependent0"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
pbMoveRoute(pbGetDependency("Dependent0"),[PBMoveRoute::Graphic,$Trainer.party[0].name.to_s+".png",0,2,0])
else
pbMoveRoute(pbGetDependency("Dependent0"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent0"), "Dependent6", Common_Event_1)
Kernel.pbRemoveDependency2("Dependent0")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent0", Common_Event_1)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=2 && $Trainer.party.length >= 2
pbMoveRoute(pbGetDependency("Dependent1"),[PBMoveRoute::Graphic,$Trainer.party[1].name.to_s+".png",0,2,0])
else
pbMoveRoute(pbGetDependency("Dependent1"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent1"), "Dependent6", Common_Event_2)
Kernel.pbRemoveDependency2("Dependent1")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent1", Common_Event_2)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=3 && $Trainer.party.length >= 3
pbMoveRoute(pbGetDependency("Dependent2"),[PBMoveRoute::Graphic,$Trainer.party[2].name.to_s+".png",0,2,0])
else
pbMoveRoute(pbGetDependency("Dependent2"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent2"), "Dependent6", Common_Event_3)
Kernel.pbRemoveDependency2("Dependent2")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent2", Common_Event_3)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=4 && $Trainer.party.length >= 4
pbMoveRoute(pbGetDependency("Dependent3"),[PBMoveRoute::Graphic,$Trainer.party[3].name.to_s+".png",0,2,0])
else
pbMoveRoute(pbGetDependency("Dependent3"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent3"), "Dependent6", Common_Event_4)
Kernel.pbRemoveDependency2("Dependent3")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent3", Common_Event_4)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum>=5 && $Trainer.party.length >= 5
pbMoveRoute(pbGetDependency("Dependent4"),[PBMoveRoute::Graphic,$Trainer.party[4].name.to_s+".png",0,2,0])
else
pbMoveRoute(pbGetDependency("Dependent4"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent4"), "Dependent6", Common_Event_5)
Kernel.pbRemoveDependency2("Dependent4")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent4", Common_Event_5)
Kernel.pbRemoveDependency2("Dependent6")
if $pokenum==6 && $Trainer.party.length == 6
pbMoveRoute(pbGetDependency("Dependent5"),[PBMoveRoute::Graphic,$Trainer.party[5].name.to_s+".png",0,2,0])
else
pbMoveRoute(pbGetDependency("Dependent5"),[PBMoveRoute::Graphic,"nil.png",0,2,0])
end
Kernel.pbAddDependen(pbGetDependency("Dependent5"), "Dependent6", Common_Event_6)
Kernel.pbRemoveDependency2("Dependent5")
Kernel.pbAddDependen(pbGetDependency("Dependent6"), "Dependent5", Common_Event_6)
Kernel.pbRemoveDependency2("Dependent6")
end
################################################################################
def creat_6_dependent_event
Kernel.pbAddDependency2(Pokemon_1_ID, "Dependent0", Common_Event_1)
Kernel.pbAddDependency2(Pokemon_2_ID, "Dependent1", Common_Event_2)
Kernel.pbAddDependency2(Pokemon_3_ID, "Dependent2", Common_Event_3)
Kernel.pbAddDependency2(Pokemon_4_ID, "Dependent3", Common_Event_4)
Kernel.pbAddDependency2(Pokemon_5_ID, "Dependent4", Common_Event_5)
Kernel.pbAddDependency2(Pokemon_6_ID, "Dependent5", Common_Event_6)
auto_change_without_animation
end
Step 3: In DependentEvent, find:
def pbGetDependency(eventName)
return $PokemonTemp.dependentEvents.getEventByName(eventName)
end
if don’t have, find
class PokemonTemp
attr_accessor :dependentEvents
def dependentEvents
@dependentEvents=DependentEvents.new if !@dependentEvents
return @dependentEvents
end
end
Add below
# Pokemon Following Character v2.0 By Help-14
def pbGetDependency(eventName)
return $PokemonTemp.dependentEvents.getEventByName(eventName)
end
# Pokemon Following Character v2.0 By Help-14
Step 3 -2: Now find
def getEventByName(name)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]==name # Arbitrary name given to dependent event
return @realEvents[i]
end
end
return nil
end
if don’t have, find
def removeEvent(event)
events=$PokemonGlobal.dependentEvents
mapid=$game_map.map_id
for i in 0...events.length
if events[i][2]==mapid && # Refer to current map
events[i][0]==event.map_id && # Event's map ID is original ID
events[i][1]==event.id
events[i]=nil
@realEvents[i]=nil
@lastUpdate+=1
end
events.compact!
@realEvents.compact!
end
end
add below
# Pokemon Following Character v2.0 By Help-14
def getEventByName(name)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]==name # Arbitrary name given to dependent event
return @realEvents[i]
end
end
return nil
end
# Pokemon Following Character v2.0 By Help-14
Step 4: In DependentEvent, find:
def pbGetDependency(eventName)
return $PokemonTemp.dependentEvents.getEventByName(eventName)
end
Add below
# Pokemon Following Character v2.0 By Help-14
def pbAddDependen(event, eventName, commonEvent)
$PokemonTemp.dependentEvents.addEvent2(event,eventName,commonEvent)
end
# Pokemon Following Character v2.0 By Help-14
Step 4-2: Now find
def getEventByName(name)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events[i] && events[i][8]==name # Arbitrary name given to dependent event
return @realEvents[i]
end
end
return nil
end
Add below
# Pokemon Following Character v2.0 By Help-14
def addEvent2(event,eventName=nil,commonEvent=nil)
events=$PokemonGlobal.dependentEvents
eventData=[
$game_map.map_id,event.id,$game_map.map_id,
event.x,event.y,event.direction,
event.character_name.clone,
event.character_hue,eventName,commonEvent
]
newEvent=createEvent(eventData)
events.push(eventData)
@realEvents.push(newEvent)
@lastUpdate+=1
event.erase
end
# Pokemon Following Character v2.0 By Help-14
Step 5: In PokemonScreen, Find (Line 1300)
if cmdSummary>=0 && command==cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdSwitch>=0 && command==cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid=pkmnid
pkmnid=@scene.pbChoosePokemon(true)
if pkmnid>=0 && pkmnid!=oldpkmnid
pbSwitch(oldpkmnid,pkmnid)
end
Add Below
#Pokemon Following v2.0 By Help-14
auto_change_with_animation
#Pokemon Following v2.0 By Help-14
Step 6: In PokemonEvolution, find
if createSpecies>0 && $Trainer.party.length<6
newpokemon=@pokemon.clone
newpokemon.iv=@pokemon.iv.clone
newpokemon.ev=@pokemon.ev.clone
newpokemon.species=createSpecies
newpokemon.name=PBSpecies.getName(createSpecies)
newpokemon.calcStats
$Trainer.party.push(newpokemon)
$Trainer.seen[createSpecies]=true
$Trainer.owned[createSpecies]=true
end
atkdata.close
end
Add below (careful with “end”)
#Pokemon Following v2.0 By Help-14
auto_change_without_animation
#Pokemon Following v2.0 By Help-14
Step 7: In PokemonStorage, find
def pbStore(selected,heldpoke)
box=selected[0]
index=selected[1]
if box!=-1
raise _INTL("Can't deposit from box...")
end
if pbAbleCount<=1 && pbAble?(@storage[box,index]) && !heldpoke
pbDisplay(_INTL("That's your last POKÐMON!"))
elsif @storage[box,index].mail
pbDisplay(_INTL("Please remove the Mail."))
else
loop do
destbox=@scene.pbChooseBox(_INTL("Deposit in which Box?"))
if destbox>=0
success=false
firstfree=@storage.pbFirstFreePos(destbox)
if firstfree<0
pbDisplay(_INTL("The Box is full."))
next
end
@scene.pbStore(selected,heldpoke,destbox,firstfree)
if heldpoke
@storage.pbMoveCaughtToBox(heldpoke,destbox)
@heldpkmn=nil
else
@storage.pbMove(destbox,-1,-1,index)
end
end
break
end
@scene.pbRefresh
End
Add below (careful with “end”)
#Pokemon Following v2.0 By Help-14
auto_change_without_animation
#Pokemon Following v2.0 By Help-14
Step 8: In map where player will receive pokemon, creat 6 event name Dependent0, Dependent1, ..., Dependent5. It’s ID must over 200. Why ? Because the script has a bug, when change pokemon graphic, events with same id with dependent events will be remove. Total number of event in your map can’t over 150 so It’s ID must over 200.
Step 9: When receive pokemon, add this script:
http://i177.photobucket.com/albums/w222/pokemonfan14/EditEvent-ID142.jpg
creat_6_dependent_event
Step 10: Create a common Event with triggle: Parallel, Condition Switch is a On Switch.
Add Script like this.
http://i177.photobucket.com/albums/w222/pokemonfan14/Database_2.jpg
Step 11: Edit Script created in step 2. Enjoy !!!
Crazyninjaguy
December 4th, 2009, 12:54 PM
Thanks alot for this an all, but could you help me with this?
I get an error when switching pokemon,
Message: undefined method `x' for nil:NilClass
DependentEvents:519:in `addEvent2'
DependentEvents:28:in `pbAddDependen'
Following:61:in `auto_change_with_animation'
PokemonScreen:1363:in `pbPokemonScreen'
PokemonScreen:1263:in `loop'
PokemonScreen:1510:in `pbPokemonScreen'
PokemonMenu:133:in `pbStartPokemonMenu'
PokemonMenu:132:in `pbFadeOutIn'
PokemonMenu:132:in `pbStartPokemonMenu'
PokemonMenu:124:in `loop'
help-14
December 4th, 2009, 01:00 PM
maybe you did not have enough dependent even.
Crazyninjaguy
December 4th, 2009, 02:01 PM
Ok well i'll try adding more :)
Thanks.
Vaskituh
December 4th, 2009, 02:06 PM
Mate i am not understanding the Step 8 and 9.
The thing is, how can i make the ID over 200 ?
http://img692.imageshack.us/img692/2699/semttulo123.jpg
Also on Step 9, do i add that script where ?
And where do i put this ? "creat_6_dependent_event" ?
Thank you, GREAT work !
Also please explain how to do step 11, and what do you mean with change script of step 2 ? I don't understand a thing mate
help-14
December 4th, 2009, 02:36 PM
for example in step 8. you copy a event 206 times. then use events from 201 to 206. remove events from 1 to 200. in step 9. when you receive first pokemon (example from professor oak) add this script below script receive pokemon (pbaddpokemon or something like that)
tommorow i will upload video how to install.
Vaskituh
December 4th, 2009, 02:41 PM
Also please explain how to do step 11, and what do you mean with change script of step 2 ?
Where do i put "creat_6_dependent_event"
I don't understand a thing mate :(
Crazyninjaguy
December 4th, 2009, 02:41 PM
Wow 206 times...
You'd only have to do this once though right?
I'll wait for the video though so i don't mess it up :p
Vaskituh
December 4th, 2009, 02:52 PM
I get this two errors now :(
http://img100.imageshack.us/img100/2699/semttulo123.jpg
and
http://img708.imageshack.us/img708/275/semttulo124.jpg
The thing that i think i didn't do right was from Step 8 to Step 12 :(
Crazyninjaguy
December 4th, 2009, 03:15 PM
That's the exact same error i got.
I'm clueless 0_0
Birdybot
December 4th, 2009, 05:24 PM
I tried it, and it failed. The Pokémon didn't follow, and it fails when I try to add Pokémon or switch Pokémon.
Crazyninjaguy
December 4th, 2009, 06:46 PM
Guess we'll have to wait for Help-14 to fix it :/
I went back to using the version from before but some other stuff failed with that one lol
help-14
December 5th, 2009, 04:06 AM
I update how to install v2.0. In step 11, you must config these script:
###########################################
#### Config Script For Your Game Here ####
###########################################
Animation_Come_In = 447 #<= ID of Animation When Pokemon Come In PokeBall
Animation_Come_Out = 446 #<= ID of Animation When Pokemon Come Out PokeBall
Default_Following_Pokemon_Number = 1 #<= Default Number Of Following Pokemon
Pokemon_1_ID = 142 #<= ID Of Event Use To Make First Pokemon, Should Over 200
Pokemon_2_ID = 143 #<= ID Of Event Use To Make Second Pokemon, Should Over 200
Pokemon_3_ID = 144 #<= ID Of Event Use To Make Third Pokemon, Should Over 200
Pokemon_4_ID = 145 #<= ID Of Event Use To Make Fourth Pokemon, Should Over 200
Pokemon_5_ID = 146 #<= ID Of Event Use To Make Fifth Pokemon, Should Over 200
Pokemon_6_ID = 147 #<= ID Of Event Use To Make Sixth Pokemon, Should Over 200
Common_Event_1 = 3 #<= ID of Common Event When You Talk To First Pokemon
Common_Event_2 = 3 #<= ID of Common Event When You Talk To Second Pokemon
Common_Event_3 = 3 #<= ID of Common Event When You Talk To Third Pokemon
Common_Event_4 = 3 #<= ID of Common Event When You Talk To Fourth Pokemon
Common_Event_5 = 3 #<= ID of Common Event When You Talk To Fifth Pokemon
Common_Event_6 = 3 #<= ID of Common Event When You Talk To Sixth Pokemon
The number after "=" is for my game, you need edit it to accord with your game
Vaskituh
December 5th, 2009, 09:49 AM
Yeah, but the thing is, it still gives errors :(
Including on the Step 9, 10, 11, and 12 mate
Klofkac
December 5th, 2009, 10:21 AM
That is interesting script. I'll use it.
help-14
December 5th, 2009, 10:21 AM
I found Problem, I forgot 2 step.
Extract this to Character Folders (replace if need): http://www.mediafire.com/?lwyyt0ttink
Copy this to Animations Folder: http://www.mediafire.com/imageview.php?quickkey=nhnyzmgnuwm
Import two animations: http://www.mediafire.com/?wdg33wgfhqk and http://www.mediafire.com/?iuutxjfynen
If you don't know how to import, read in here: http://www.pokecommunity.com/showthread.php?t=200575
Try install again, sorry I can't upload install video today. I'll Upload It in Monday.
Birdybot
December 5th, 2009, 03:23 PM
How do I know what numbers to put in section 11?
tImE
December 6th, 2009, 09:38 AM
This feature is looking awsome!
I'm having probems implenting it though;
When I talk to the event that gives me a pokemon, the dependency and the "auto_change_without_animation",
I get this error:
---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError
Message: Script error within event 1, map 31 (Smallweed Village):
Exception: NoMethodError
Message: Section130:455:in `addEvent2'undefined method `x' for nil:NilClass
***Full script:
Kernel.pbAddDependency2(201,
"Dependent0", 003)
auto_change_without_animation
Interpreter:239:in `pbExecuteScript'
DependentEvents:28:in `pbAddDependen'
PokemonFollowingCharacter:171:in `auto_change_without_animation'
(eval):3:in `pbExecuteScript'
Interpreter:1583:in `eval'
Interpreter:239:in `pbExecuteScript'
Interpreter:1583:in `command_355'
Interpreter:492:in `execute_command'
Interpreter:191:in `update'
Interpreter:104:in `loop'
Interpreter:274:in `pbExecuteScript'
Interpreter:1583:in `command_355'
Interpreter:492:in `execute_command'
Interpreter:191:in `update'
Interpreter:104:in `loop'
Interpreter:196:in `update'
Scene_Map:96:in `update'
Scene_Map:94:in `loop'
Scene_Map:107:in `update'
Scene_Map:63:in `main'
This exception was logged in errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
Help would be appreciated.
help-14
December 6th, 2009, 10:42 AM
it's because you do not have enough event to dependent or you did not config script which has created in step 2
tImE
December 6th, 2009, 03:47 PM
it's because you do not have enough event to dependent or you did not config script which has created in step 2
I have added 6 dependent events with ID 201, 202, 203... etc.
And changed the script from step 2.
And it still gives me the same error...
Here is my event too;
http://img29.imageshack.us/img29/1397/grej.png
Klofkac
December 6th, 2009, 04:04 PM
Delete script "Kernel.PbAddDependency2(201,"Dependent0",003)" and it will work.
tImE
December 6th, 2009, 04:31 PM
Delete script "Kernel.PbAddDependency2(201,"Dependent0",003)" and it will work.
Nope, Didn't help.
But thanks anyway...
help-14
December 7th, 2009, 04:34 AM
Installation Video:
Nl8PDlZC8CI
Birdybot
December 7th, 2009, 08:31 AM
The video doesn't work...
It says it's too long, so maybe you should break it down into several shorter videos.
help-14
December 11th, 2009, 03:13 AM
Here is the new topic for Pokemon Following Character Script: http://www.pokecommunity.com/showthread.php?goto=newpost&t=202478