View unanswered posts | View active topics It is currently Thu Dec 26, 2024 9:07 pm



Reply to topic  [ 7 posts ] 
 DS Yosei Lua Spliced 
Author Message
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post DS Yosei Lua Spliced
I would like the DarkStorm Yosei Lua script without the DarkStorm particles and stealth, so the only thing left is the hovering/flying part.

Edit: Here's the original script.
Attachment:
YoseiScript.txt [8.59 KiB]
Downloaded 243 times


Thu Aug 13, 2009 4:05 pm
Profile
User avatar

Joined: Wed Jan 14, 2009 7:12 pm
Posts: 1525
Location: In between your sister's legs, showing her how to use a... PS3 controller!
Reply with quote
Post Re: DS Yosei Lua Spliced
I too would use this. Also, I read through the code and there's a part that says if it isn't player controlled, then walk, crouch and jump=false. Will it be able to walk on its own?


Thu Aug 13, 2009 10:34 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: DS Yosei Lua Spliced
Code:
self.Vel.Y = self.Vel.Y - (TimerMan.DeltaTimeSecs * SceneMan.GlobalAcc.Y)

      if ownController:IsState(Controller.HOLD_LEFT) then
         self.Vel.X = self.Vel.X - self.acceleration;
         if self.Vel.X < -self.maxSpeed then
            self.Vel.X = -self.maxSpeed;
         end
      elseif ownController:IsState(Controller.HOLD_RIGHT) then
         self.Vel.X = self.Vel.X + self.acceleration;
         if self.Vel.X > self.maxSpeed then
            self.Vel.X = self.maxSpeed;
         end
      elseif self.Vel.X < 0 then
         self.Vel.X = self.Vel.X + self.acceleration;
         if self.Vel.X > 0 then
            self.Vel.X = 0;
         end
      elseif self.Vel.X > 0 then
         self.Vel.X = self.Vel.X - self.acceleration;
         if self.Vel.X < 0 then
            self.Vel.X = 0;
         end
      end
      if ownController:IsState(Controller.HOLD_UP) then
         self.Vel.Y = self.Vel.Y - self.acceleration;
         if self.Vel.Y < -self.maxSpeed then
            self.Vel.Y = -self.maxSpeed;
         end
      elseif ownController:IsState(Controller.HOLD_DOWN) then
         self.Vel.Y = self.Vel.Y + self.acceleration;
         if self.Vel.Y > self.maxSpeed then
            self.Vel.Y = self.maxSpeed;
         end
      elseif self.Vel.Y < 0 then
         self.Vel.Y = self.Vel.Y + self.acceleration;
         if self.Vel.Y > 0 then
            self.Vel.Y = 0;
         end
      elseif self.Vel.Y > 0 then
         self.Vel.Y = self.Vel.Y - self.acceleration;
         if self.Vel.Y < 0 then
            self.Vel.Y = 0;
         end
      end

Darlos's grav tester is fairly pointless.
You need to define speed and acceration in create.
The rest should be simple for anyone with basic lua synthax knowlage.


Fri Aug 14, 2009 4:21 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: DS Yosei Lua Spliced
I don't exactly have basic Lua syntax... Yet.

Code:
function Create(self)
   self.maxSpeed = 10;
   self.acceleration = 0.2;
   self.Vel = Vector(0,0);
   self.RotAngle = 0;
   self.rotFactor = 0.2;
end

function Update(self)
self.Vel.Y = self.Vel.Y - (TimerMan.DeltaTimeSecs * SceneMan.GlobalAcc.Y)

      if ownController:IsState(Controller.HOLD_LEFT) then
         self.Vel.X = self.Vel.X - self.acceleration;
         if self.Vel.X < -self.maxSpeed then
            self.Vel.X = -self.maxSpeed;
         end
      elseif ownController:IsState(Controller.HOLD_RIGHT) then
         self.Vel.X = self.Vel.X + self.acceleration;
         if self.Vel.X > self.maxSpeed then
            self.Vel.X = self.maxSpeed;
         end
      elseif self.Vel.X < 0 then
         self.Vel.X = self.Vel.X + self.acceleration;
         if self.Vel.X > 0 then
            self.Vel.X = 0;
         end
      elseif self.Vel.X > 0 then
         self.Vel.X = self.Vel.X - self.acceleration;
         if self.Vel.X < 0 then
            self.Vel.X = 0;
         end
      end
      if ownController:IsState(Controller.HOLD_UP) then
         self.Vel.Y = self.Vel.Y - self.acceleration;
         if self.Vel.Y < -self.maxSpeed then
            self.Vel.Y = -self.maxSpeed;
         end
      elseif ownController:IsState(Controller.HOLD_DOWN) then
         self.Vel.Y = self.Vel.Y + self.acceleration;
         if self.Vel.Y > self.maxSpeed then
            self.Vel.Y = self.maxSpeed;
         end
      elseif self.Vel.Y < 0 then
         self.Vel.Y = self.Vel.Y + self.acceleration;
         if self.Vel.Y > 0 then
            self.Vel.Y = 0;
         end
      elseif self.Vel.Y > 0 then
         self.Vel.Y = self.Vel.Y - self.acceleration;
         if self.Vel.Y < 0 then
            self.Vel.Y = 0;
         end
      end
end


Help?


Fri Aug 14, 2009 5:37 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: DS Yosei Lua Spliced
Find/replace "ownController" with "self:GetController():" in that snippet. Should work.

Basically, uh, Darlos created a pointer to the controller of the Yosei unit beforehand so that he could reference it more easily.

Other than that should work fine.


Fri Aug 14, 2009 6:39 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: DS Yosei Lua Spliced
It's working now. Thanks Grif and mail2345.


Fri Aug 14, 2009 11:29 pm
Profile
User avatar

Joined: Mon Feb 02, 2009 9:18 pm
Posts: 618
Location: Ancient Hispania
Reply with quote
Post Re: DS Yosei Lua Spliced
Thousand thanks Grif!


Thu Sep 10, 2009 12:07 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.377s | 14 Queries | GZIP : Off ]