Open a slice collection in one script and lose it on another one

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
bis_senchi
Red Slime
Posts: 64
Joined: Sat Apr 20, 2019 8:59 am

Open a slice collection in one script and lose it on another one

Post by bis_senchi »

Hello!

It's good to be back after a year and a half without posting! I've donwloaded the lastest version and it was :kamina: super awesome! The progress
made since the first versions of the engine more 10 years ago ais incredible!

Among other things the number of NPCS you can put on a map compared to the previous versions is incomparable! There are almost no bugs anymore and you can do so much things with the menus and the slice collections!

I came back because, as always, I have a question about slice collection and buffering. My problem is the following: I loaded a slice collection as usual with the load collection command and a global variable but when I want to close it down using the clear string command it doesn't work.

I need a command which is a like find menu ID but for slice collection. Let me explain the command/ lines of command would check is the collection is on screen and return true if it is. Then thanks to global variables, I could take control of the slice collection again.

It would allow me to make appear/launch the 'shop slice collection' on a script and making it disappear using the clear string function on another one. Just like you would do with a menu! Is there a way to do that?

Another point( may be linked to my problem) is that when I put my slice collection on screen (slice collection 13) I also had another one: slice collection 3 on screen. Slice collection 13 is for customized shop menu and slice collection 3 is for a statut handmade menu (with HP & MP bar and a portait)

That would be great if I could have those two launched at the same time. The problem is likely to be with the buffer. If I remember correctly the buffer can't memorise more than one string at a time. Of course I'm using different globlal variables to manipulate my slice collections. Does that help?

Thanks for the help!
User avatar
Feenicks
Metal Slime
Posts: 696
Joined: Tue Aug 10, 2010 9:23 pm
Location: ON THE AIR IN THE AIR
Contact:

Re: Open a slice collection in one script and lose it on another one

Post by Feenicks »

Strings? You should be using

Code: Select all

free slice (slice)
to free the slices, and also potentially use multiple global variables to deal with multiple collections of slices.
bis_senchi
Red Slime
Posts: 64
Joined: Sat Apr 20, 2019 8:59 am

Re: Open a slice collection in one script and lose it on another one

Post by bis_senchi »

Thanks Feenicks for your answer!!

My problems came from the confusion between free slice and clear string. I was using clear string, so indeed it couldn't make disappear my slice collection. After some checks, it appears that buffer problems what comes from when we want to append text on strings though strings, not slice.
I changed the line in my hss file and now it works very well :D

I nice to know that we can have as several slice collections on screen at the same time as long as we give then their own global variables!

Now, I would like to my knowledge of slice collections and sprites. Here are my problems. I'm trying to make a slice collection so that the player can choose in which language he/she is going to play my game.

Image

I've made flags and a cursors. My big problem is the following. I load my slice collection and then what I am supposed to do?

I would like to learn to how to move my cursor from flag to flag and make the player with his/her choice.

As always, thanks in advance for the help!
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Re: Open a slice collection in one script and lose it on another one

Post by TMC »

Did you get answers to all your questions here on Discord? I didn't read everything that was said there.

However your question about creating a menu and moving the cursor is nearly the same as what you asked in a previous thread about a slice menu with a cursor. (Unfortunately since then a forum upgrade has mangled all the scripts posted there.) I think we also helped with the scripts in Discord. If you still have any of your scripts from that menu have you tried adapting them to the new one?

Also, I don't know what you mean by a string "buffer", but I think you're mistaken.
bis_senchi wrote: Sat Sep 03, 2022 7:55 am Among other things the number of NPCS you can put on a map compared to the previous versions is incomparable! There are almost no bugs anymore and you can do so much things with the menus and the slice collections!
Actually, the limit on NPCs per map is still 300! That limit badly needs to be removed. However you can now define more than 36 NPC types.
bis_senchi
Red Slime
Posts: 64
Joined: Sat Apr 20, 2019 8:59 am

Re: Open a slice collection in one script and lose it on another one

Post by bis_senchi »

Thanks TMC for your answer on both on this forum and on the discord! Sorry for asking so many questions :angel: On discord I asked commands utilisation regarding to fake text box making for and my church script.

This question is a bit different. It's about creating a menu (= made from a slice collection) to make the player able to choose the language. I made a slice collection this time. I have no problems with making the basic. Creating the collection and adding the slices lookup code. The main problem is cursor behaviour and it's relation to key. I already had this kind of problem when I was trying to make a car menu for my YuGiOh! game.

As it is a bit difficult to post large scripts on discord, I decided to put this one on the slime forum. So? Would you have any advices on how to manipulate
slices graphics on a slice collection by pressing keys?
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Re: Open a slice collection in one script and lose it on another one

Post by Bob the Hamster »

I decided to make a tutorial for this.



The script file is available here: viewtopic.php?p=142022#p142022
bis_senchi
Red Slime
Posts: 64
Joined: Sat Apr 20, 2019 8:59 am

Re: Open a slice collection in one script and lose it on another one

Post by bis_senchi »

Thanks you very much. So basically I need to focus on while loop and how to mkae while loop inside another one :zombie: That's gonna be tough.
I've downloaded the video and will follow your steps carefully. I may come back if I have problems calculating slice positions...

I noticed that you posted a new version of Wandering Hasmter. Congratulations! I haden't the recent version and I was surprised that you had been replaced by Misa... Capitain Icefeather and her crew seem to be very interesting characters. I've noted down the little problems as I played so that it may help you for fixing. I put them in a private message for you. I've also included some suggestions for the plot.

Thanks again and have a nice day!
Post Reply