Jump to content

Modifying Scripts (LeadWerks)


 Share

Recommended Posts

Hi All,

I'm back at using Leadwerks Engine, boy have I missed it.

I've been playing around with the 3rdPerson script and so far able to add some changes and functions I desire.  For example, the camera free look only works now if right mouse button is held,  also animations integrated and speed changed etc.

Feel pretty good in doing these small things and breaking / fixing the code.

 

I've come to a bit of a stump though, hoping the trusty Leadwerks community can assist.

1. I want the mouse free look to still be active without holding the right mouse button down, but i dont want it to change the angle / direction of player like the default.  I tried adding the same code as default without the right mouse button code,  and removing some Angle entity code thinking thats was moving the player.. but i cant get anything to work.  Any assistance please?

-- Free Look.  If Right Mouse Button Held Down.
	if self.lockcameraangle==false then
		if window:MouseDown(2) then
			local mousepos = window:GetMousePosition()
			window:SetMousePosition(cx,cy)
		
			local mx = Math:Clamp(mousepos.x - cx,-45,45)
			local my = Math:Clamp(mousepos.y - cy,-45,45)
		
			if self.smoothedmousemovement~=nil then
				self.angle = self.angle + mx * self.lookspeed
			else
				self.smoothedmousemovement=Vec2(0)
			end
	
			self.smoothedmousemovement.x = Math:Curve(mx,self.smoothedmousemovement.x,self.looksmoothing)
			self.smoothedmousemovement.y = Math:Curve(my,self.smoothedmousemovement.y,self.looksmoothing)
		end
	end

Secondly, I don't want the player to strafe, instead to turn instead.  Strafing with the walk animation active just does not feel right.  I've tried removing strafe code and adding my own self.Entity:Turn but it wont work.

Any assistance with that is welcome?

 

Finally, I've add my jump animation and works lovely if i jump once on the spot,  soon as I'm moving forward and hitting jump it does not play animation? cant seem to fix it adding in various varible flags etc....

 

Many Thanks in advanced!

 

Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive.

40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it!

Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools.

https://www.youtube.com/@wazmeister3151/featured

Link to comment
Share on other sites

Ok. Fixed the jump animation. Just by moving the jump control and animate code below the walking etc... assuming order did something. So that working pretty ok!

 

 

  • Like 1

Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive.

40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it!

Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools.

https://www.youtube.com/@wazmeister3151/featured

Link to comment
Share on other sites

If anyone can advise on the camera stuff, that be great?

 

Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive.

40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it!

Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools.

https://www.youtube.com/@wazmeister3151/featured

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...