View unanswered posts | View active topics It is currently Fri Dec 27, 2024 7:06 am



Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
 Quick Lua Question 
Author Message
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Quick Lua Question
I'm trying to say, in Lua,

If bla bla bla then
self.target move player view to self.pos

How do I do this?


Sat Aug 22, 2009 2:30 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Quick Lua Question
What do you mean by that?

Make the view point to the actor, or switch identity to the actor?


Sat Aug 22, 2009 2:32 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Quick Lua Question
Move the actor's view to object with Lua's position.


Sat Aug 22, 2009 2:33 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Quick Lua Question
I mean, make him look at the actor?


Sat Aug 22, 2009 2:33 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Quick Lua Question
The script is attached to a MOSRotating. When it is spawned, it makes the closest actor its "target." I want it so that if the "if" line is activated, or whatever you call it, the view of the "target" is moved to the MOSR's position.


Sat Aug 22, 2009 2:36 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Quick Lua Question
If you're talking about head rotation, that would invlolve wierd and abstract formulas for GetAimAngle. I have one right now I'm releasing wihin 15 minutes, then I could try and help you come up with a formula.


Sat Aug 22, 2009 2:38 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Quick Lua Question
No, I mean like the screen view. Not the actor's actual view.


Sat Aug 22, 2009 2:38 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Quick Lua Question
Well then you should make it an actor so you can switch identity to it. I think that's exactly what the problem is. :o You need to make that an actor, THEN attach that other lua script that would never work to it.


Sat Aug 22, 2009 2:42 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Quick Lua Question
Is my method possible without making it an actor?


Sat Aug 22, 2009 2:43 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Quick Lua Question
Um no, unless you spawned an actor in the position of the MOSR then switched identity to that


Sat Aug 22, 2009 2:44 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Quick Lua Question
Alright, that cleared a few things up. Thanks.


Sat Aug 22, 2009 2:45 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Quick Lua Question
Sure np. Hey fyi, all the images in your sig are not working....(this belongs in a pm)


Sat Aug 22, 2009 2:46 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Quick Lua Question
Yeah I know that. I'm waiting for my photo bucket limit to reset. And one of those images are zalo's (a trophy). And I have another idea. Is it possible to kick a human player out of control and move the control cursor to a certain position?


Sat Aug 22, 2009 2:52 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Quick Lua Question
Not that I know of, seeing (I think) it's hard coded and not a variable. (it = cursor)


Sat Aug 22, 2009 2:53 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Quick Lua Question
Okay. But I have another question. In a mision, when you die, your view flies to your (dead) brain. Is that hard-coded or Mission-only Lua?


Sat Aug 22, 2009 2:57 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 22 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.049s | 13 Queries | GZIP : Off ]