|
FAQ
• Search • Login
|
Author |
Message |
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Quick Lua Question
Again, pretty sure it's hard-coded. One sec lemme ask paul- Ok I guess it's not. Code: self:SetObservationTarget(self:GetPlayerBrain(player).Pos, player); This sets the observation, or view, to whatever you want. SO I guess you can change the view to whatever you want. Hope this helps.
|
Sat Aug 22, 2009 3:05 am |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Quick Lua Question
Code: for player = 0, self.PlayerCount - 1 do -- Check if we already have a brain assigned if not self:GetPlayerBrain(player) then self.braindead[player] = false; local brain = CreateActor("Brain Case"); brain.Pos = Vector(3348,1128-player*24); brain.RotAngle = math.rad(270); -- Let the spawn into the world, passing ownership MovableMan:AddActor(brain); -- Set the found brain to be the selected actor at start self:SetPlayerBrain(brain, player); SceneMan:SetScroll(self:GetPlayerBrain(player).Pos, player); self:SetLandingZone(self:GetPlayerBrain(player).Pos, player); -- Set the observation target to the brain, so that if/when it dies, the view flies to it in observation mode self:SetObservationTarget(self:GetPlayerBrain(player).Pos, player); end end Look through this code, and you'll find, hopefully, what you need. Double post so CC can see it and know it's a new post. :3
|
Sat Aug 22, 2009 3:09 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Quick Lua Question
Doesn't work in "function Update(self)." I'm guessing it's only for "function asdf:Activity." Also, I think Observation mode is only when your brain dies, so that won't work.
|
Sat Aug 22, 2009 3:17 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Quick Lua Question
Observation target is where your view goes when you die.
You want SetScrollTarget, which is not perfect but mostly good.
Also, Mind, stop copying and pasting my Lua advice esp. when I can't tell what the ♥♥♥♥ you're asking me half the time.
|
Sat Aug 22, 2009 3:18 am |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Quick Lua Question
K love you too.
|
Sat Aug 22, 2009 3:19 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Quick Lua Question
I have "self.target.SetScrollTarget = self.Pos;" but doesn't do anything or give errors. Unless, this only works when the "target" is in control curser mode?
|
Sat Aug 22, 2009 3:29 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Quick Lua Question
Lua 102: pointer.name is a property pointer:name is a function
self.target.SetScrollTarget is just going to make a pointer property of self.target called SetScrollTarget not call the function you need. You're also going to need arguments, you know, like for every function?
|
Sat Aug 22, 2009 4:37 am |
|
|
|
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
|
|