• 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.

Script: Simple HUD

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
Text are refreshing fine and lag was reduce nicely, still some few pauses but very rare.
Only problem is when you toggle off and on again the icon of pokemon won't show the second time unless you switch places the pokemon or when something happen on the said pokemon, I think it is the way the refresh is handled.
I can't reproduce. I guess that this problem is solved since May 7th update.

So not an issue of sorts? just a question if or how i can fix this in the most lag-less way possible!

So i finally figured out Inputs and key presses as well as toggle-able inputs etc. now i have one for the HUD

But after the toggle is turn back to when the HUD appears the party pokemon dont show till their position is changed in the party!

just remembered this also happens with mega's! they still have the sprites but even if they are back to normal (and shows so in the party menu) it still has the mega sprite
I edited the script and added a form check now.
 
12
Posts
8
Years
  • Age 25
  • Seen Aug 2, 2023
Spoiler:

This works great, thanks.
Here's what I made of it, I plan to add badges when the player gets them on those circles ~
Sorry if it's something obvious, but how did you manage to get the Pokedex and Money counters to appear on the HUD? I tried using \PM to show the money like how it is when used in dialouge, but it didn't seem to work.

Thanks.
 
277
Posts
15
Years
This is great and I love using this with the party rotation key, however when I use the transparent HUDBar it becomes solid as I walk on a map with map connections. Is there a fix for this?
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
This is great and I love using this with the party rotation key, however when I use the transparent HUDBar it becomes solid as I walk on a map with map connections. Is there a fix for this?
Also you are correct using transparent background showed unwanted interface, if we can only find the script for map interface and restrict the HUD to refresh when near?
I aren't sure if I understand your question. The way that Spriteset_Map draw things isn't that simple. Essentials connections load maps when you are near, so the HUDs (since there is one per Spriteset_Map instance) are already drawed only when you're near.

The solution is to change the way that the HUD (or pictures) are loaded, stopping using the Spriteset_Map, so always only one HUD (and background) is loaded. I guess that I can use z as 99999 instead of a viewport, but this also requires to bind the create/disponse methods in the correct entrypoints.
-------------------------
 
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
If you look at the top of the script, you'll see:
Code:
    # When above 0, only displays HUD when this switch is on.
    SWITCHNUMBER = 0
 
  • Like
Reactions: FL
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
  • Like
Reactions: FL
1,224
Posts
10
Years
My understanding is that by setting this to, say, 10, if switch 10 is disabled, the HUD won't display. I don't think you need to redefine it during run-time if you just set it to something before. I could very well be wrong, though.

Oh, you're right. Totally didn't read that all the way
 

PoCitMonster

DotDotDot
38
Posts
10
Years
If you look at the top of the script, you'll see:
Code:
    # When above 0, only displays HUD when this switch is on.
    SWITCHNUMBER = 0

But how do i change it in essentials and turn it back on later? Is there a script I need to put or a switch i need to name
 

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
But how do i change it in essentials and turn it back on later? Is there a script I need to put or a switch i need to name
Change 'SWITCHNUMBER = 0' to 'SWITCHNUMBER = 99' and turn on and off the game switch 99. The HUD will be turned on and off, like the switch.
 
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
Hi,
Thank you for the script, it is working great!
I have a single issue: when I am on a map which has the Metadata tag "Dark Map", the darkness covers the HUD. Is there a way to display the HUD on a DarkMap map, over the darkness?
 
Last edited:

FL

Pokémon Island Creator
2,443
Posts
13
Years
  • Seen Apr 16, 2024
Hi,
Thank you for the script, it is working great!
I have a single issue: when I am on a map which has the Metadata tag "Dark Map", the darkness covers the HUD. Is there a way to display the HUD on a DarkMap map, over the darkness?
Yes! On my script, change line '@hud = HUD.new(@viewport1) if !@hud ' into '@hud = HUD.new(@viewport3) if !@hud '. On PField_Field, change line 'self.z=99998' into 'self.z=98'.
 
226
Posts
8
Years
  • Age 32
  • Seen Jul 19, 2023
On my script, change line '@hud = HUD.new(@viewport1) if !@hud ' into '@hud = HUD.new(@viewport3) if !@hud '. On PField_Field, change line 'self.z=99998' into 'self.z=98'.
That's working great! Thank you!
 
Last edited:

Soccersam

Hilbert is Badass
179
Posts
7
Years
  • Age 25
  • Seen Feb 26, 2024
It gives me a syntax error-

---------------------------
Pokemon Essentials
---------------------------
Exception: NoMethodError

Message: undefined method `egg?' for #<PokeBattle_Pokemon:0xd548fc0>

HUD Script:169:in `refreshPartyIcons'

HUD Script:161:in `each'

HUD Script:161:in `refreshPartyIcons'

HUD Script:86:in `create'

HUD Script:236:in `update'

HUD Script:278:in `follower_update'

Follow Pokemon:1775:in `klein_shadow_update'

OW Shadow:125:in `old_update'

Footprints:96:in `update'

Spriteset_Map:181:in `_animationSprite_initialize'

This exception was logged in

C:\Users\wickedsoham\Saved Games/Pokemon Essentials/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
I copied the script in Printable Version, so I don't think there should be any errors
Do we need to install the picture for the HPbars and stuff ourselves (Maybe that's what is causing the problem, or maybe it is kleinstudio's overworld kit or something...)
 

Zeak6464

Zeak #3205 - Discord
1,101
Posts
11
Years
  • Age 31
  • USA
  • Seen Oct 9, 2023
It gives me a syntax error-

---------------------------
Pokemon Essentials
---------------------------
Exception: NoMethodError

Message: undefined method `egg?'

egg? should be IsEgg?
 
Last edited:
295
Posts
5
Years
  • Age 28
  • Seen Aug 15, 2022
Hi FL

I think your script that is very nice, but I think in your script in which the ions are the animated icons, it's better and you can change something to do that.

My idea is:

Change this:
Code:
 for i in 0...6
        x = 16+64*i
        y = @yposition-8
        y-=8 if SHOWHPBARS
        @sprites["pokeicon#{i}"]=IconSprite.new(x,y,@viewport1)
      end

into:
Code:
for i in 0...6
        x = 16+64*i
        y = @yposition-8
        y-=8 if SHOWHPBARS        
        @sprites["pokeicon#{i}"]=IconSprite.new(x,y,@viewport1)
        @sprites["pokeicon#{i}"].visible = false
      end

Then delete this:

Code:
for sprite in @sprites.values
        sprite.z+=600
      end

Then, this line:

Code:
refresh = (
          @partySpecies[i]!=partySpecie || 
          @partyForm[i]!=partyForm ||
          @partyIsEgg[i]!=partyIsEgg
        )

Add after that, this code:
Code:
        @sprites["pokeicon#{i}"].visible = ( @partySpecies[i]!=partySpecie || @partyForm[i]!=partyForm || @partyIsEgg[i]!=partyIsEgg )

Then, delete this code:
Code:
 pokemonIconFile = pbPokemonIconFile($Trainer.party[i])
            @sprites["pokeicon#{i}"].setBitmap(pokemonIconFile)
            @sprites["pokeicon#{i}"].src_rect=Rect.new(0,0,64,64)

And add this:
Code:
            @sprites["pokeicon#{i}"] = PokemonIconSprite.new($Trainer.party[i],@viewport1)
@sprites["pokeicon#{i}"].x = 16+64*i 
@sprites["pokeicon#{i}"].y = @yposition - 8

That's all. Have fun and thanks your reading.
 
Last edited:
Back
Top