Page 1 of 1
Color spawned objects?
Posted: Mon Dec 30, 2019 4:28 am
by Tuesday
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
Re: Color spawned objects?
Posted: Mon Dec 30, 2019 4:50 pm
by Gurt
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.
Re: Color spawned objects?
Posted: Wed Jan 01, 2020 1:40 am
by Tuesday
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!
Re: Color spawned objects?
Posted: Wed Jan 01, 2020 11:55 am
by Gurt
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.
Re: Color spawned objects?
Posted: Tue Jan 07, 2020 6:30 am
by Tuesday
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!
Re: Color spawned objects?
Posted: Thu Jan 09, 2020 9:50 pm
by Gurt
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.
Re: Color spawned objects?
Posted: Sat Jan 11, 2020 3:09 am
by Tuesday
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!
Re: Color spawned objects?
Posted: Sat Jan 18, 2020 11:36 pm
by Gurt
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);
Re: Color spawned objects?
Posted: Mon Jan 20, 2020 1:45 am
by Mr Argon
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...