Author Topic: [Coding help] Bitmaps and Centerprint  (Read 1519 times)

I'm trying to do a fishing minigame with bitmaps and a centerprint but there seems to be a character limitation in the centerPrint function? And bitmaps are included as characters. I've made the filepath as small as I can but it seems to be bugging out when there's too many bitmaps one after the other. Another thing is that they seem to space themselves weird depending on the number of them.

Anyone that's clued up on these topics, it would help to know if the method I'm trying is impossible :) thanks!

EDIT: Guess I'll be more clear on what I'm trying to do
So there will be water, a fish that moves around and a hook on the centerPrint


The player tries to keep the hook on the fish using Lclick and Rclick and a bar fills up.


If the player takes too long, the fish escapes.
My alternative to using bitmaps is using models but I'd much rather be able to get this way working, if possible. Let me know if you know :D
« Last Edit: June 09, 2016, 09:55:23 PM by Jervan »

Show us your code for displaying this bitmap.

Code: [Select]
function serverCmdUItest(%client)
{
   for(%i = 0; %i < 10; %i++)
   {
      %message = %message @ "<bitmap:add-ons/r_fish/w>";
   }
   commandToClient(%client,'centerPrint',"<font:impact:32>\c6Keep the hook on the fish!\n<just:center>" @ %message @ "\n\c0<just:left>< \c6Left click<just:right>Right click \c0>",-1);
}

Yes. I'm pretty sure the limit 255 characters.

Due to the character limit I can get up to 6 bitmaps shown, but the linearity is weird. Also, the messaging itself has weird formatting.


Can anyone lend a machete to my intellectual thicket?

remove the instructions and only display the bitmaps. display the instructions before the minigame instead

you could possibly put the instructions as a bottomprint

Bottomprint is needed for other RPG information unfortunately. I've managed to get it working, it's just about making it look nice and coding around the weird linearity now (1st bitmap is middle, 2nd bitmap is 2nd last from left etc). Had to scrap the progress bar for catching the fish but I'll just try and be clever with the sound design. Thanks for the suggestions :)

you can't have more than 6 bitmaps in a centerprint/bottomprint/chat message

I've managed to get 7 which is plenty for my needs :D

you can't have more than 6 bitmaps in a centerprint/bottomprint/chat message
no

you can't have more than 6 bitmaps in a centerprint/bottomprint/chat message

The only restriction is that you can't have more than 255 characters.

The only restriction is that you can't have more than 255 characters.
Which means you can get a max of 25(ish?) bitmaps.

Ty for the help, here is a vid of it partially working (without sounds, animations or nice bitmaps). With bonus footage of the barber shop cause I realised I was bald :D

https://www.youtube.com/watch?v=aauF3rMQ_RM&feature=youtu.be