Help with star

Need help with any SMBX game-related issues? Ask your questions here.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on-topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Amine1542
Goomba
Goomba
Posts: 4
Joined: Thu Nov 02, 2017 8:08 pm
Chat Username: Super Rookie

Help with star

Postby Amine1542 » Thu Nov 02, 2017 8:21 pm

Hello everyone, I'm creating a game based on Mario Odyssey (which I like a lot), however, when I created my first level (with 20 stars), stars do not count while some account but my score star can not exceed 4 stars. Is there a limit of stars per level where is it a technical problem? I put in the World Map the total number of stars to pick up (550)
Thank you for your help...

User avatar
PixelPest
Edward
Edward
Posts: 7051
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Help with star

Postby PixelPest » Thu Nov 02, 2017 11:24 pm

You can only have one star per section. I'd suggest using a different collectable

User avatar
Natsu
Ludwig von Koopa
Ludwig von Koopa
Posts: 2898
Joined: Sat Dec 21, 2013 2:40 pm
Current Project: It's a secret to everybody ...
Location: Uruguay
Chat Username: Kuma-san

Re: Help with star

Postby Natsu » Fri Nov 03, 2017 9:22 am

In order to have multiple stars in the same section you would need to use a different NPC that triggers an event upon death, which has to be unique for each star. By this I mean that the event triggered after collecting a star should not be triggered after getting another star. Each of them need a unique event to work with. You must also attach each star to a unique layer attributed to only one, same as with the event.

Moving on to Lua, capture the triggered event, and raise the star count accordingly. Afterwards hide the specific layer to which the specific star was attached to and voila! You hace multiple stars in one section.
Discord quotes
Trace: You're a capable boi

User avatar
PixelPest
Edward
Edward
Posts: 7051
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Location: Canada, Eh?
Chat Username: PixelPest
Contact:

Re: Help with star

Postby PixelPest » Fri Nov 03, 2017 9:28 am

NaviGator wrote:Moving on to Lua, capture the triggered event, and raise the star count accordingly. Afterwards hide the specific layer to which the specific star was attached to and voila! You hace multiple stars in one section.
Actually don't do this in LunaLua. Changing the star count can break save files iirc. Instead, you would save your own star count via the Data class, increasing it when a new star NPC is collected. You can draw it to the HUD making it appear just like the normal star count

User avatar
Natsu
Ludwig von Koopa
Ludwig von Koopa
Posts: 2898
Joined: Sat Dec 21, 2013 2:40 pm
Current Project: It's a secret to everybody ...
Location: Uruguay
Chat Username: Kuma-san

Re: Help with star

Postby Natsu » Fri Nov 03, 2017 9:35 am

If that's the case then yes, don't raise it manually. You will have to use another NPC though.
Discord quotes
Trace: You're a capable boi

Amine1542
Goomba
Goomba
Posts: 4
Joined: Thu Nov 02, 2017 8:08 pm
Chat Username: Super Rookie

Re: Help with star

Postby Amine1542 » Fri Nov 03, 2017 12:09 pm

First of all, I thank you for your answers but I did not really understand your answers, I did not really understand this event story with the stars... Some stars disappear from the level while I put them well

User avatar
Natsu
Ludwig von Koopa
Ludwig von Koopa
Posts: 2898
Joined: Sat Dec 21, 2013 2:40 pm
Current Project: It's a secret to everybody ...
Location: Uruguay
Chat Username: Kuma-san

Re: Help with star

Postby Natsu » Fri Nov 03, 2017 12:56 pm

Events and layers are SMBX tools. You can read about them here, in the fourth and fifth spoiler tags: viewtopic.php?f=35&t=10507

Lua is a coding language that allows you to do a ton of things impossible to do in vanilla SMBX. In case you want to learn coding and I suggest you do, check here under 'Tutorial': http://wohlsoft.ru/wiki/index.php?title ... unaLua_API
Discord quotes
Trace: You're a capable boi

Amine1542
Goomba
Goomba
Posts: 4
Joined: Thu Nov 02, 2017 8:08 pm
Chat Username: Super Rookie

Re: Help with star

Postby Amine1542 » Fri Nov 03, 2017 3:02 pm

