Page 1 of 4

func_camera for one player only

Posted: Thu May 05, 2005 9:38 am
by jv_map
Not sure if many around here ever use a func_camera but it's sometimes used for ending movies in obj maps. Up to now usually all players would have to view through the same camera, making it almost useless for more interactive use.

However I nearly accidentally found a way to have a camera for one specific player (or a couple of players) :)

Here's the basic concept:

Code: Select all

local.tgname = "cam" + randomint 1000 // make sure it's unique
local.some_camera = spawn Camera targetname local.tgname
local.camera_trigger = spawn TriggerCameraUse target local.tgname

local.camera_trigger doUse local.some_specific_player_1
local.camera_trigger doUse local.some_specific_player_2
//...
local.camera_trigger doUse local.some_specific_player_n

local.camera_trigger targetname "" // optional
local.camera_trigger remove // optional
Now you can do whatever you want with your local.some_camera (follow a path / entity etc).

To stop using the camera I think you can simply remove it or do local.some_camera cut.

Enjoy 8-)

Posted: Thu May 05, 2005 12:01 pm
by Bjarne BZR
Remote surveilance cameras anyone? :D

Posted: Thu May 05, 2005 12:10 pm
by Rookie One.pl
Great find! :)

Hey, Fungus, give jv a muffin, eh? :P

Posted: Thu May 05, 2005 2:40 pm
by lizardkid
JV has many many muffins. He's got so many muffins he can't hardly walk :P

GREAT find Jv! If you could post the whole script i'd be happy to make a full prefab for it. :D

Posted: Thu May 05, 2005 3:56 pm
by jv_map
Well there's no such thing as a full script this time... it really depends on your specific needs :wink:

Thanks for the muffins.. they're now peacefully piling up inside me :|

Posted: Thu May 05, 2005 4:09 pm
by agentmad007
Very intersting find !!!!!I am sure i will use it :D Sweeeeeeeeeeet

Posted: Fri May 06, 2005 10:38 am
by bdbodger
So basically it is a TriggerCameraUse that targets a camera and you used script to have a player trigger it ?

Posted: Fri May 06, 2005 10:52 am
by jv_map
bdbodger wrote:So basically it is a TriggerCameraUse that targets a camera and you used script to have a player trigger it ?
Exactly :)

Posted: Fri May 06, 2005 5:53 pm
by Cobra {sfx}
Handy find JV ;)

Posted: Sat May 07, 2005 12:29 am
by Elgan
v.nice

i only just realised other things cud use target as well as paths. hmm., :D:D

Posted: Sun May 08, 2005 12:47 am
by bdbodger
Hmm very usefull indeed

Posted: Sun May 08, 2005 1:54 am
by Master-Of-Fungus-Foo-D
as requested, One muffin!
http://www.huatki.com/topsite/members/p ... Muffin.jpg
:wink: :roll:

great find JV. Great for all modders... finally a good use for a func_camera :P

Posted: Tue May 10, 2005 4:15 pm
by agentmad007
Need assistance please :

I tried to assign the player to a cam as wrote Jv above ,but when i tried out the script below , Moh crashed .

Code: Select all


local.tgname = "cam_pilot1" + randomint 1000
local.camera = spawn Camera targetname local.tgname 
local.camera.origin = (616 4400 2648 ) 

local.camera_trigger = spawn TriggerCameraUse target local.tgname 
local.camera_trigger.origin = ( 240 -6480 4408 )
local.camera_trigger setsize ( -30 -30 -30 ) ( 30 30 30 )
local.camera_trigger triggerable
local.camera_trigger setthread pilot1_cam

Code: Select all


pilot1_cam:

local.player = parm.other 
local.camera_trigger doUse local.player

end
I am sure i misunderstood something ....

Thnaks for the help

Posted: Tue May 10, 2005 4:29 pm
by Bjarne BZR
When does it crash? On mapstart? When you trigger it?
Is your main method ended properly?

Posted: Tue May 10, 2005 5:17 pm
by Rookie One.pl
Local.camera_trigger in one thread and local.camera_trigger in the other are not the same thing.