Page 1 of 3

New tutorial on using areaportals

Posted: Tue Aug 26, 2003 2:40 am
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

Posted: Tue Aug 26, 2003 8:42 am
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-)

Posted: Tue Aug 26, 2003 9:38 am
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 !!!

Posted: Tue Aug 26, 2003 10:49 am
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?

Posted: Tue Aug 26, 2003 10:53 am
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

Posted: Tue Aug 26, 2003 12:00 pm
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?

Posted: Tue Aug 26, 2003 12:10 pm
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

Posted: Tue Aug 26, 2003 12:11 pm
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

Posted: Tue Aug 26, 2003 12:16 pm
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?)

Posted: Tue Aug 26, 2003 12:32 pm
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 !!!

Posted: Tue Aug 26, 2003 2:12 pm
by Bjarne BZR
Glad to help

Posted: Tue Aug 26, 2003 3:12 pm
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?

Posted: Tue Aug 26, 2003 6:37 pm
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.

Posted: Tue Aug 26, 2003 6:43 pm
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?

Posted: Tue Aug 26, 2003 7:40 pm
by Casquebleu
This doesn't work in MP, only SP. Copy your .bsp and .scr in yout main/maps folder.

8-)