Overall coin count

Description: Have idea for a script, but you can't make it? Post it here!
Moderators: Yoshi021, Lx Xzit, 5438A38A, Semi-moderatos, Moderators

Spectra
Topic author, Duke
Duke
Avatar
Spectra
Topic author, Duke
Duke
Age: 19
Reputation: 6
Posts: 125
Joined: 30 Jan 2018
Location: The dream star
YouTube

Post #1by Spectra » 29 Apr 2018, 18:47

Is it possible to make the coin count go over 100 and stop at 9999 and stay the same through the whole episode?
also, when you talk to an npc you lose a certain amount of coins?
-No interesting comments here-

Alvespires M
Count
Count
Avatar
Alvespires M
Count
Count
Age: 19
Reputation: 17
Posts: 227
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #2by Alvespires » 29 Apr 2018, 19:03

With the normal coins, as I know, there's no way since they're System Variables.

But, you can create your own Global Variable and incresse it by 1 everytime you collect one of your currency( Not normal coins, because then you would still get 1 up every 100 coins, but can be used if you don't care about this) , then, a Script that actives upon talking to someone and that lowers this Global Variable.

And, maybe a Custom HUD to show how many coins the player has.
"This giant fish is a mouth breeder, so it spits babies out of its mouth at Mario." - Nintendo Power Strategy Guide for Super Mario Bros. 3

I didn't left this forum. I still come here every in a while but I don't really have anything to say.

I think I also probably lost it.

I'm supporting:

Spoiler

Image

Spectra
Topic author, Duke
Duke
Avatar
Spectra
Topic author, Duke
Duke
Age: 19
Reputation: 6
Posts: 125
Joined: 30 Jan 2018
Location: The dream star
YouTube

Post #3by Spectra » 29 Apr 2018, 19:56

Alvespires wrote:But, you can create your own Global Variable and incresse it by 1 everytime you collect one of your currency( Not normal coins, because then you would still get 1 up every 100 coins, but can be used if you don't care about this) , then, a Script that actives upon talking to someone and that lowers this Global Variable.

And, maybe a Custom HUD to show how many coins the player has.

Could anyone do it for me?
I suck at scripting...

Code: Select all

'initialize,0,0,0,0,0,0,0,0,0
call hudset("initialize",0,0,0,0,0,0,0,0,0)
'!!!!!!!!!!bitmap source = "scflash.png"!!!!!!!!!!
'bitmap,id,sourcex,sourcey,width,height,destx,desty,advset,-1
'text:text,id,destx,desty,startasc,endasc,lnum,npcid,-1,-1
call hudset("bitmap",1,0,0,780,102,10,10,0,-1)
'variables
'Contador de Monedas.
call hudset("text:&gv(Coins)",2,86,70,48,57,1,213,-1,-1)
'Puntaje
call hudset("text:&sys(score)",3,694,18,48,57,1,213,-1,-1)
'Contador de Vidas
call hudset("text:&sys(starcount)",4,80,18,48,57,1,213,-1,-1)
'Caja con Objeto
Call hudset("bitmap",5,316,72,56,56,372,16,0,-1)
Call hudset("bitmap",6,0,0,100,100,384,28,5001,-1)
'Monedas Estrella
call hudset("bitmap",7,780,0,14,16,300,42,6000,-1)
call hudset("bitmap",8,780,0,14,16,318,42,6001,-1)
call hudset("bitmap",9,780,0,14,16,336,42,6002,-1)

this is the custom hud script that i'm using, but the global variable amount (0) isn't showing up
-No interesting comments here-

Alvespires M
Count
Count
Avatar
Alvespires M
Count
Count
Age: 19
Reputation: 17
Posts: 227
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #4by Alvespires » 30 Apr 2018, 3:06

Global Variables can only be used on Game itself. It means: no level editor. See at your Episode itself if the HUD works.

Bigadre wrote:Could anyone do it for me?
I suck at scripting...

Huge tutorial below:

Spoiler
Create a global Variable.

On EVERY LEVEL THAT THERE'S COINS, create a event that calls this one script:

gval(name of the variable) = gval(name of the variable) + 1

EVERY COIN must have a "Death" event to that one Script.

Now, to take those coins you basically use the same script but instead of + you use - and the number of coins you want to take( and of couse, change the trigger). Done.

If you want to make a limit of coins (like 9999 coins max) you also need an "If" statment to make the script only activate while below that number.

Code: Select all

   If gval(nameofthevariable) < (limit of coins you wish (without the parentessis)) Then



If you use that, you must place an End If at the end of your script ( because you will be using an if statment and it will crash if it doesn't end)

Just place this at the last line:

End if


If some problem happens, reply this post with the error and I'll try to find what's wrong.
"This giant fish is a mouth breeder, so it spits babies out of its mouth at Mario." - Nintendo Power Strategy Guide for Super Mario Bros. 3

I didn't left this forum. I still come here every in a while but I don't really have anything to say.

I think I also probably lost it.

I'm supporting:

Spoiler

Image

Spectra
Topic author, Duke
Duke
Avatar
Spectra
Topic author, Duke
Duke
Age: 19
Reputation: 6
Posts: 125
Joined: 30 Jan 2018
Location: The dream star
YouTube

Post #5by Spectra » 30 Apr 2018, 9:24

Alvespires wrote:
Spoiler
Create a global Variable.

On EVERY LEVEL THAT THERE'S COINS, create a event that calls this one script:

gval(name of the variable) = gval(name of the variable) + 1

EVERY COIN must have a "Death" event to that one Script.

Now, to take those coins you basically use the same script but instead of + you use - and the number of coins you want to take( and of couse, change the trigger). Done.

If you want to make a limit of coins (like 9999 coins max) you also need an "If" statment to make the script only activate while below that number.

Code: Select all

   If gval(nameofthevariable) < (limit of coins you wish (without the parentessis)) Then



If you use that, you must place an End If at the end of your script ( because you will be using an if statment and it will crash if it doesn't end)

Just place this at the last line:

End if

so do i do

Code: Select all

If gval(Coins) < 9999 Then
gval(coins) = gval(coins) + 1
End If


Then activate it using events

Then make a npc death scipt
(is it

Code: Select all

Npckill

or

Code: Select all

Nkill

?

then put that to behavior

The coin count races up, then stops when i get a coin
-No interesting comments here-

Alvespires M
Count
Count
Avatar
Alvespires M
Count
Count
Age: 19
Reputation: 17
Posts: 227
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #6by Alvespires » 30 Apr 2018, 16:39

Bigadre wrote:so do i do

Code: Select all

If gval(Coins) < 9999 Then
gval(coins) = gval(coins) + 1
End If

Yeah. This is to add 1 coin everytime you have less than 9999 coins.


Bigadre wrote:Then activate it using events

Then make a npc death scipt
(is it

Code: Select all

Npckill

or

Code: Select all

Nkill

?

then put that to behavior

No. You don't need to call NKill. You trigger the first event simply using this, replacing the "Add Coin" to whatever the Script is called.

Spoiler
Image


But, of course. You don't NEED to use a Dragon Coin. Anything will do.
"This giant fish is a mouth breeder, so it spits babies out of its mouth at Mario." - Nintendo Power Strategy Guide for Super Mario Bros. 3

I didn't left this forum. I still come here every in a while but I don't really have anything to say.

I think I also probably lost it.

I'm supporting:

Spoiler

Image

Spectra
Topic author, Duke
Duke
Avatar
Spectra
Topic author, Duke
Duke
Age: 19
Reputation: 6
Posts: 125
Joined: 30 Jan 2018
Location: The dream star
YouTube

Post #7by Spectra » 30 Apr 2018, 18:25

Alvespires wrote:
Bigadre wrote:so do i do

Code: Select all

If gval(Coins) < 9999 Then
gval(coins) = gval(coins) + 1
End If

Yeah. This is to add 1 coin everytime you have less than 9999 coins.


Bigadre wrote:Then activate it using events

Then make a npc death scipt
(is it

Code: Select all

Npckill

or

Code: Select all

Nkill

?

then put that to behavior

No. You don't need to call NKill. You trigger the first event simply using this, replacing the "Add Coin" to whatever the Script is called.

Spoiler
Image


But, of course. You don't NEED to use a Dragon Coin. Anything will do.

Thank you, it works
-No interesting comments here-


Return to “Script requests”

Who is online (over the past 5 minutes)

Users browsing this forum: 6 guests