How to change the opacity of a npc?

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

Prado M
Topic author, Honourable citizen
Honourable citizen
Avatar
Prado M
Topic author, Honourable citizen
Honourable citizen
Age: 18
Reputation: 2
Posts: 49
Joined: 14 Sep 2015
Location: Brazil

Post #1by Prado » 4 Jan 2018, 13:56

Is there any code that let me change the opacity of a npc? Also, how to make the npc hurt only if at 100% opacity?
Discord server to play SMBX online via Parsec!

https://discord.gg/FftYYMv

Yoshi021 M
Moderator
Moderator
Avatar
Yoshi021 M
Moderator
Moderator
Age: 18
Reputation: 120
Posts: 667
Joined: 15 Feb 2016
Location: Yoshi's Island

Post #2by Yoshi021 » 13 Jan 2018, 0:07

Try

Code: Select all

NPC(index).forecolor = rgba(255, 255, 255, OPACITY)
Links
ImageImageImage
Image
Image
"Going to University is FUN!" :pardon:

Prado M
Topic author, Honourable citizen
Honourable citizen
Avatar
Prado M
Topic author, Honourable citizen
Honourable citizen
Age: 18
Reputation: 2
Posts: 49
Joined: 14 Sep 2015
Location: Brazil

Post #3by Prado » 14 Jan 2018, 16:36

Yoshi021 wrote:Try

Code: Select all

NPC(index).forecolor = rgba(255, 255, 255, OPACITY)

It doesn't work, or I am doing something wrong.

I found another solution using LSet, works fine. But I still would aprecciate other solutions :D
Discord server to play SMBX online via Parsec!

https://discord.gg/FftYYMv

Yoshi021 M
Moderator
Moderator
Avatar
Yoshi021 M
Moderator
Moderator
Age: 18
Reputation: 120
Posts: 667
Joined: 15 Feb 2016
Location: Yoshi's Island

Post #4by Yoshi021 » 14 Jan 2018, 22:09

Opacity should be a value between 0-255. If you attached a script to an NPC, you can do this:

Code: Select all

with NPC(sysval(param1))
  .forecolor = rgba(255, 255, 255, OPACITY)
end with
Links
ImageImageImage
Image
Image
"Going to University is FUN!" :pardon:

Prado M
Topic author, Honourable citizen
Honourable citizen
Avatar
Prado M
Topic author, Honourable citizen
Honourable citizen
Age: 18
Reputation: 2
Posts: 49
Joined: 14 Sep 2015
Location: Brazil

Post #5by Prado » 25 Jan 2018, 23:57

Yoshi021 wrote:Opacity should be a value between 0-255. If you attached a script to an NPC, you can do this:

Code: Select all

with NPC(sysval(param1))
  .forecolor = rgba(255, 255, 255, OPACITY)
end with

Thanks it works :D
Discord server to play SMBX online via Parsec!

https://discord.gg/FftYYMv


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest