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:

Post by M&M »

cool ,i seem to have forgotten that !!
BTW, you can set the exploder off in the script too. So, you don't have to name the trigger "explodertrigger".

exec global/ecploder.scr::explode 1 // set off exploder set 1
cheers for that bit of info :wink: that could come in quite handy ,but not in this situation since that exploder has a certain health and has to be blown
tnx again tltrude :wink:
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

darn,most of the area portals dont work
specially the scripted ones .they are always closed and they never oopen despite all my efforts .
i already have them closed by default .but other scripting efforts to open them have failed.

Code: Select all

areaportal_controls:
	$alliesweaponsroom_portal closeportal
	$axisweaponsroom_portal closeportal
	$alliesweaponsroom_door closeportal
	$axisweaponsroom_door closeportal
(the portals with _door are applied to a script object so i didnt add ascript_origin since it already had a name)
(the portals with _portal are identified by a script origin targetnamed blabla...._portal ,those are also the ones used in the explosion areas)

both of them dont work
i also tried to open them from the console (is it possible?) by typing the commands manually ,but ofcourse it failed which let me 2 doubt if it was even possible.

also, in a certain location .when the door opens (the areaportal is still closed) and closes again i get this error

Code: Select all

CM_AdjustAreaPortalState : negative reference count
what is that?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

exploder

Post by tltrude »

If those first ones are your exploder portals, why are you telling them to close? When the explosion goes off you should use "openportal" to hide the area brushes. You would only need to use "closeportal" when a script_object door is closed.

Your triggers, with health, can still use "setthread" to run the thread that has "exec global/exploder.scr:: explode 1" and the openportal line.

That error sounds like you are giving the command to close the portal twice. Remember, a func type door needs no help to open and close its portal. If a script_object door is near a func_door, that might happen.
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 told all the portals to close so i become sure they are closed when the explosion goes off. and i open them again thru script after the explosion .
Your triggers, with health, can still use "setthread" to run the thread that has "exec global/exploder.scr:: explode 1" and the openportal line.
yeah,thats what ive been using
That error sounds like you are giving the command to close the portal twice. Remember, a func type door needs no help to open and close its portal. If a script_object door is near a func_door, that might happen.
well,there is a func door nearby but it isnt that close to it.both of the doors are at the end of a corridor ,one of them is a script object and the other is a fun_door and tey are on opposite sides of the corridors walls.

also,that error happens when the script_object door closes .when it opens it doesnt open the portal (although i did the scripting) however when it closes it displays the error u said is caused by attempting to close a protal twice (which now makes sense ,since i told the door to close the portal on closing but the portal was never opened)

im gonna give it another try and perhaps remove the areaportal_controls thread and see what happens :wink:
tnx 4 ur help for now :D
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

well,now most of the portals work .but the ones at the explosions dont .they seem to work right after i trigger the explosions .but suddenly stop working after a few secs. after more research i found that the portal is triggered to open and close by another (object_script) door which controls a different portal (and works) and has nothing to do with the explosion's portal !!!

in scripting and mapping both have a different name and the explosion trigger has a setthread while the door doesnt !!

make sense?
if so then can any1 tell me how to fix this ?
if not ..... well .... tell me and ill try 2 explain better i guess
Image
Post Reply