Some bugs with an almost-finished FPS

Ok guys. I pretty much have the basics down for my FPS. I just gotta smooth out some bugs with my enemy.

First of all, he still tracks my movements when he is lying on the floor, dead.

My logic in that regard is set up as follows:

Always>
> And > Track to (Player)
If property “Health” interval 1-10*>

This is all in my armature for the guy. The health property is a property copied from the “Heath” property of the body mesh.

I dont see whats wrong with that setup.

The other thing is I need my guy to dissapear (End object) after 3 seconds AFTER my die animation has been played. I havent figured out delay sensors though, as I cant seem to figure out how to activate them.

As in, should I have a message sensor (Recieving a message that is sent at the same time the death animation is played), with a delay sensor, 240 ticks, (4 sec I know), linked to an AND controller and THEN to an Edit object end object actuator?

SO CONFUSING!

Thanks is advance.

I would say this guy is not dead!

The solution is easy
The trackTo should only be active when the guy is alive!

How to do?
simple:
Always -> AND (state 1) -> TrackTo Actuator

now sense the death (e.g. with a property sensor)
“death” sensor -> AND (state 1) -> State Actuator state 2

How it works
On state change the TrackTo Actuator will be deactivated (except you send an activation signal in state 2 again)

It is a sensor you can’t activate a sensor. Sensors are always evaluated see Sensors.

Exception: if the sensor is not connected to an controller of an active state!

The delay sensor is quite simple:
-> it changes it’s state from False to True after “duration” frames.
E.g. duration = 30
False for 30 Frames (1/2 sec) then switching to True

Use the states as mentioned earlier.

Define it that way:
state 1 = alive
state 2 = dying
state 3 = dead
Hint: states get the name of the first controller of a state.

If you do not see the states click the little (+) left of the controller’s column header.

I already described you the live state and how to switch to dying.
In dying you can play the dying animation (just trigger it with an always sensor).

After the animation is done, you can switch to state dead(3).
You can either measure the animation, or use a delay sensor to trigger the state change.

e.g.
property sensor “frameprop” intervall min:<last frame of animation> max:999999 -> AND -> State Actuator 3

In the dead state you can use a delay sensor to wait 3 seconds and trigger an EndObject actuator.

e.g.
Delay Sensor 240 -> AND -> End Object

I hope it helps

Sorry if I sound really noobie with this, but how do you use states? I looked up a few tutorial, but I still don’t really understand them. >.< They sound useful though, so I may have to dive deeper into them.

(Sorry, Im trying to figure it out)

Yep, but what I dont understand properly is how to make the delay sensor start its ‘Delay’…? I undertand the brick and how to use it, just not how to activate it (Evaluate it, :D)

States are pretty simple:
first on you logics bar, you make the states visible.http://dl.dropbox.com/u/6162142/state%20off.jpg
by clicking the buttons with a + nest to the controller bar.
http://dl.dropbox.com/u/6162142/state%20on.jpg
Then fr every logic brick you want in a different state, you change the controller’s number.

Edit…
FOr the delay, the delay sensor has 2 main controls, the delay and the duration. The delay is the time it takes to the sensor to become active, the duration is the time it will remain active. As simple as that, you may repeat the process, by ticking repeat and adding a tick(change the 0 on top by another number), so you’ll have s sensor that will work for a specific interval of time!

the delay sensor starts on object creation
or
when the sensor gets enabled (via state switch)

A sensor starts to sense when the sensor gets activated

This is:
-on object creation
-on state switch

the Always sensor evaluates True immediately
e.g: ------ (where - is True and _ is False)

the Delay sensor waits the configured amount of frames until it turns true.
e.g.: ____-------- (where - is True and _ is False)

Does this help?

Ok, so my understanding is that logic on the “First state layer” (They look like layers, so Im gonna call them that), is like a layer of logic? And when you change the layer, (To say, layer 2), the first state layer becomes inactive, like an inactive object?

If thats correct, then how do I change state layers

As for delays, I think my mind has been wired to expressly stop me from understanding them… D:

I fixed a few bugs. (That havent been posted here), and another one I have discovered. With my master character, when I make duplicated (Shift-D), when I shoot one (And kill it), all die…?