Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Be able to change object color

Give us your input on how we may improve the ScriptAPI in the game in future versions.
Forum rules
By using the forum you agree to the following rules.
Post Reply
Hoang Marcel
Superfighter
Superfighter
Posts: 62
Joined: Sun Mar 20, 2016 3:40 am
Title: Custom map lover
Started SFD: PreAlpha 1.6.4
Location: Vietnam
Gender:

Be able to change object color

Post by Hoang Marcel » Wed May 18, 2016 11:37 am

How do you create color object through scripting?

Game.CreateObject("BgWall00B",Position);
1 x

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 24

Post by Motto73 » Thu May 19, 2016 7:45 am

Hi Hoang!

I think that you are able to change the object via script by setting that wall into a variable.

IObject wall = Game.CreateObject("BgWall00B",Position);
wall.Color = Color(r,g,b); //red, green, blue

Not sure if it only works in text. Give it a try!

For more information:

Read the Script Api_ Color Struct Reference.


And by the way, you have made some great maps! I like them.
0 x
Image

Hoang Marcel
Superfighter
Superfighter
Posts: 62
Joined: Sun Mar 20, 2016 3:40 am
Title: Custom map lover
Started SFD: PreAlpha 1.6.4
Location: Vietnam
Gender:

Post by Hoang Marcel » Thu May 19, 2016 2:13 pm

Thank you Motto!
1 x

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 24

Post by Motto73 » Mon May 23, 2016 10:03 am

Nope. :)

Waiting for your new maps!
0 x
Image

Juansero29
Fighter
Fighter
Posts: 52
Joined: Sun Jun 12, 2016 1:07 am
Title: Superfighter
SFD Account: Juansero29
SFD Alias: Juansero29
Started SFD: Pre-Alpha 1.0.5
Location: France
Gender:
Age: 25
Contact:

Post by Juansero29 » Thu Mar 30, 2017 11:54 pm

Has anyone gotten the answer for this question yet? I need it too in order to create colored ballons in a function called by a trigger. Please, any hint could help!
0 x

Code: Select all

boom() {
  echo "BOOM!";			
}
BOOM!
----------------------------------------
Setting the world free since 1998
----------------------------------------

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Fri Mar 31, 2017 12:16 am

Juansero29 wrote:Has anyone gotten the answer for this question yet? I need it too in order to create colored ballons in a function called by a trigger. Please, any hint could help!
Today is not possible to spawn an object with color parameters, even not to set it after it's created, currently there's not really nothing to handle color with the IObject class, It's a bit weird that no one have suggested nothing like this so far, I'm going to post this in the script suggestions.
2 x

Juansero29
Fighter
Fighter
Posts: 52
Joined: Sun Jun 12, 2016 1:07 am
Title: Superfighter
SFD Account: Juansero29
SFD Alias: Juansero29
Started SFD: Pre-Alpha 1.0.5
Location: France
Gender:
Age: 25
Contact:

Post by Juansero29 » Fri Mar 31, 2017 12:20 am

JakSparro98 wrote:
Juansero29 wrote:Has anyone gotten the answer for this question yet? I need it too in order to create colored ballons in a function called by a trigger. Please, any hint could help!
Today is not possible to spawn an object with color parameters, even not to set it after it's created, currently there's not really nothing to handle color with the IObject class, It's a bit weird that no one have suggested nothing like this so far, I'm going to post this in the script suggestions.

Thanks for answering! Yes, I think it's indeed very important. It would be a great functionality to have in the future.
0 x

Code: Select all

boom() {
  echo "BOOM!";			
}
BOOM!
----------------------------------------
Setting the world free since 1998
----------------------------------------

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Fri Mar 31, 2017 9:10 pm

You can't change the color of an object today. It's part of the planned ScriptAPI changes.
2 x
Gurt

Post Reply