func_camera for one player only

Post your scripting questions / solutions here

Moderator: Moderators

agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Code: Select all

pilot1_cam: 

local.player = parm.other 
level.camera_trigger doUse local.player 
wait 5 
local.player cut
end
Should work ? It say applied to Nil.Pilot1_cam is setthread by the camera use.
Deadly and slient.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Don't do <Player> cut do <Camera> cut.
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Code: Select all

spawn_cam:


local.tgname = "malp_cam" + randomint 1000 
local.camera = spawn Camera targetname local.tgname
local.camera.origin = ( 200 7296 2640 )
local.camera.angle = 270


local.camera_trigger = spawn TriggerCameraUse target local.tgname
local.camera_trigger.origin = ( -4872 -5640 -3424 )
local.camera_trigger setsize ( -30 -30 -30 ) ( 30 30 30 )
local.camera_trigger nottriggerable
local.camera_trigger setthread malp_remote_camera 

end


malp_remote_camera:



local.player = parm.other

level.camera_trigger doUse local.player

wait 10

level.tgname cut




end
i am back i still cannot stop the cam lol.

Cut applied to NIL , triied $malp_cam cut as well.Nothing.....

Jv wrote:

<camera> cut .WHat should i replace <camera> with to get it cut with the informations above.....

Thanks
Deadly and slient.
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

well u need to either pass the cam tname or just set a specific one. i dont see why u have to use a random one.


you could try this. if not then use a certain tname or pass it.

Code: Select all

spawn_cam:


local.tgname = "malp_cam" + randomint 1000
local.camera = spawn Camera targetname local.tgname
local.camera.origin = ( 200 7296 2640 )
local.camera.angle = 270


local.camera_trigger = spawn TriggerCameraUse target local.tgname
local.camera_trigger.origin = ( -4872 -5640 -3424 )
local.camera_trigger setsize ( -30 -30 -30 ) ( 30 30 30 )
local.camera_trigger nottriggerable
local.camera_trigger setthread malp_remote_camera

end


malp_remote_camera:



local.player = parm.other

level.camera_trigger doUse local.player

wait 10
evel.tgname = self.target
level.tgname cut




end 
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

In JV original post he had used script to make a player use a TriggerCameraUse that targets a func camera . So what I don't understand is must the camera have a targetname ? Does it not trigger when you walk into it ? Why can't you just spawn the TriggerCameraUse then in the thead run by sethread just put

malp_remote_camera:

self nottriggerable

wait 10

$(self.target) cut // or self.target cut

wait 10

self triggerable

end
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

another idea is don't use setthread at all use

local.camera_trigger thread malp_remote_camera

end

malp_remote_camera:

while(1)
{

self waittill trigger

local.player = parm.other

while(local.player istouching self)
waitframe

$(self.target) cut // or self.target cut

}

end
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Code: Select all

$(self.target) cut // or self.target cut 
None of them seems to work.I am sitll glued to the camera , and the console says nothing.
Deadly and slient.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You made sure that the trigger called the thread like this?

local.camera_trigger thread malp_remote_camera

If that change does not work you can always delete the camera and respawn it .
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Thx bdbodger.

Foe the ones that are intersting in ....here is how it has been fixed .

Code: Select all

spawn_cam:


local.tgname = "malp_cam"
local.camera = spawn Camera targetname local.tgname
local.camera.origin = ( 200 7296 2640 )
local.camera.angle = 270


local.camera_trigger = spawn triggercamerause "targetname" "malp_trigger" target local.tgname
local.camera_trigger.origin = ( -4872 -5640 -3424 )
local.camera_trigger setsize ( -30 -30 -30 ) ( 30 30 30 )
local.camera_trigger nottriggerable
local.camera_trigger thread malp_remote_camera

end


malp_remote_camera:


wait 10

$malp_cam delete
$malp_trigger remove

thread spawn_cam



end
Deadly and slient.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Ya I guess that works but I would put self waittill trigger at the top of the thread no sence respawning it over and over if no one has triggered it .
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

ok. here's how I did it.
In the map there's the screen to look at with a trigger_use (targetname/cam_switch, setthread/activate_cam) and a script_origin (targetname/cam_target) where the camera shall look at.
Once the player uses the trigger, he enters camera mode. When pressing use again, he's back to the game again.
Only the fov of the camera, I can't set. Anybody?

Code: Select all

activate_cam: 
$cam_switch nottriggerable
local.camname = "cam"
local.camera = spawn Camera targetname local.camname
local.camera.origin = ( 256 256 280 ) 
local.camera_trigger = spawn triggercamerause "targetname" "cam_trigger" target local.camname 
local.camera_trigger.origin = ( 0 0 0 ) 
local.camera_trigger setsize ( -30 -30 -30 ) ( 30 30 30 ) 
local.camera_trigger nottriggerable 
local.player = parm.other 
local.camera_trigger doUse local.player
local.player physics_off
$cam lookat $cam_target
wait .5
while (local.player.useheld != 1)
{waitframe}
local.player physics_on
$cam delete 
$cam_trigger remove 
$cam_switch triggerable 
end
and here's the whole stuff (pk3 with bsp, map, scr)
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

OMFGWTFBBQ!!! :shock: Wacko lives! :D
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Rookie One.pl wrote:OMFGWTFBBQ!!! :shock: Wacko lives! :D
Nice to find u still here, m8.
I can translate most of the acronym, but the end, isn't that barbecue? Doesnt make sense to me :?
Well, of course I'm alive, just had a lil mapping break, but I'm back into business, kind of.
Anything about the camera's FOV? No? Once I found out myself, there'll be 5 ppl who know how to make it better, I'm sure :P
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

OMFGWTFBBQ = oh my f**king goodness what the f**k barbecue. :P I know it doesn't make much sense, but that's the fun of it. ;)

$cam fov yourfovvaluehere?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Rookie One.pl wrote:$cam fov yourfovvaluehere?
well, I tried this:

Code: Select all

...
$cam fov 110
$cam lookat $cam_target 
... 
Didn't make any difference though :cry: The lookat command seems to override the fov command.
Post Reply