• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other Question] Make NPC battle eachother

18
Posts
4
Years
  • Age 24
  • Seen Jun 29, 2019
So I've restarted and checked every so often if I could still get xp. But it appears after the npc battle that its no longer possible. I feel like something is off in my script installment.
I'm guessing it could be that it thinks i'm still an npc XD
 

Ego13

hollow_ego
311
Posts
6
Years
Sorry, that's my mistake. In Line 177 I forgot to set the NPCBATTLE Switch to false sooo change that and all should be fine :)
Thanks for your feedback
 
18
Posts
4
Years
  • Age 24
  • Seen Jun 29, 2019
Thank you :D I put the switches off to make sure it was that, i'm gonna put them back on then later.
Another question, hope the moderators here don't get annoyed by off topic or you for that matter XD

I was wondering about the evolution system mechanics. I was wondering if the spiky eared pichu can evolve if I'd add a sprite with a similar name to it.

the image for the spiky eared pichu has the name 172b_1, so I was thinking if I add an image in the pikachu section 025b_1, that it would the evolution of it. I'm not sure if i'm in the correct line of thought tho XD


Been busy with a single problem and haven't been able to find solution, through google or whatsoever. A command to check for a specifically named pokémon and one to remove that same pokémon.
So if you got an Espeon called Jeff, you give jeff away.
 
Last edited:

Ego13

hollow_ego
311
Posts
6
Years
You don't need to turn on/off the switch manually, as the script is taking care of that

The form of the evolution is not determined by the pictures at all. In fact you can have two different forms with the same sprite. And if you have the Spikey Eared Pichu it will evolve into form 1 of Pikachu.
All details can be found here: https://essentialsdocs.fandom.com/wiki/Forms
 
18
Posts
4
Years
  • Age 24
  • Seen Jun 29, 2019
Concerning the switch. I had to turn it manually off to test the issue before the correction is what I mean, not sure if it auto turns back on next time when its used or not, but will see.

Oh ok, thanks :) Thought spikey eared pichu couldn't evolve originally, cause in the games it couldn't.

I've been rummaging around in essentials docs in search of the a code that would allow me to delete a certain pokémon from the party, though the slot is undefined.
To explain the situation, imagine if a trainer asks you to capture a growlithe and to name them "Arch", you'd "give it to them", without trading and maybe they'd pay you or give you a reward.
But I can't seem to find the script needed for such a thing.
 

Ego13

hollow_ego
311
Posts
6
Years
Ah right there was someting about that. Uhm then you need to remove that Pichu check from the evolution method. Just search for "Pichu" in the scripts and you will find it quickly.

Well to do that you would need to check the players party for a Growlithe that is named "Arch". Also you would need to make sure that you are not deleting the Players own Growlithe if it happens to have the same name. For all this there is no finished script. You might want to handle it similar to when you are trying to trade a Pokemon. That means having the player choose the Pokemon and when he has choosen it, check if it is valid.
For details on possible methods refer to https://essentialsdocs.fandom.com/wiki/Manipulating_Pokémon
Especially the part "Choosing a Pokemon"
 
18
Posts
4
Years
  • Age 24
  • Seen Jun 29, 2019
Yeah that's one of the links i've been using and haven't gotten any further whatsoever. I don't get how to check for the selected one to be a specific pokémon or its name for that fact.
If there was a way for the nickname to be identified from the variable. Like [0003: Temp Pokemon Name] = Archy or so... but I can't find anything for it.
Edit:Hrmm, maybe V something, gonna try that one soon, just wanna finish something else in the project first. Will let you know my progress ^^
Edit2: Yeah, it didn't work out... :/
pbChooseTradablePokemon in comparison has option to select specific pokémon type. being pbChooseTradablePokemon(1,2,:RATTATA), which isn't the case for pbChoosePokemon or atleast I didn't get it to work...
 
Last edited:

Ego13

hollow_ego
311
Posts
6
Years
Well if you want to reuse the code I suggest making it a standalone script that you can call in the event.
I made a simple script for that. It will automatically remove the Pokemon if it is valid

Code:
# give species in this format -> :GROWLITHE
# name can either be left out if the name doesn't matter or has to be given as a string -> "Arch"
def hasPokemonToGive(species,name=nil)
  return false if !pbHasSpecies?(species) # if the player doesn't even have the species, don't even open the party screen
  pokemon = nil
  index = -1
  # let the player select a Pokemon
  pbFadeOutIn(99999){
    scene = PokemonParty_Scene.new
    screen = PokemonPartyScreen.new(scene,$Trainer.party)
    screen.pbStartScene(_INTL("Choose a Pokémon."),false)
    index = screen.pbChoosePokemon
    screen.pbEndScene
  }
  
  # if the Pokemon is valid, remove it from party
  if ($Trainer.party[index].name==name || !name ) && isConst?($Trainer.party[index].species,PBSpecies,species)
    pbRemovePokemonAt(index)
    return true
  end
  
  return false
end

You can use this script in a conditonal branch to give the appropriate text to the player or whatever.
 
Last edited:
18
Posts
4
Years
  • Age 24
  • Seen Jun 29, 2019
Thank you! :D It works like a charm =D It was indeed one of the big features of the game I was hoping to create :)
 
4
Posts
4
Years
  • Age 31
  • Seen Jun 30, 2019
Any way to have trainer1 have an end speech if they win? Like a taunt still in the battle screen if they win for story purposes.
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
Any way to have trainer1 have an end speech if they win? Like a taunt still in the battle screen if they win for story purposes.

I don't think that question belongs in this thread?

Maybe look for the code that displays the losing end speeches, and expand it to cover winning too? Try searching for a message that's likely in the code, for example the message about having won money. I wouldn't be surprised if there's already a resource out there that expands the PBS files to cover this functionality, or maybe it's even built into Essentials.
 
Last edited:
26
Posts
5
Years
  • Age 25
  • Seen Nov 25, 2021
---------------------------
Pokémon Chronicles
---------------------------
[Pokémon Essentials version 17.2]

Exception: RuntimeError

Message: Script error within event 18 (coords 21,17), map 66 (Stein Cavern):

Exception: NoMethodError

Message: PokeBattle_Battle:4191:in `pbEndOfBattle'private method `gsub' called for nil:NilClass

***Full script:

trainer1=[:POKEMONTRAINER_Max,"Max"]
trainer2=[:ROCKETADMPRT,"Proton"]
trainers=[trainer1,trainer2]
pbNPCBattle(trainers)


Interpreter:243:in `pbExecuteScript'

PokeBattle_Battle:2707:in `pbStartBattleCore'

PokeBattle_Battle:2506:in `pbStartBattle'

NPC Battle:163:in `pbNPCBattle'

NPC Battle:162:in `pbSceneStandby'

NPC Battle:164:in `pbNPCBattle'

NPC Battle:161:in `pbBattleAnimation'

NPC Battle:161:in `pbNPCBattle'

(eval):4:in `pbExecuteScript'

Interpreter:1606:in `eval'



Interpreter:276:in `pbExecuteScript'

Interpreter:1606:in `command_355'

Interpreter:494:in `execute_command'

Interpreter:193:in `update'

Interpreter:106:in `loop'

Interpreter:198:in `update'

Scene_Map:163:in `cng_dayseason_map_update'

Scene_Map:161:in `loop'

Scene_Map:170:in `cng_dayseason_map_update'

Seasons:124:in `update'



This exception was logged in

C:\Users\User\Saved Games\Pokémon Chronicles\errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

What i did wrong?
 
Back
Top