SolvedHaving a problem with a behavior

Posts 1–10 of 10 · Page 1 of 1
Having a problem with a behavior
Code:
#region

using wServer.logic.behaviors;
using wServer.logic.loot;
using wServer.logic.transitions;

#endregion

namespace wServer.logic
{
    partial class BehaviorDb
    {
        private _ reward = () => Behav()
            .Init("white tree spawner",
                    new State(
                        new ConditionalEffect(ConditionEffectIndex.Invincible),
                        new State("1",
                         new EntitiesNotExistsTransition(2000, "pre2", "White Sprite Tree")
                            ),
                        new State("pre2",
                            new TimedTransition(1000, "2")
                            ),
                        new State("2",
                            new Taunt("You have killed all white trees, now come claim your reward!"),
                            new TimedTransition(1000, "3")
                            ),
                        new State("3",
                            new TimedTransition(500, "4")
                            ),
                        new State("4",
                             new Spawn("White Tree Reward", 1, coolDown: 1000),
                             new TimedTransition(1100, "5")
                            ),
                        new State("5",
                            new Suicide()
                        )
                        )

            );
    }
}
I wrote that, but when all of the white trees are killed it doesnt go into the next state... But when I spawn it into an empty world that has no entities in it, then it works.

So any help would be appreciated
Why is it called "White tree spawner" when it doesn't spawn anything?
do it like this in State "4"
Code:
                        new State("4",
                             new Spawn("White Tree Reward", 1, coolDown: 1000),
                             new EntityExistsTransition("White Tree Reward", 999, "5")
                            ),
Quote Originally Posted by HGAEHaeheadhetdhtertherh View Post
do it like this in State "4"
Code:
                        new State("4",
                             new Spawn("White Tree Reward", 1, coolDown: 1000),
                             new EntityExistsTransition("White Tree Reward", 999, "5")
                            ),
It doesn't work


Quote Originally Posted by Orbit View Post
Why is it called "White tree spawner" when it doesn't spawn anything?
Yes it does.
Edit: Nvm what I typed previously.

I'm pretty sure it is because of how the tree entities behave in-game.

Their object type is messed up in the FSoD source.

Something I would try:
Change the white trees to have 10k health.
Give them a behavior that when they reach 0.99 health, they suicide.

This should allow you to actually destroy them compared to hitting them.
Quote Originally Posted by Invader_Zim View Post
Edit: Nvm what I typed previously.

I'm pretty sure it is because of how the tree entities behave in-game.

Their object type is messed up in the FSoD source.

Something I would try:
Change the white trees to have 10k health.
Give them a behavior that when they reach 0.99 health, they suicide.

This should allow you to actually destroy them compared to hitting them.
Tried to create that behavior for them, this happened: http://prntscr.com/d6ewug and http://prntscr.com/d6ex5q
Yeah they don't behave too well now do they, haha.

If they were walls or enemies, it would work fine. Sorry to say I don't know how to fix them.

If you didn't care for their collision-boxes, you could just make them an enemy. Otherwise, need to find some help on fixing StaticObjects to be able to be destroyed properly.



I messed around a lot with those trees when I was re-making the sprite world.
Quote Originally Posted by Invader_Zim View Post
Yeah they don't behave too well now do they, haha.

If they were walls or enemies, it would work fine. Sorry to say I don't know how to fix them.

If you didn't care for their collision-boxes, you could just make them an enemy. Otherwise, need to find some help on fixing StaticObjects to be able to be destroyed properly.



I messed around a lot with those trees when I was re-making the sprite world.
Works, thank you. Please close @Raple
/closed as requested
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Talk with us