func_camera for one player only

Post your scripting questions / solutions here

Moderator: Moderators

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

Post by Bjarne BZR »

Rookie One.pl {sfx} wrote:Local.camera_trigger in one thread and local.camera_trigger in the other are not the same thing.
Damn, I totally missed that :)

Yes, replace local with level.
Admin .MAP Forums
Image
Head above heels.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Thanks It worked :)

Just some precisions please :

1)Why should I write level instead of local ?

2)Can whe make this trigger camera_use active , other way than pressing Use key? If player is touching the trigger for instance , that would fit better my desires.

Thanks :D
Deadly and slient.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Just read in g_allclasses:

Code: Select all

doTouch( Entity touchingEntity )


sent to entity when touched.

I think it should work.I ll give feedbacks

edit: It says Dotouch applied to Nil listener, and when i press use key , the cam work though ?????weird.

here is the code I've used.

Code: Select all


pilot1_cam:

local.player = parm.other 
level.camera_trigger doTouch local.player

end

Deadly and slient.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

:oops: I dont get it at all. Hopefully its just me thinking into the wrong direction...
Anyway, if someone could give me a little demo map so I could see it in action, I'd really appreciate this (and would have a new piece for the recycling bin :wink: )
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Sorry again with my questions:


How do you do to switch off the camera view? remove comand keep saying in console "applied to Nil listener"

Could i script teleport, moving objects or whatever whe can do with a normal trigger_use or multiple , using a trigger camera_Use.

Wanna move the player to a camera , to let him watch , what i want to.(moving objects and player beaming down especially).

Ps: Sorry wacko , i would gladly do a .map but i am lost..hehe

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

Post by Elgan »

try cueplayer


cueplayer local.player
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
level.camera_trigger cueplayer local.player

end

applied to Nil listener, This NIL grrrrrrrrrrrrrrrrrrrrrrrrrrrr
Deadly and slient.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

agentmad007 wrote:1)Why should I write level instead of local ?
level and local are predefined objects that you can insert data into.
The difference is that local only lives inside the function ( between function_name: and the following end ), but level lives from the time the level starts until it ends.
Read detalis here: http://gronnevik.se/rjukan/index.php?n= ... ptLanguage ( under the section named "predefined objects" )
agentmad007 wrote:2)Can whe make this trigger camera_use active , other way than pressing Use key? If player is touching the trigger for instance , that would fit better my desires.
Yes, I guess you just use a trigger_multiple instead of a trigger_use.
Admin .MAP Forums
Image
Head above heels.
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

Code: Select all


pilot1_cam:

local.player = parm.other 
level.camera_trigger doUse local.player
wait 5
cueplayer local.player

end

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

Post by agentmad007 »

Let's say my trigger_use is targetnamed "my_trigger".

This trigger_use, once activated , teleport the player somewhere with some animated objects.I would like the camera to be set , so the player could see what happen.

shall i write the thing like that :


Code: Select all


level waittill prespawn

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

main:

my_thread:

$my_trigger waittill trigger 
local.player = parm.other 

$my_trigger doUse local.player

wait .5

local.player tele XXXXXX

$my_object moveDown XXXXXX
$my_object waitmove

$my_trigger cueplayer local.player//That doesnt work though , but it will be nice to answer to everyone how to deactive the camera_view

end


Is that possible ? Cause i cant get it to work.

thank you for the HELP :D
Deadly and slient.
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

cueplayer local.player

not $my_trigger cueplayer local.player

sud work if not i got some mroe sugestions
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Elgan wrote:

Code: Select all


pilot1_cam:

local.player = parm.other 
level.camera_trigger doUse local.player
wait 5
cueplayer local.player

end

Sorry Elgan , Have not seen your post when i replied.It doesnt work.Nothing in console to Help.The player is still glued to the cam.

EDIT:

List of what i ve tried out:

cueplayer( [ Float switchTime ] )
cueplayer local.player
cuecamera local.player
cuecamera local.tgname

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

Post by Elgan »

try doing

$my_trigger doUse local.player

again


stopwatchingactor - neevr used that? can u amke a players cma watcha actor?

watchactor - hmm i guess so

u cud make the cam watch the player.hehe
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

stopwatchingactor( Entity actor_to_stop_watching )
Makes the player's camera stop watching the specified actor.

So to use that comand, it need first the player to be set viewing an actor , wich is not the case currently....
Or what i shall i stop watching to ?

......

Btw i also tried

Code: Select all

local.player cut , as mentioned JV at start, the console said applied to NIL.
Deadly and slient.
Elgan
Lieutenant General
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

then are u sure your local.player was filled?
Post Reply