Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Noclip problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Wed Jul 07, 2021 6:41 am    Post subject: Noclip problem Reply with quote

Here's my noclip code
Code:
function noclipMode(bool)
if bool == 1 then
writeFloat(GameSpeed,0.01);
nm = createTimer(nil);
nm.Interval = 10;
nm.Enabled = true;
nm.OnTimer = function()
if isKeyPressed(98) then
setZPos(5,0,1);
end
if isKeyPressed(104) then
setZPos(5,1,0)
end
if CurrRotate < 0 then
  if isKeyPressed(100) then
  setYPos(5,0,1);
  end
end
if CurrRotate > 0 then
  if isKeyPressed(100) then
  setXPos(5,1,0);
  end
end
if CurrRotate < 0 then
  if isKeyPressed(102) then
  setXPos(5,0,1)
  end
end
if CurrRotate > 0 then
  if isKeyPressed(102) then
  setYPos(5,1,0)
  end
end
if CurrRotate < 0 then
  if isKeyPressed(38) then
  setYPos(5,1,0);
  end
end
if CurrRotate > 0 then
  if isKeyPressed(38) then
  setXPos(5,0,1);
  end
end
if CurrRotate < 0 then
  if isKeyPressed(40) then
  setXPos(5,1,0)
  end
end
if CurrRotate > 0 then
  if isKeyPressed(40) then
  setYPos(5,0,1)
  end
end
if isKeyPressed(37) then
writeFloat(player.TargetRotate,TargetRotate - 0.1);
writeFloat(player.CurrRotate,CurrRotate - 0.1);
end
if isKeyPressed(39) then
writeFloat(player.TargetRotate,TargetRotate + 0.1);
writeFloat(player.CurrRotate,CurrRotate + 0.1);
end
end
end
if bool == 0 then
nm.destroy()
writeFloat(GameSpeed,1);
end
end


But i have problem
Noclip is just broken when im trying to fly forward or backward player just moving in random direction
Same as with numpad 4 and 6
But with 4 and 6 sometimes player fly accurately
2 and 8 setting the Z pos(In game z pos is height,this is not broken)
Back to top
View user's profile Send private message
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Sat Jul 10, 2021 3:01 am    Post subject: Reply with quote

Help someone?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4707

PostPosted: Sat Jul 10, 2021 3:28 pm    Post subject: Reply with quote

You aren't indenting your code properly (annoying to me) and you don't show the definition of set[XYZ]pos anywhere.

If I had to guess, you aren't accounting for the direction the player is facing when increasing/decreasing the position. You need to know basic trigonometry to do that correctly.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Sun Jul 11, 2021 12:45 am    Post subject: Reply with quote

You need piece of code that setting a pos?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4707

PostPosted: Sun Jul 11, 2021 2:04 am    Post subject: Reply with quote

Maybe parameters to set[XYZ]pos are independent of the player's rotation, and the function transforms those coordinates to the game's coordinate space. I don't think that's happening though.

If the set[XYZ]pos functions simply write a value into memory and don't do any math, then I refer to my guess in my previous post. (I'm not going to teach you trigonometry, and I'm not going to write the code for you either)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Sun Jul 11, 2021 2:25 am    Post subject: Reply with quote

It's fine, just in game player rotation is '1 radian = 57.295779513 degrees'
I already maked some fixes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites