func_camera for one player only

Post your scripting questions / solutions here

Moderator: Moderators

jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

func_camera for one player only

Post 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-)
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Remote surveilance cameras anyone? :D
Admin .MAP Forums
Image
Head above heels.
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 »

Great find! :)

Hey, Fungus, give jv a muffin, eh? :P
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :|
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Very intersting find !!!!!I am sure i will use it :D Sweeeeeeeeeeet
Deadly and slient.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

So basically it is a TriggerCameraUse that targets a camera and you used script to have a player trigger it ?
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :)
Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Handy find JV ;)
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

v.nice

i only just realised other things cud use target as well as paths. hmm., :D:D
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Hmm very usefull indeed
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post 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
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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
Deadly and slient.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

When does it crash? On mapstart? When you trigger it?
Is your main method ended properly?
Admin .MAP Forums
Image
Head above heels.
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 »

Local.camera_trigger in one thread and local.camera_trigger in the other are not the same thing.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply