Data Realms Fan Forums
http://45.55.195.193/

DS Yosei Lua Spliced
http://45.55.195.193/viewtopic.php?f=75&t=16204
Page 1 of 1

Author:  CaveCricket48 [ Thu Aug 13, 2009 4:05 pm ]
Post subject:  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 232 times

Author:  Flammablezombie [ Thu Aug 13, 2009 10:34 pm ]
Post subject:  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?

Author:  mail2345 [ Fri Aug 14, 2009 4:21 am ]
Post subject:  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.

Author:  CaveCricket48 [ Fri Aug 14, 2009 5:37 am ]
Post subject:  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?

Author:  Grif [ Fri Aug 14, 2009 6:39 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Fri Aug 14, 2009 11:29 pm ]
Post subject:  Re: DS Yosei Lua Spliced

It's working now. Thanks Grif and mail2345.

Author:  NaXx [ Thu Sep 10, 2009 12:07 pm ]
Post subject:  Re: DS Yosei Lua Spliced

Thousand thanks Grif!

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/