| View previous topic :: View next topic |
| Author |
Message |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Fri Jan 08, 2016 7:54 pm Post subject: Animation not work in CE 6.5 |
|
|
This is a CETrainer by mgr.inz.Player :
http://forum.cheatengine.org/viewtopic.php?t=562691
The animating background not work in CE 6.5.
Is it cause by alpha blend setting or other ?
Rgds |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Jan 09, 2016 2:17 pm Post subject: |
|
|
This is because Dark Byte switched from Lua 5.1 to 5.3.
In Lua5.1, function lua_tointeger truncates floating-point values ( like 10.3 ==> 10)
From what I see in lua5.1-32.dll, there is cvttsd2si ("Convert Scalar Double-Precision Floating-Point Value to Signed Doubleword Integer with Truncation")
In Lua5.3, function lua_tointeger works differently. (like 10.3 ==> 0). So, my script has to be updated. Bunch of math.floor functions. But, it might add some extra overhead...
Hmm, maybe it would be better to add such function to LuaHandler.pas:
| Code: | function lua_tointeger_alt(L: Plua_State; idx: Integer): lua_Integer; cdecl;
var
isnum: Integer;
begin
result:=lua_tointegerx(L,idx,@isnum);
if isnum=0 then
begin
result:=trunc(lua_tonumberx(L,idx,@isnum));
if isnum=0 then raise exception.create('Not valid integer');
end;
end; |
And use it in all places where are high chances that user will use calculated values. _________________
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Sat Jan 09, 2016 7:49 pm Post subject: |
|
|
Thank mgr.inz.Player
So it's better to re-read for some Lua 5.1 function and adapting it all to Lua 5.3 or doing a debugging. Because some of my trainers made by Lua 5.1 also not running in CE 6.5 (Lua 5.3).
Thank again for solution and information.
Regards |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Jan 09, 2016 8:16 pm Post subject: |
|
|
Some can be easily fixed. Below cetrainer file has those math.floor in some places.
But, I think DB could do some changes in lua.pas to make CE6.5 more backward compatible.
For example, I tried below function and compiled CE myself:
| Code: | function lua_tointeger(L: Plua_State; idx: Integer): lua_Integer; cdecl;
var
isnum: Integer;
begin
result:=lua_tointegerx(L,idx,@isnum);
if isnum=0 then
begin
result:=trunc(lua_tonumberx(L,idx,@isnum));
if isnum=0 then result:=0;
end;
end; |
starsAnimation and NFOWindow (my old Lua scripts) now work normally.
I already mentioned about this in "CE 6.5 bugs" thread. _________________
|
|
| Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Sun Jan 10, 2016 8:09 pm Post subject: |
|
|
Many thanks, Now I can learn where is different in script coding by comparing your two CT files.
This is very helpful for me to learn more.
Regards |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Jan 11, 2016 8:36 am Post subject: |
|
|
Re-download CE6.5 from main page and reinstall. _________________
|
|
| Back to top |
|
 |
|