area portals by script?

Post your scripting questions / solutions here

Moderator: Moderators

M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

area portals by script?

Post by M&M »

wow,i havent asked in this forum since a very long time

anyways ,im trying to make fps optimizations to the map hence the use of the area portals !!!
ok ,i saw bjarne's tut on it and i dloaded the map but i couldnt understand a few "key" things

-does the area portals work on sliding doors? or should i script them?
-does the area portals work on exploded areas (i.e b4 the explosion ,it blocks view ,after explosion it doesnt ) or do i have to script it to do so? (i think i have to)
-how exactly do i script the hatch to open ?in the tut it says i should just put

Code: Select all

$my_hatch openportal
but the portal as far as i know is a normal brush ,so how can i change its targetname to $my_hatch?do i make it a script object ?and wouldnt that affect its job?

i did dload the tut map file but i couldnt make heads or tails from it

also ,while im asking
what is the console command that views the portals on mohaa (shows them in green lines)
i cant rememer it so can any1 help with this also :wink:
tnx in advance
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

worldspawn

Post by tltrude »

An areaportal brush is worldspawn and you can only spawn entities with scripting.
Tom Trude,

Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

well,i know that .but ive already added the area portals in my map (its still .map file) however ,i want to manupilate them thru script like bjarne said its possible in the tut
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

line

Post by tltrude »

Ok, well a function type door will open the portal automattically when it opens. But, to do it manually, you use that line. The targetname is the door object's name. So, if you have a script_object hatch, just use its targetname. The area textured brush must be contained within the hatch brushes and it acts as sort of a fake structural brush to seal off an area.

Exploders are script_objects too, and will not allow the room to be sealed. You can put an area brush in the hole, but sence all exploders are named "exploder" it would be hard to open the portal with it. You could try puting a script_origin in the hole and using that targetname to open it when you set off the exploder.
Tom Trude,

Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

so u r saying that
-sliding doors should work !!
-any entity near the area portal could be used to guide the area portal with its target name!!!


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

Post by Bjarne BZR »

I second tltrude's post ( thanx Tom, saved me a lot of writing :) )
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

"guide" is not the correct term. Although the cammands are "openportal" and "closeportal", what they really do is hide or show the area brush.

One way to tell if your area brush is working, is by looking at the FPS meter. When you're inside an area room, the fps should go way up when the door closes. This is because only the room itself is being drawn, and the outside world is not being drawn.
Tom Trude,

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

Post by Bjarne BZR »

The FPS way is a little uncertain. Using the r_showtris command is a better guide to "see what you cant see".

A small description of that and some other useful commands here.
Admin .MAP Forums
Image
Head above heels.
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

The FPS way is a little uncertain. Using the r_showtris command is a better guide to "see what you cant see".
well,thats what i use to determine if my vis optimizations work or not .
however i added hints everywhere where i can add them but there are a still few small areas (room like) that need to be closed out


sparing u the long details ,i just need to make a area portal that closes and opens by script .but i cant script it since i dont have its target name !!!
"guide" is not the correct term


also ,u said
You could try puting a script_origin in the hole and using that targetname to open it when you set off the exploder.
doesnt that mean guide?then what is ?
all i want to do is assign a targetname for certain portals so i can manupilate them by script since thier auto features wont work where im putting them .

im getting confused !!!

also,i need to know what is the console command that makes u view protals in mohaa !!!!
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

The "r_showportal 1" command is wha tyou are looking for, its in the tutorial above as well.

To be able to open/close an areaportal: it must touch an entity that has a targetname. Via this targetname you can than control the areaportal. So you never control the areaportal directly, you give the command openportal or closeportal to an entit that touches the portal... Is that more understandable?
Admin .MAP Forums
Image
Head above heels.
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

cheers ,thats much more clearer !!!!!
i now have enough info to go work on the map again ,but i just wanna ask something .
if there are 2 entities touching the area portal ,does this mean i can use any of thier targetnames?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

yes

Post by tltrude »

yes

I did that for the silo doors of gotterdammerung. They were both script_objects, but there was only one area brush inside them. I had the left door open and close the portal.

$silodoor_left openportal
Tom Trude,

Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

cool ,tnx alot guys .ur the best :wink:
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

alright ,i added mos of the area portals but i am missing only 2
they are the ones need the exploders ,and they seem to be more complicated to operate than i thought .

what i want to do is open a portal once a certain exploder is activated .and since different exploders are seperated by sets ,i thought i could use that (but i dont know how)

so would somehting like that work ? (I named the script_origins areaportal_controller_# )

Code: Select all

$exploder set # waittill trigger 
$areaportal_controller_# openportal
i dont know exactly how to incorporate the set number in script ,so prolly his piece of script is wrong !!
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

trigger

Post by tltrude »

If your exploder is set off by a trigger, just add a setthread that will run the theard with the openportal.

Key: setthread
Value: exploder1_open

----------------------------

exploder1_open:

$areaportal_controller_# openportal

end


BTW, you can set the exploder off in the script too. So, you don't have to name the trigger "explodertrigger", if you don't want to. It wouldn't even really need a targetname, or set number--just a setthread.

exec global/exploder.scr::explode 1 // set off exploder set 1
Last edited by tltrude on Mon May 10, 2004 7:03 pm, edited 2 times in total.
Tom Trude,

Image
Post Reply