HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[HELP] How to create a one-way door?

04-26-2008, 09:59 AM#1
NLD]Potter
Hi,

I was wondering how you wud go about making a one-way door. A door which a unit can only pass through one way but won't be able to pass through the other. I have tried but failed and need some tips/advice whatever about how you would go about creating a one-way door...

Thanks for all the help in advance!

~NLD]Potter
04-26-2008, 10:25 AM#2
abriko
Try to use 2 rectangle and 1 group.
The unit, who wants to pass the door, enter in rectangle 1 just before the door and is added to a group ( Unit_trying_pass_the_door_ GROUP ... you can change the name ^^). In a second trigger, check if the units entering in the rectangle 2 just after the door is in the GROUP.. if the unit is in the group, you order it move to center of rectangle 1.

This is a easy to understand GUI way ^^
04-26-2008, 03:22 PM#3
NLD]Potter
Quote:
Originally Posted by abriko
Try to use 2 rectangle and 1 group.
The unit, who wants to pass the door, enter in rectangle 1 just before the door and is added to a group ( Unit_trying_pass_the_door_ GROUP ... you can change the name ^^). In a second trigger, check if the units entering in the rectangle 2 just after the door is in the GROUP.. if the unit is in the group, you order it move to center of rectangle 1.

This is a easy to understand GUI way ^^

hmmm..dude you lost me man? please explain slowly...
04-26-2008, 04:10 PM#4
Sabertooth_X
Trigger:
One Way Door
Collapse Events
Unit - A unit enters Open Door <gen>
Conditions
Collapse Actions
Destructible - Open <insert gate here>
Unit - Order (triggering unit) to move to center of (Close Door <gen>)
Wait 1.00 seconds
Destructible - Close <insert gate here>

That's done in one trigger, using the other region as a move-to point. I tested it, it works, but if it's a multiplayer map there might be some issues.

If you only want certain units to be able to enter the door, or only certain units to be able to leave, you can make another trigger.

I think Abriko was doing some JASS, dunno if you know that though.
04-26-2008, 06:10 PM#5
Furion
Quote:
Originally Posted by Sabertooth_X
I think Abriko was doing some JASS, dunno if you know that though.

Nah, Abriko was using pseudo-gui, he just forgot they're called regions in gui instead of rectangles.

Also, I recommend switching the unit's ownership to Neutral Passive for the second he is walking in the door. If you do not change the ownership, the player can override the movement order. That is my preferred method because it's easy and I think it looks cool when the "lights go out" for a second as you lose ownership and then "come back on" as you regain it inside the building. You can also play the bnet door sound for a very cool dungeon entrance effect, the door slams behind you kinda thing =)

There are other ways to do that too, however, without changing ownership. For example, you could set the unit to a unit variable and remove it from selection via use of another trigger that is only on when a unit is opening the door. Lots of different ways to do it.
04-26-2008, 08:20 PM#6
abriko
Quote:
Originally Posted by Sabertooth_X
Trigger:
One Way Door
Collapse Events
Unit - A unit enters Open Door <gen>
Conditions
Collapse Actions
Destructible - Open <insert gate here>
Unit - Order (triggering unit) to move to center of (Close Door <gen>)
Wait 1.00 seconds
Destructible - Close <insert gate here>

That's done in one trigger, using the other region as a move-to point. I tested it, it works, but if it's a multiplayer map there might be some issues.

If you only want certain units to be able to enter the door, or only certain units to be able to leave, you can make another trigger.

I think Abriko was doing some JASS, dunno if you know that though.

Don't use Wait action or your trigger is useless. Because it can only work for 1 unit in game. You can use rectangle if your door is static ( not created during the game )
It's not jass, and not "pseudo gui" -.-

If you can't explain slowier if i don't want to make it for you.. It's a very easy and basic triggering.
04-26-2008, 10:00 PM#7
rulerofiron99
A different approach:
If a unit entering the region (door region) is facing a certain direction (e.g. between 90 and 270), it gets moved backwards automatically.

Problems:
Could be exploited by skillful players - but just to be safe, give all units a high turn rate so that they are always facing the way they are moving.
04-26-2008, 11:07 PM#8
Sabertooth_X
Quote:
Originally Posted by Abriko
Don't use Wait action or your trigger is useless. Because it can only work for 1 unit in game.

The wait is there because when I tryed it ingame, the door didnt open without that 'wait' in there.
And I thought the map was single player. But yea, for multiplayer, Abriko's way works. It was just your wording that threw me off.
04-27-2008, 12:56 AM#9
abriko
Quote:
Originally Posted by Sabertooth_X
And I thought the map was single player.

Single player and single unit on the map ^^
04-27-2008, 04:41 AM#10
Tide-Arc Ephemera
Quote:
Originally Posted by abriko
If you can't explain slowier if i don't want to make it for you.. It's a very easy and basic triggering.

Keep in mind not everyone in the world has the same level of skill as you.
04-27-2008, 09:27 AM#11
NLD]Potter
Quote:
Originally Posted by Tide-Arc Ephemera
Keep in mind not everyone in the world has the same level of skill as you.

Cheers Tide , glad someone still sticks up for the noobs! But hey abriko, i have re-read your idea..slowly..and think i get what your trying to say. Your english was just messy!

Quote:
Originally Posted by rulerofiron99
A different approach:
If a unit entering the region (door region) is facing a certain direction (e.g. between 90 and 270), it gets moved backwards automatically.

Problems:
Could be exploited by skillful players - but just to be safe, give all units a high turn rate so that they are always facing the way they are moving.

That is in fact what i was thinking initially but just had no idea how to execute it. Thats why i came here, cause thought they didnt care if you noob!

Thanks for all the help! Going to give these ideas a try!

~NLD]Potter

PS How would you do the same one-way idea but not with a door; instead an arrow or some sort of indicator on the floor which shows you can only walk over it in one direction?
04-27-2008, 10:20 AM#12
Tide-Arc Ephemera
You'd need:
- A unit
- A trigger

What you'd do is:
1. Set up a trigger event that fires whenever a unit comes within X range of the unit
2. Set up the trigger condition to measure if the facing angle is no more than 89.5 greater or less than the unit's facing angle. (89.5 is an estimate, it gives 179 degrees radius to where they can't go... I'd personally use 60 but I've never done this before)
3. Set up the trigger actions to move the unit back a small distance (experiment until it works with the fastest possible speed).

I'd rig it up in GUI... if I had my world editor with me.

EDIT!
You COULD use regions instead, but it's up to you. If you did, you'd only check the entering unit's facing.
04-27-2008, 10:57 AM#13
abriko
Everyone in the world has not the same level of skill as me, but if i write a tutorial about that, it will be placed in the basic triggering tutorial section.
04-27-2008, 11:10 AM#14
Tide-Arc Ephemera
Quote:
Originally Posted by abriko
Everyone in the world has not the same level of skill as me, but if i write a tutorial about that, it will be placed in the basic triggering tutorial section.

... and teaching people basic things is bad?
04-27-2008, 11:37 AM#15
abriko
Who is saying that ?