PDA

View Full Version : Strange Behavior on Physical Object



rlmergeuser
04-29-2012, 10:32 PM
I've built a tram that the rider goes onto. The logic is this: The rider enters an area trigger which turns on physics event for tram to move. Physics event is also tied to state event for a curved data source which effects the way the velocity effects the trams motion. The tram is connected to a slider joint which makes it move from side to side.

What should happen is every time the rider gets on the tram and hits the trigger, the tram will begin to start moving while slowly building momentum, reach it's peak, and then start slowing down when it reaches it's end point.

This works perfectly when I test it from the checkpoint just before this. However, if I start from the checkpoint before that, it will either start to move and then stop, not finishing it's sequence or it will take off like a rocket disregarding the curved data source. If i start two checkpoints or more from this area, the whole sequence doesn't work at all, nothing happens.

Is my logic wrong? Is there something I'm missing? I just don't understand why it's inconsistent as it ALWAYS works when testing from the checkpoint right before the event.

rlmergeuser
04-29-2012, 11:04 PM
Without more information I only have one idea as to why this is happening; as I think I had a similar issue.

When you set the curve data source, it has an amount of 'Ticks' (Time) during which it will go through it's values called Duration.

If the Curve Data Source is 'enabled' always, then it will start this Duration when the game starts, and therefore it might go through it's entire duration before you even reach the Tram.

For example, if your tram moves for a total of 10 seconds, and you start at the checkpoint where the tram is located, you will be entering the tram right away, and therefore you won't notice any problem.

If your tram moves for a total of 10 seconds, but you start at a checkpoint roughly 4 seconds BEFORE the tram location, by the time you hit the physics trigger for the tram, the curve data source will be already 40% through it's values, and that is why it will appear to take off very quickly, because the data source is at a high value.

If your tram moves for a total of 10 seconds and you start at a checkpoint 11 seconds BEFORE the tram location, then the curve data source will be completely done it's 10 second duration, and your tram will not move at all.

My suggestion is to insert an impulse splitter at the tram location, the Area Trigger will enable the impulse splitter. One impulse from the splitter will enable the physics event for the tram to move, exactly how you have it set up now.

However, you will insert a Set Value Event (Set value = 1) and a Variable Data Source http://forum.redlynx.com/forum/images/smilies/icon_asleep.gifnitial Value = 0) Now the second impulse from the splitter will enable the Set Value Event.

Then, go into the curve data source, and when you have 'Enabled' highlighted, hit Y and select the Variable Data source that you just placed.

This means that the curve data source is DISABLED, until your rider enters the area trigger. At that point, the curve data source will be enabled, and the tram will move as you intended it to!


Hope this helps, if I was not clear I can try better to explain or maybe take a picture or something.

Let me know how it goes.

rlmergeuser
04-29-2012, 11:14 PM
Thanks for responding back mike. i'll try it out and see what happens.

rlmergeuser
04-30-2012, 12:51 AM
Without more information I only have one idea as to why this is happening; as I think I had a similar issue.

When you set the curve data source, it has an amount of 'Ticks' (Time) during which it will go through it's values called Duration.

If the Curve Data Source is 'enabled' always, then it will start this Duration when the game starts, and therefore it might go through it's entire duration before you even reach the Tram.

For example, if your tram moves for a total of 10 seconds, and you start at the checkpoint where the tram is located, you will be entering the tram right away, and therefore you won't notice any problem.

If your tram moves for a total of 10 seconds, but you start at a checkpoint roughly 4 seconds BEFORE the tram location, by the time you hit the physics trigger for the tram, the curve data source will be already 40% through it's values, and that is why it will appear to take off very quickly, because the data source is at a high value.

If your tram moves for a total of 10 seconds and you start at a checkpoint 11 seconds BEFORE the tram location, then the curve data source will be completely done it's 10 second duration, and your tram will not move at all.

My suggestion is to insert an impulse splitter at the tram location, the Area Trigger will enable the impulse splitter. One impulse from the splitter will enable the physics event for the tram to move, exactly how you have it set up now.

However, you will insert a Set Value Event (Set value = 1) and a Variable Data Source http://forum.redlynx.com/forum/images/smilies/icon_asleep.gifnitial Value = 0) Now the second impulse from the splitter will enable the Set Value Event.

Then, go into the curve data source, and when you have 'Enabled' highlighted, hit Y and select the Variable Data source that you just placed.

This means that the curve data source is DISABLED, until your rider enters the area trigger. At that point, the curve data source will be enabled, and the tram will move as you intended it to!


Hope this helps, if I was not clear I can try better to explain or maybe take a picture or something.

Let me know how it goes.

IT WORKS!!!! I can't say that i understand it but after doing what you said to do and connecting "set value event" to "variable data source", it works just as it should from any checkpoint or from start to finish!!! THANKS MIKE!

rlmergeuser
04-30-2012, 02:16 AM
No problem dude, glad I could help!

To try and explain it in more laymans terms... If a movie starts at 7pm, and you got to the theatre at 8pm, the movie would be half over. However, if the movie didn't start until you arrived at the theatre, you wouldn't miss any of it!

It's hard to explain, but basically your tram data source was going through it's entire (or partial) duration before you triggered the physics.

rlmergeuser
04-30-2012, 04:08 AM
No, Mike.. I get that part. When you explained what was happening, I thought to myself, "That makes sense". It's the logic you provided to the equation that I don't think I'll ever get. The remedy. I'm sure there are parts of the editor that I'll never use cause I just don't get it. No matter how many times I watch Shogun's tutorials.