PDA

View Full Version : stoping an object from moving



wolfy_616
02-16-2013, 01:02 PM
right...i usually just make movies so i'm not really used to this sort of gameplay.

basically i am making a twin stick shooter and i need the ship that i have designed to not be allowed to move out of the designated area (gameplay arena), for example like in blast radius on LBP2.

i tried to figure it out myself. i created a box outlining the gameplay area using a hologram with tags attached all around it. the ship had the tag sensor which then activated logic to push the ship in the opposite direction. at first it didn't work but then i realised it was because of the advanced mover used to control the ship. so i added some logic to deactivate it on detection. so i try again and it works but only left and right. when i tried to leave the the area by going up or down the ship's controls somehow seemed to be overwritten and it started moving at an angle on its own out of the gameplay area. obviously i am doing something wrong

i can't seem to find any tutorials on how to do this. so if anyone can help it would be appreciated. or a link to a tutorial?

thanx

SuperROBO1
02-16-2013, 01:16 PM
When you want to trigger it to stop, trigger a sequencer that has a battery on it which triggers an anti gravity tweaker, and make sure the battery goes all the way until one notch before the end of the sequencer, so it's allowed to move before the sequencer end and possible resets

wolfy_616
02-16-2013, 01:36 PM
doh! why didn't i think of that lol. ill try that now and see how it works.

EDIT:

ok i tried it. but how do you get it to work exactly? even though it stops the ship, i can resist it and push past it and move out of the game play area.

SuperROBO1
02-16-2013, 01:55 PM
If all else fails, you could can just cover the edges with a thin later of invisible material, and also the players ship

wolfy_616
02-16-2013, 02:02 PM
what do you mean invisible material? i'm just trying to understand what that would do. i already have hologram outlining the area.

thebombdrop
02-16-2013, 02:21 PM
he means the actual material called invisible material in the common section only it has physical properties like other materials

wolfy_616
02-16-2013, 02:26 PM
yeah only problem there is that my ship is set to destroy on impact. there must be another way

LukeCF
02-16-2013, 03:17 PM
Use that sequencer method, but make sure you have your anti gravity tweak's setting "Dampening" set all the way up. This will keep you from being able to push it.

Edit: thought this was a different post, oops.
Now that I've read your actual I have a better suggestion. Your original method should work fine actually, but a different way you could do it is like this:

Have each wall be its own piece of holographic material.
Each with it's own tag, one for up top, one for down, one for left, one for right.

Take your left/right input and your up/down input and split them using a direction splitter.

Get out four and chips. Connect each direction to one section of the and switch, and for the other and switch section use an impact sensor, make sure to tweak the impact sensor so it only activitates when it hits the wall with it's directions tag, (So for the sensor that goes with the Up Direction, make sure it activates when it hits the ceiling. Run each of the impact sensors through their own not gate and feed those not gates into the and gates, and then your and switches back into a direction combiner. Connect your direction combiners to your movers.

Now when you hit the ceiling, the impact sensor should activate, which then goes through the not gate turning into an off signal, and so the fact that you're pressing up basically gets turned off thanks to the and gate deactivating.

This allows all your other directions to work when you hit a wall, just keeps you from moving outside of your wall.

You will need to make sure you have your ship's deceleration set to 100% though.

Does that make sense?

It should work I think...

wolfy_616
02-16-2013, 04:21 PM
Hold up I don't follow. A direction splitter only has one input so how. Can I connect the up/down and left/right into one lol. Even if I did, the direction splitter only two outputs so how can I connect them to the and gates. U sure this is correct? I'm trying it now but I would have to use other switches so wondering if I misunderstood or something

SuperROBO1
02-16-2013, 06:47 PM
Still use the impact sensor. Just make so it senses a TAG that impacts it, so it won't destroy

LukeCF
02-16-2013, 10:57 PM
Hold up I don't follow. A direction splitter only has one input so how. Can I connect the up/down and left/right into one lol. Even if I did, the direction splitter only two outputs so how can I connect them to the and gates. U sure this is correct? I'm trying it now but I would have to use other switches so wondering if I misunderstood or something

You do misunderstand. Up/Down get a direction splitter of it's own. Then Left/Right get's a splitter of it's own.
You're using four AND gates, one for each direction.
Four impact sensors, and not gates, one for each AND gate (which means one for each direction)
You the feed the AND gates for UP and DOWN back into a direction combiner, and then feed the LEFT and RIGHT AND gates into a direction combiner of it's own. Give you, once again, a UP/DOWN, and a LEFT/RIGHT signal.

fluxlasers
02-17-2013, 11:11 AM
There's another technique for achieving this if you wanted the playing area to be circular rather than rectangular.

Place a Tag at the centre of the playing area and a Tag Sensor (set to the playing area radius) on your ship.
When the Tag Sensor becomes inactive (when the player reaches the boundary of the playing area) it deactivates the ship's mover and activates a follower (set to follow the Tag at the centre with a radius slightly larger than the playing space).

When the ship reaches the boundary it will appear to 'bounce' back into the playing area. You can tweak the follower to alter how much the ship 'bounces'.

An advantage of using this technique is that you use less sensors and tags which may be beneficial if CPU performance is an issue.

The image shows the Tag (Centre of playing space) and a Controlinator (player's ship) on circular sticker material with the basic logic circuit for this technique.
44384

wolfy_616
02-17-2013, 12:37 PM
You do misunderstand. Up/Down get a direction splitter of it's own. Then Left/Right get's a splitter of it's own.
You're using four AND gates, one for each direction.
Four impact sensors, and not gates, one for each AND gate (which means one for each direction)
You the feed the AND gates for UP and DOWN back into a direction combiner, and then feed the LEFT and RIGHT AND gates into a direction combiner of it's own. Give you, once again, a UP/DOWN, and a LEFT/RIGHT signal.


ok, well it didn't work lol. i sorted it out anyway. not enitrely happy but it will do the job for now until i find a better way. thanx for the help :-)