Coin count script/event

Description: Internal scripting system of SMBX-38A Engine based on the simple VB-like language
Moderators: Lx Xzit, Yoshi021, 5438A38A, Moderators, Semi-moderatos

Bulletbill510 M
Topic author, Good citizen
Good citizen
Bulletbill510 M
Topic author, Good citizen
Good citizen
Age: 20
Reputation: 6
Posts: 22
Joined: 17 May 2017

Post #1by Bulletbill510 » 3 Jul 2018, 22:39

I don't know if anyone has done this yet for a SMBX level but I was thinking of doing some kind of script in which an event is activated after collecting a certain amount of coins. These levels I might make will be based off of NSMB2 coin rush where you see how many coins you can collect, but in these levels I might make in the future, the player must collect a certain amount of coins in order for a star or exit to appear to beat the stage. But if there already is something in the editor that does that, then I guess I'll try other ways as well?
Note: I also forgot to mention that I was gonna think of script to make the coin counter go past 100 coins but not earn a 1-up so the player would have to collect a large amount of coins in my coin rush levels.
Feel free to visit my Youtube channel! Bulletbill510 :)

Lx Xzit M
Moderator
Moderator
Avatar
Lx Xzit M
Moderator
Moderator
Reputation: 216
Posts: 498
Joined: 9 Nov 2015
Website

Post #2by Lx Xzit » 4 Jul 2018, 0:03

Use this code to increase the amount of coins the player needs to gain an 1-up:

Code: Select all

sysval(coinsforextralife)


This variable lets you keep track of your current coins:

Code: Select all

sysval(coincount)


For example if you want a Star appears when the player got 200 coins (let's set the max limit of coins at 500), you should do a code like this:

Code: Select all

sysval(coinsforextralife) = 500
do
   if sysval(coincount) => 200 then
      call ncreate([parameters goes here])
      exit do
   end if
   call sleep(1)
loop


This script must be triggered through an event. This is only an example but you could do it in other ways (all through scripting)
[size=100][b]VISIT MY YOUTUBE CHANNEL![/b] [url=https://www.youtube.com/channel/UC_AcXEExdYtaydxcCVPSGoQ]LX XZIT[/url][/size]
[size=100]Join our 38A Discord server! [url= https://discord.gg/7hCmNBE]CLICK HERE[/url][/size]


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest