Ask simple questions here! [READ ORIGINAL POST before posting]

HoeenHero

The Misspelled Hero!
is a Battle Simulator Administratoris a Programmeris a Super Moderatoris a Community Contributoris a Live Chat Contributor
PS Admin
I've been reading documentation for adding a custom mode and i think I'm close to understanding how to do that, I just need to know where are all the events' name that I can add onEvent triggers on,
A general overview can be found here: https://github.com/smogon/pokemon-showdown/blob/master/sim/battle.ts#L490-L593 There unfortunately is no master list of event names, you can however look at the list of type definitions for some currently used one: https://github.com/smogon/pokemon-showdown/blob/master/sim/global-types.ts
especially those where you can modify a move's type and switching in or out.
onSwitchIn, onSwitchOut are a few here, there isn't an event for type changes iirc, but there probably is a method on Pokemon objects. If not its probably done by changing pokemon.types and sending a protocal message back to the client.
To do so, I need to add a tick to the interface, similar to the box you can check to Dynamax your Pokémon the value of which is preserved and readable before and after you switch in or out, because the volatile status has to be added to the Pokémon that switches in. It could also totally replace the dynamax tick, the most important thing is that the value is preserved and readable after swtich out/in.
- How can I add this box?
This would be a client side change. How it works for mega's, z-move's, and dynamax is it attaches an appropriate tag to the end of the choose command. For example, when dynamaxing and using Hydro Pump as Max Geyser, the command sent to the server is /choose move hydropump max. (To be clear thats for the initial turn ONLY, max isn't attached if your already dynamaxed as it tells the server you want to dynamax that turn). This would be quite a tricky change, as you would need to add support in sim/side.ts for receiving and understanding a new flag like this, as well as support in the rest of the simulator process for handling it including putting it in the battle queue, and handling parsing the new event.

EDIT: You'll also need to inform the client that it can do this action (so it shows the checkbox, keeps it updated with the right state, ect). Remember that the server does all the work and has all the information, clients are sent limited amounts of data and display it in a fancy format thats much easier to understand for people (and it looks nice compared to raw text).
- How can I read its value inside an "onEvent" trigger?
Depends on how you implement it, see above.
- How can I know if the player has selected the first or second Pokémon to switch in after swtich in?
I dont understand this question sorry, can you try rephrasing it/explaining it further?

And before the other posts ask me to answer their questions: If I don't answer your questions I don't know the answer.
 
EDIT: rewriting from scratch because my problem totally changed, working on megaEvo was way too complex as the mechanic is very entangled with the code.
Now what I want to do is to add a move to the set of each pokemon in battle, that is called Twist, has max priority, switches out the user and activates the side condition that will make the incoming pokemon affected by the volatile. I just need to know if there is a way to add a move to a Pokémon during a battle or right before it starts. Boy, if we had an event list this would be a lot easier.
 
Last edited:
I’d like to know why Gender is randomized each game, it’s kind of a bizarre deviation from cart. The only reason this came to mind is that I was passed a team with Rivalry Haxorus and it got me thinking.
 
I’d like to know why Gender is randomized each game, it’s kind of a bizarre deviation from cart. The only reason this came to mind is that I was passed a team with Rivalry Haxorus and it got me thinking.
You can select the gender for each of your Pokémon in the teambuilder. It's only randomized if you haven't chosen one manually, since there isn't any meaningful way to assign a "default."
 
You can select the gender for each of your Pokémon in the teambuilder. It's only randomized if you haven't chosen one manually, since there isn't any meaningful way to assign a "default."
I guess the more accurate question is why is there a random option, why don't you have to commit to one before a battle?
 
Hi when I am in the middle of a match and I switch to another tab (or even go to a PS tab like teambuilder) sometimes my screen will bug out and seemingly scroll down. When this happens It usually scrolls down to where the heads of my opponents mons are making it not possible to see the health of those mons. To fix it I have to reload PS. Any knowlege on this? Not sure if this is a known bug so I put it here instead of the bugs thread. Apologies if this is the wrong place.

Edit: Here is an example, this time actually happened when I first loaded into the game.

Screenshot_2020-05-03 Icemann11 vs soberD - Showdown .png
 

FriendOfMrGolem120

aka. FOMG
is a Forum Moderatoris a Community Contributoris a Contributor to Smogonis a Battle Simulator Moderatoris a Two-Time Past SPL Champion
Moderator
Hi when I am in the middle of a match and I switch to another tab (or even go to a PS tab like teambuilder) sometimes my screen will bug out and seemingly scroll down.
I used to have the same issue two years ago (I reported it here and here) when I was using firefox and some other firefox users confirmed that they have it as well. After switching to Chrome it never appeared again.
 
I just need to know if there is a way to add a move to a Pokémon during a battle or right before it starts.
In your case you're probably looking for the onBegin event.
Boy, if we had an event list this would be a lot easier.
Most existing event handlers are listed in the EventMethods interface in sim/global-types.ts. (There are several versions of them because many events only apply to the Pokémon whose Ability or Item is responding to the event rather than some other Pokémon, but a format only needs to use the basic handler name). Formats also get some extra events which are listed in the FormatsData interface.
 
In your case you're probably looking for the onBegin event.
Yeah, I already found it, but I can't manage to add a move on the go because I can't find a constructor for a MoveSlot data structure.
Also, I am trying to use the onChangeSet() trigger, but the new move isn't recognised.

Thank you for telling me about the event list, I couldn't find it.
 
Hi, I got a really weird interaction and don't know what happened. TTAR used rockslide, then next turn my GENGAR moved first and disabled it. But the Ttar used crunch instead, but the crunch failed... He could still use it next turn though? Anybody know what happened here?
Your ally Ninetales had just fainted, and it looks like it wasn't replaced. That means your Gengar was alone on the field at the time, right?
If your opponent's move "But it failed!" when the opponent only had one Pokemon left in a double battle, they probably accidentally targeted their fainted partner slot.
This is from the thread Dawn of ares linked. C:
 
Hello, I'm new to making a custom servers and I've only just started mine on glitch.com. The server itself runs fine, but I'm having trouble finding how to make myself admin. I'm aware of using config/usergroups and writing in my "myname",~ but it just doesn't seem to work. If anyone else has experience hosting on this site, a fast reply would be greatly appreciated.
Thanks in advance
 

Attachments

HoeenHero

The Misspelled Hero!
is a Battle Simulator Administratoris a Programmeris a Super Moderatoris a Community Contributoris a Live Chat Contributor
PS Admin
Hello, I'm new to making a custom servers and I've only just started mine on glitch.com. The server itself runs fine, but I'm having trouble finding how to make myself admin. I'm aware of using config/usergroups and writing in my "myname",~ but it just doesn't seem to work. If anyone else has experience hosting on this site, a fast reply would be greatly appreciated.
Thanks in advance
You named the file :onfig/usergroups.csv which isn't right. In addition try remvoing the .gitignore file since glitch seems to think any ignored files can be deleted (or something like that) which is honestly not how .gitignore is supposed to work. I also highly suggest using a different and better host.
 
You named the file :onfig/usergroups.csv which isn't right. In addition try remvoing the .gitignore file since glitch seems to think any ignored files can be deleted (or something like that) which is honestly not how .gitignore is supposed to work. I also highly suggest using a different and better host.
Ah, got it working. I think the .gitignore was the problem, once I deleted it and refreshed the page, I got admin status. Thanks dude.
That said, if you have any recommendations on better hosting sites, I'll still be glad to check them out
 

HoeenHero

The Misspelled Hero!
is a Battle Simulator Administratoris a Programmeris a Super Moderatoris a Community Contributoris a Live Chat Contributor
PS Admin
Ah, got it working. I think the .gitignore was the problem, once I deleted and refreshed the page, I got admin status. Thanks dude.
That said, if you have any recommendations on better hosting sites, I'll still be glad to check them out
Unfortuntely nothing free, I've heard OVH is good for the price though.
 
Yeah, I already found it, but I can't manage to add a move on the go because I can't find a constructor for a MoveSlot data structure.
There's no constructor, you just create an object with the correct fields. See the code for Sketch in moves.ts.
Also, I am trying to use the onChangeSet() trigger, but the new move isn't recognised.
onChangeSet() is used for team validation, rather than the actual battle.
 
There's no constructor, you just create an object with the correct fields. See the code for Sketch in moves.ts.

onChangeSet() is used for team validation, rather than the actual battle.
That Sketch suggestion was very appropriate, thanks a lot.
Guess I'll use onBegin() as you suggested.
Thanks again :cleffa:
 

Ortheore

Tournament Banned
https://replay.pokemonshowdown.com/smogtours-gen2ubers-499134

Can we seriously fix the fucking timer? This is a fucking joke. The fact that I find myself in time trouble simply for playing normally is just absurd. Do you expect me to play a tournament match and consistently not give any thought to my moves? Even the increment is a farce, as it's so small that by the time it's even possible for me to click anything I've lost time, meaning that I found myself in a position where even if I clicked something as soon as possible I'd still lose to time. And I couldn't even stop the timer bc smogtours lol
 

Users Who Are Viewing This Thread (Users: 1, Guests: 3)

Top