|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Wed Nov 15, 2017 5:42 am Post subject: Animation that plays before the form shows up |
|
|
Hello guys!
I want to make a short animation (1-2second long), that plays before the trainer form shows up.
I already read some stuff about the animation, and how to make it work using a timer, but i dont know if it's possible to run it before the trainer shows up.
Any suggestions?
I tried to search for a thread or something related, but i can't find anything.
Thanks!
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25281 Location: The netherlands
|
Posted: Wed Nov 15, 2017 7:13 am Post subject: |
|
|
create a new form (borderless, centered on the screen) with the animation in it.
when the last frame has been rendered (or after 2 seconds) hide/destroy that form, and show the trainer form
(So don't show the trainerform when it launches, show the animationform instead)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Wed Nov 15, 2017 10:52 pm Post subject: |
|
|
oh! That makes sense.
Thanks DB!
|
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Fri Nov 17, 2017 7:29 am Post subject: |
|
|
Hello once again
I am trying to figure out how to hide the form when the last frame gets rendered, but i cant seem to figure it out. I used the timer from /viewtopic.php?t=579732 , and it works like a charm. But i cant figure out how to stop it..
From my understanding, some thing like Code: | If frame == 30 then
UDF1.Close() |
should work. But it doesnt. It just keeps cycling through the frames.
Thanks once again, and sorry!
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25281 Location: The netherlands
|
Posted: Fri Nov 17, 2017 7:58 am Post subject: |
|
|
add a showMessage() to see if your code gets executed (perhaps frame is never 30)
(and your animation form is called UDF1?l
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Fri Nov 17, 2017 9:20 am Post subject: |
|
|
I guess that you meant to add it in the if statement i mentioned. Well, it works and it displays my message. But not when frame_030 gets rendered. It shows up everytime i execute the code.
And yes, i didn't name the form(for now). I thought that i understand timers, but i guess not
Here is the code
Code: |
UDF1.Show();
playSound(findTableFile("test.wav"))
local ts,r=tostring,nil;
r = function(s,c,l)s,c,l=ts(s),ts(c),l+0;s=(#s<l and r(c..s,c,l) or s);return s;end; -- simple function to pad zeros
local main = UDF1.CEImage1; -- target
local fmin,fmax = 0,30; -- min frame, max frame
animation = animation or createTimer(getMainForm(),true);
animation.Interval = math.floor(1/30*1000); -- 30 fps
animation.onTimer = function (t)
local tag,id = string.match(main.Hint,"(%a+)_(%d+)"); -- find frame and the number from Hint
if (tag and id) then
id = (id+0>=fmax and fmin or id+1);
else
tag,id = 'frame',0; -- hint is not set, so let's set it.
end
local frame = string.format('frame_%03d.gif',id) -- frame_001.gif for example
main.Hint = frame; -- Storage.. lazy to use a variable;
main.picture.loadFromStream(findTableFile(frame).stream); -- find table file and load it into the image object
end
if frame == frame_030 then
showMessage("works")
end
UDF1.OnClose = function (sender)
return caFree
end
|
Thanks once again
|
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Sat Nov 25, 2017 1:01 pm Post subject: |
|
|
Anyone? Sorry for double posting
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Nov 25, 2017 2:38 pm Post subject: |
|
|
Gou wrote: | Well, it works and it displays my message. But not when frame_030 gets rendered. It shows up everytime i execute the code. |
That's because you have something like this
Code: |
animationForm.show()
-- setup animation timer that will start to change the image
animation.onTimer = function (t)
... -- change image
end
-- check if on frame_030
-- note the timer was just created, it may not have even had time to run yet
-- also using global 'frame' variable not the 'frame' variable created in the animation timer (which is "local" to that function)
if frame == frame_030 then
showMessage("works")
end
|
put the check inside the timer so that it's checked when the frame is changed.
|
|
Back to top |
|
|
Gou Cheater Reputation: 0
Joined: 02 Oct 2017 Posts: 39
|
Posted: Sat Nov 25, 2017 3:23 pm Post subject: |
|
|
Well, i feel stupid now. That makes sense. Thanks man!
Using showMessage ended up just spamming the string that i typed, but Close() seems to work fine.
This is the code right now, and it seems to work fine
Code: | UDF1.Show();
local ts,r=tostring,nil;
r = function(s,c,l)s,c,l=ts(s),ts(c),l+0;s=(#s<l and r(c..s,c,l) or s);return s;end; -- simple function to pad zeros
local main = UDF1.CEImage1; -- target
local fmin,fmax = 0,30; -- min frame, max frame
animation = animation or createTimer(getMainForm(),true);
animation.Interval = math.floor(1/30*1000); -- 30 fps
animation.onTimer = function (t)
local tag,id = string.match(main.Hint,"(%a+)_(%d+)"); -- find frame and the number from Hint
if (tag and id) then
id = (id+0>=fmax and fmin or id+1);
else
tag,id = 'frame',0; -- hint is not set, so let's set it.
end
if id == 30 then
UDF1.Close()
end
local frame = string.format('frame_%03d.gif',id) -- frame_001.gif for example
main.Hint = frame; -- Storage.. lazy to use a variable;
main.picture.loadFromStream(findTableFile(frame).stream); -- find table file and load it into the image object
end
UDF1.OnClose = function (sender)
return caHide
end
|
Thanks once again!
|
|
Back to top |
|
|
|
|
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
|
|