Thanks I know use layers and events but I ask about problem with stars :(

User avatar
Natsu
Ludwig von Koopa
Ludwig von Koopa
Posts: 2898
Joined: Sat Dec 21, 2013 2:40 pm
Current Project: It's a secret to everybody ...
Location: Uruguay
Chat Username: Kuma-san

Re: Help with star

Postby Natsu » Fri Nov 03, 2017 3:38 pm

I will try to explain it again as well as possible.

First of all, you need Lua to do this, so you have to learn Lua. Go to my previous post and click on the link that takes you to the wikia. Learn it, then come back.

All set? Good.

You want to make collectable stars. Once the player gets these stars the star count will go up, showing the player the total amount of stars he collected thus far. All good up to this point, right? This is an inhereted feature of SMBX, but for some reason, whether it be because Redigit couldn't figure out how to program it in a different way or he intended for it to work that way, you can't place two stars in the same section because once you test the level one will always desappear. You are not allowed to have multiple stars in one section, at least not in vanilla SMBX.

However, there is a workaround that requires you to use Lua, the coding language I just mentioned. You need to recreate the star system working the same way as it does on vanilla SMBX but without that dumb limitation. To do this you need to understand how the stars work on vanilla SMBX, which I explained on the first paragraph of this post. Now to the most entertaining part, to create.

We need and NPC to replace the star NPC altogether. This is because the way the regular stars work don't allow for multiple stars in one section. My suggestion is to use the SMB1 Axe, it plays no sound and allows to work with events and layers, perfect candidate. All you have to do is replace the star graphic with the axe graphic and add a npc modifier with npc codes to change the specifics of the axe entity. You can see how to do it here: viewtopic.php?f=35&t=425&hilit=nogravity (go to npc codes)

Cool, we have succesfuly replaced the entity for out star. Let's move on to the system. Each star throughout the game works as a separate entity. Let's say you have level 1 which has three stars. You collect the first one and you can see on the HUD "*star icon* = 1" showing you have collected one star thus far. Since we are not relying on SMBX's default star system anymore we need to print that to screen ourselves. I could go on about how you can show it, the aesthetics that you should use and such, but this is really something you should do on your own. Design how you want it to appear on the HUD, how does it keep track of the stars, does it show a star icon or image somewhere on the screen with numbers next to it? Or maybe there are three empty star slots that fill in as you collect stars. Go crazy.

I can't really explain it all here. It would take me at least two hours to explain everything and this post has gotten big enough as it is. What I can tell you is that you need the following:
  • Graphics for the new star counter.
  • A custom API to hold information on the stars the player has collected.
  • Events that trigger upon each star death. You must use a different event for each star death.
  • A layer for each star. Each and every star must be attached to one layer, and each layer must only be attached to one star.
I know I don't say much, but I really can't nor want to spend that much time or words here when it all boils down to learn the basics of SMBX and Lua. I hope you manage to make this work. Or you could always get a programmer for your episode. Anyway, good luck.
Discord quotes
Trace: You're a capable boi

User avatar
The0x539
Nipper Plant
Nipper Plant
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm
Current Project: SMBX2

Re: Help with star

Postby The0x539 » Fri Nov 03, 2017 4:55 pm

NaviGator wrote:Cool, we have succesfuly replaced the entity for out star. Let's move on to the system. Each star throughout the game works as a separate entity. Let's say you have level 1 which has three stars. You collect the first one and you can see on the HUD "*star icon* = 1" showing you have collected one star thus far. Since we are not relying on SMBX's default star system anymore we need to print that to screen ourselves. I could go on about how you can show it, the aesthetics that you should use and such, but this is really something you should do on your own. Design how you want it to appear on the HUD, how does it keep track of the stars, does it show a star icon or image somewhere on the screen with numbers next to it? Or maybe there are three empty star slots that fill in as you collect stars. Go crazy.
For what it's worth, it might be worthwhile to just change the number displayed up there (stored in global offset 0x00B251E0 as a FIELD_WORD) to what it "should" be in onDraw, and then change it back (so as to not break saves) in onDrawEnd, before anything other than drawing it is done to it.

Amine1542
Goomba
Goomba
Posts: 4
Joined: Thu Nov 02, 2017 8:08 pm
Chat Username: Super Rookie

Re: Help with star

Postby Amine1542 » Fri Nov 03, 2017 6:03 pm

First of all thank you very much for having taken the trouble to answer me with such a long pad. Regarding the problem with the stars, I understood that it was because of the system of sections and I intend to start learning the APIs, otherwise I know that I could always use a stars by sector. But thanks for your answer, things are clearer and I know I could always count on the forum to answer my questions. Thank you everyone

User avatar
Natsu
Ludwig von Koopa
Ludwig von Koopa
Posts: 2898
Joined: Sat Dec 21, 2013 2:40 pm
Current Project: It's a secret to everybody ...
Location: Uruguay
Chat Username: Kuma-san

Re: Help with star

Postby Natsu » Fri Nov 03, 2017 7:46 pm

The0x539 wrote:
NaviGator wrote:Cool, we have succesfuly replaced the entity for out star. Let's move on to the system. Each star throughout the game works as a separate entity. Let's say you have level 1 which has three stars. You collect the first one and you can see on the HUD "*star icon* = 1" showing you have collected one star thus far. Since we are not relying on SMBX's default star system anymore we need to print that to screen ourselves. I could go on about how you can show it, the aesthetics that you should use and such, but this is really something you should do on your own. Design how you want it to appear on the HUD, how does it keep track of the stars, does it show a star icon or image somewhere on the screen with numbers next to it? Or maybe there are three empty star slots that fill in as you collect stars. Go crazy.
For what it's worth, it might be worthwhile to just change the number displayed up there (stored in global offset 0x00B251E0 as a FIELD_WORD) to what it "should" be in onDraw, and then change it back (so as to not break saves) in onDrawEnd, before anything other than drawing it is done to it.
I don't know how changing the value of the star count can break saves nor if something like what you have just mentioned wouldn't do it. It was a natural conclussion to entirely remake the star system for me because it is reliable and fun to do.
Discord quotes
Trace: You're a capable boi

User avatar
The0x539
Nipper Plant
Nipper Plant
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm
Current Project: SMBX2

Re: Help with star

Postby The0x539 » Fri Nov 03, 2017 8:35 pm

NaviGator wrote:
The0x539 wrote:
NaviGator wrote:Cool, we have succesfuly replaced the entity for out star. Let's move on to the system. Each star throughout the game works as a separate entity. Let's say you have level 1 which has three stars. You collect the first one and you can see on the HUD "*star icon* = 1" showing you have collected one star thus far. Since we are not relying on SMBX's default star system anymore we need to print that to screen ourselves. I could go on about how you can show it, the aesthetics that you should use and such, but this is really something you should do on your own. Design how you want it to appear on the HUD, how does it keep track of the stars, does it show a star icon or image somewhere on the screen with numbers next to it? Or maybe there are three empty star slots that fill in as you collect stars. Go crazy.
For what it's worth, it might be worthwhile to just change the number displayed up there (stored in global offset 0x00B251E0 as a FIELD_WORD) to what it "should" be in onDraw, and then change it back (so as to not break saves) in onDrawEnd, before anything other than drawing it is done to it.
I don't know how changing the value of the star count can break saves nor if something like what you have just mentioned wouldn't do it. It was a natural conclussion to entirely remake the star system for me because it is reliable and fun to do.
Oh, still have your own system for keeping track of it, just hook into vanilla's means of displaying it.

User avatar
Natsu
Ludwig von Koopa
Ludwig von Koopa
Posts: 2898
Joined: Sat Dec 21, 2013 2:40 pm
Current Project: It's a secret to everybody ...
Location: Uruguay
Chat Username: Kuma-san

Re: Help with star

Postby Natsu » Fri Nov 03, 2017 8:44 pm

The0x539 wrote:Oh, still have your own system for keeping track of it, just hook into vanilla's means of displaying it.
What? Oh, you mean to make it anyway and share it with the community?
Discord quotes
Trace: You're a capable boi

Gabs Dilly
Goomba
Goomba
Posts: 1
Joined: Mon Feb 11, 2019 9:38 am
Flair: My Super Mario Game
Chat Username: Gabs Dill

Re: Help with star

Postby Gabs Dilly » Mon Feb 11, 2019 9:52 am

I also have a problem! I'm creating a game based in SM64, but I can't put the number of stars needed to enter in a level, how do I put the star?

User avatar
Cedur
Blue Yoshi Egg
Blue Yoshi Egg
Posts: 3532
Joined: Tue Jun 28, 2016 10:14 am
Flair: Non mi avete fatto niente
Current Project: episode pages for the wiki
Location: Karlsruhe, Germany

Re: Help with star

Postby Cedur » Mon Feb 11, 2019 10:15 am

You have a hub, right? If you place a warp to enter a level there's a field called "stars required" or the like where you put in the number of stars
Image

Supports: show
Image
Image
Image
Image

Image

I believe in three 72 mm large, 690 g heavy iron balls as my lords and saviours.

Still using the legacy editor? Get SMBX2 and PGE, it will improve your experience significantly. Here's why.

iphtechnologies wrote: NEO super mario world x is a really nice game. This Episode is 2,7 GB large at the moment.That`s crazy!
Please find similar post:
[ads]

If you're not smart enough to plan ahead, then DOOM ON YOU!


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 8 guests