New tutorial on using areaportals

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

New tutorial on using areaportals

Post by Bjarne BZR »

I've realized that a lot of mappers have no idea how to use areaportals. This is a shame, because they are an easy way to boost the FPS in some cases. To fix this I made a tutorial on the subject. My hope is that it is easy to understand, if it is not: please point out its weak spots so I can fix them.

Here it is:
http://www.planetmedalofhonor.com/rjuka ... ortal.html
Admin .MAP Forums
Image
Head above heels.
Casquebleu
Lance Corporal
Posts: 24
Joined: Sun Dec 22, 2002 9:54 am
Location: France

Post by Casquebleu »

Excellent Bjarne,

I was wondering and searching how creating an areaportal with an hatch, you find it before !!! Great job, we learn every day !!!

8-)
Caskou, Mappeur Fou
Casquebleu
Lance Corporal
Posts: 24
Joined: Sun Dec 22, 2002 9:54 am
Location: France

Post by Casquebleu »

Hum, i tried it and it didn't work for me, the portal stayed closed !!! I put an areaportal on my trap like i always do for a rotating_door. I add the 2 lines in my script :

trap_door_mover:

$trap_door_trigger waittill trigger
$trap_door openportal
$trap_door time 2
$trap_door playsound door_metal_open_move
$trap_door rotateXup 90
$trap_door waitmove
$trap_door playsound door_metal_open_stop
wait 15
$trap_door playsound door_metal_close_move
$trap_door rotateXdown 90
$trap_door waitmove
$trap_door playsound door_metal_close_stop
$trap_door closeportal

goto trap_door_mover

end

Thx for all !!!
Caskou, Mappeur Fou
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Have you positioned the areaportal correctly?
If the hatch is removed, will the areaportal seal off the area completely ( together with structural brushes )?

Can you post a describing picture from MOHRadiant?
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

And here is my hatch code ( that works ):

Code: Select all

use_hatch:
	if(level.hatch_moving == 0) {
		level.hatch_moving = 1
		local.hatch_time = 1

		$hatch time local.hatch_time

		if (level.hatch_open) {
			$hatch rotateXup 90
			$hatch_trigger_opened hide
			$hatch_trigger_closed show
			$hatch playsound hatch_close
			$hatch move
			wait (local.hatch_time + 1)
			$hatch closeportal
			level.hatch_moving = 0
		} else {
			$hatch openportal
			$hatch rotateXup -90
			$hatch_trigger_opened show
			$hatch_trigger_closed hide
			$hatch playsound hatch_open
			$hatch move
			wait (local.hatch_time + 1)
			level.hatch_moving = 0
		}
		level.hatch_open = !level.hatch_open
	}
end
Admin .MAP Forums
Image
Head above heels.
Daniel Radcliffe
Second Lieutenant
Posts: 168
Joined: Fri May 30, 2003 9:49 am

Post by Daniel Radcliffe »

Great tutorial, explains how to use it well.

1 question i have though is can it be used for sliding doors too? or is it only usable on doors that have an effective hinge in it?
Casquebleu
Lance Corporal
Posts: 24
Joined: Sun Dec 22, 2002 9:54 am
Location: France

Post by Casquebleu »

Well, I'm sure my areaportal works 'cause you can't see behind it !!! So its' correctly positionned.

Image

Image

Image

This is my script for this one (2 traps) :

trap_door1_mover:

$trap_door1_trigger waittill trigger
$trap_door1a time 2
$trap_door1b time 2
$trap_door openportal
$trap_door1a playsound door_metal_open_move
$trap_door1a rotateXup 90
$trap_door1b rotateXup -90
$trap_door1a move
$trap_door1b waitmove
$trap_door1a playsound door_metal_open_stop
wait 15
$trap_door1a playsound door_metal_close_move
$trap_door1a rotateXdown 90
$trap_door1b rotateXdown -90
$trap_door1a move
$trap_door1b waitmove
$trap_door1a playsound door_metal_close_stop
$trap_door closeportal

goto trap_door1_mover

end
Caskou, Mappeur Fou
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Should be working fine for sliding doors as well.

I updated the tutorial and the tutorial *.map file. It now contains a scripted hatch with a "manually controlled" areaportal.

:D
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

OK Casquebleu: what is the $trap_door entity? Is there one?

As I see it in the script: the trap door is made up of $trap_door1a and $trap_door1b....

Try

Code: Select all

$trap_door1a openportal
or

Code: Select all

$trap_door1b openportal
(Or both?)
Admin .MAP Forums
Image
Head above heels.
Casquebleu
Lance Corporal
Posts: 24
Joined: Sun Dec 22, 2002 9:54 am
Location: France

Post by Casquebleu »

Ok, it works fine now :lol:

Image

Image

In fact, i was focalised by the trap with only on door and i didn't pay attention that there where a link (i forgot to put an areaportal again in a door). And I didn't check targetnames :oops:

Thx again Bjarne, that's a cool discovery !!!
Caskou, Mappeur Fou
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Glad to help
Admin .MAP Forums
Image
Head above heels.
User avatar
General_DisArray
Warrant Officer
Posts: 142
Joined: Tue Dec 17, 2002 4:17 am
Location: magnolia, texas

Post by General_DisArray »

that was awesome and makes me want to say, EUREKA!!!!!!! :D

makes better sense now!

thanks a lot.

one thing though. i did the r_showtris 2 in my console and it keeps telling me that r_showtris is cheat protected. how do i resolve this?
Daniel Radcliffe
Second Lieutenant
Posts: 168
Joined: Fri May 30, 2003 9:49 am

Post by Daniel Radcliffe »

You need to run MoH in developer mode, you basically need to add this to teh end of your shortcut:

+set ui_console 1 +set cheats 1 +set thereisnomonkey 1

This will allow you to use the r_showtris 2 function.
User avatar
General_DisArray
Warrant Officer
Posts: 142
Joined: Tue Dec 17, 2002 4:17 am
Location: magnolia, texas

Post by General_DisArray »

this is what i have in my shortcut, verbatim:

Code: Select all

 +set cl_playintro 0 +set ui_skip_eamovie 1 +set ui_skip_titlescreen 1 +set ui_skip_legalscreen 1 +set developer 1 +set thereisnomonkey 1 +set cheats 1 +set ui_console 1

what do i need to take out or add?
Casquebleu
Lance Corporal
Posts: 24
Joined: Sun Dec 22, 2002 9:54 am
Location: France

Post by Casquebleu »

This doesn't work in MP, only SP. Copy your .bsp and .scr in yout main/maps folder.

8-)
Caskou, Mappeur Fou
Post Reply