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.

Color spawned objects?

Share questions and tutorials related to the map editor. Share you maps in the Superfighters Deluxe Custom Maps section.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Tuesday
Meatbag
Posts: 9
Joined: Tue Oct 02, 2018 4:39 am
Title: Incompetent Hyena
SFD Account: Tuesday
Started SFD: September 2016
Location: East Coast USA
Gender:

Color spawned objects?

Post by Tuesday » Mon Dec 30, 2019 4:28 am

I'm sure there's something very basic I'm missing.

Okay, so, like, SpawnObjectTrigger spawns objects. Trigger.

How do I change the color of the spawned object?

Also is there another way to make a BgTelevision "turn on" that's better than putting 00A on top of 00B?

thank n luv
0 x
Don't mind me, I'm just a humble mongoloid wrangler.
Subscribe to Tuesday on YouTube.

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 » Mon Dec 30, 2019 4:50 pm

See the ScriptAPI section for the IObject. GetColorPaletteName(), GetColor1(), GetColor2(), GetColor3(), SetColors(...), SetColor1(...), SetColor2(...), SetColor3(...)

"Also is there another way to make a BgTelevision "turn on" that's better than putting 00A on top of 00B?", I think that's the best way of doing it.
0 x
Gurt

User avatar
Tuesday
Meatbag
Posts: 9
Joined: Tue Oct 02, 2018 4:39 am
Title: Incompetent Hyena
SFD Account: Tuesday
Started SFD: September 2016
Location: East Coast USA
Gender:

Post by Tuesday » Wed Jan 01, 2020 1:40 am

Gurt wrote:
Mon Dec 30, 2019 4:50 pm
See the ScriptAPI section for the IObject. GetColorPaletteName(), GetColor1(), GetColor2(), GetColor3(), SetColors(...), SetColor1(...), SetColor2(...), SetColor3(...)

"Also is there another way to make a BgTelevision "turn on" that's better than putting 00A on top of 00B?", I think that's the best way of doing it.
Okay, I hope you don't mind dealing with incompetent people.

I'mma keep it real with you, chief, I don't know jack about scripting. So, uh, how do I do what you just said?

All I know about is pointing the arrows and the triggers and stuff, so a step by step would be greatly appreciated. Thank you!
0 x
Don't mind me, I'm just a humble mongoloid wrangler.
Subscribe to Tuesday on YouTube.

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 » Wed Jan 01, 2020 11:55 am

See https://www.mythologicinteractiveforums ... ?f=22&t=66 first and then https://www.mythologicinteractiveforums ... ?f=22&t=67
You can also check out any of the other introductions here https://www.mythologicinteractiveforums ... m.php?f=22

Scripting in SFD assumes you have knowledge in programming in C#.

If you don't want to go the way with scripting just to change some color, create a group instead of a SpawnObjectTrigger (Groups were introduced much later than SpawnObjectTriggers). You can design anything inside a group and trigger them just like SpawnObjectTriggers by pointing to them from a button for example. Just adjust the group to not spawn on start.
0 x
Gurt

User avatar
Tuesday
Meatbag
Posts: 9
Joined: Tue Oct 02, 2018 4:39 am
Title: Incompetent Hyena
SFD Account: Tuesday
Started SFD: September 2016
Location: East Coast USA
Gender:

Post by Tuesday » Tue Jan 07, 2020 6:30 am

Gurt wrote:
Wed Jan 01, 2020 11:55 am
See https://www.mythologicinteractiveforums ... ?f=22&t=66 first and then https://www.mythologicinteractiveforums ... ?f=22&t=67
You can also check out any of the other introductions here https://www.mythologicinteractiveforums ... m.php?f=22

Scripting in SFD assumes you have knowledge in programming in C#.

If you don't want to go the way with scripting just to change some color, create a group instead of a SpawnObjectTrigger (Groups were introduced much later than SpawnObjectTriggers). You can design anything inside a group and trigger them just like SpawnObjectTriggers by pointing to them from a button for example. Just adjust the group to not spawn on start.
Worked beautifully. Thanks Gurt! One more thing: how can I change an enemy/bot AI / GuardTarget after spawn?

My plan is to have player turn on TV and zombies are attracted to TV. I tried RallyPoint but NPCs can only Guard one target?

Thanks!
0 x
Don't mind me, I'm just a humble mongoloid wrangler.
Subscribe to Tuesday on YouTube.

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 » Thu Jan 09, 2020 9:50 pm

You need to use GuardTarget, lower the the AggroRange and GuardRange and ChaseRange to maybe 5-10 and disable other behaviors. You could use the default zombie AI (check out the zombie survival map) but set up a GuardTarget around the TV. To prevent the zombies from attacking other opponents disable EliminateEnemies.
0 x
Gurt

User avatar
Tuesday
Meatbag
Posts: 9
Joined: Tue Oct 02, 2018 4:39 am
Title: Incompetent Hyena
SFD Account: Tuesday
Started SFD: September 2016
Location: East Coast USA
Gender:

Post by Tuesday » Sat Jan 11, 2020 3:09 am

Gurt wrote:
Thu Jan 09, 2020 9:50 pm
You need to use GuardTarget, lower the the AggroRange and GuardRange and ChaseRange to maybe 5-10 and disable other behaviors. You could use the default zombie AI (check out the zombie survival map) but set up a GuardTarget around the TV. To prevent the zombies from attacking other opponents disable EliminateEnemies.
I get how to use GuardTarget, but how do I reduce ranges, apply all those other things?

Thanks again, man!
0 x
Don't mind me, I'm just a humble mongoloid wrangler.
Subscribe to Tuesday on YouTube.

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 » Sat Jan 18, 2020 11:36 pm

Tuesday wrote:
Sat Jan 11, 2020 3:09 am
Gurt wrote:
Thu Jan 09, 2020 9:50 pm
You need to use GuardTarget, lower the the AggroRange and GuardRange and ChaseRange to maybe 5-10 and disable other behaviors. You could use the default zombie AI (check out the zombie survival map) but set up a GuardTarget around the TV. To prevent the zombies from attacking other opponents disable EliminateEnemies.
I get how to use GuardTarget, but how do I reduce ranges, apply all those other things?

Thanks again, man!
Sorry for late response. You need to get the BotBehaviorSet first, modify it and the apply the BotBehaviorSet on the player.

Here's some "Pseudo code", just writing this out of memory. See exact syntax in the ScriptAPI.
BotBehavior bb = IPlayer.GetBotBehavior()
bb.GuardRange = 10;
bb.SomeOtherProperties = xyz;
IPlayer.SetBotBehavior(bb);
0 x
Gurt

User avatar
Mr Argon
Fighter
Fighter
Posts: 56
Joined: Sat Mar 09, 2019 2:22 am
SFD Account: Argón (steam)
SFD Alias: Mr. Argon
Started SFD: Pre-Alpha 1.8.2c
Location: Argentina
Gender:
Age: 20

Post by Mr Argon » Mon Jan 20, 2020 1:45 am

In fact... I think you should use "BotBehaviorSet" instead of just "BotBehavior" because the first one is used to set the behavior of enemies while the second one is used to set the predefined AI and the initial input.

Try using this
BotBehaviorSet bbs = IPlayer.GetBotBehaviorSet()
bbs.GuardRange = (your value here);
bbs.ChaseRange = (your value here);
IPlayer.SetBotBehaviorSet(bbs);
Ask me if you need help, I have no problem in doing some template maps if you need it...
0 x
I'м д Liттlэ оdd... sтill саи livе шiтн тнат.

Post Reply