Page 1 of 1

Actor Flicker 1 millisec

PostPosted: Thu Jul 10, 2008 1:57 am
by BlarghNRawr
how can i make an actor apear when i press a button, but then dissapear almost instantly?
this is probably really easy but im just stupid...

Re: small question...

PostPosted: Thu Jul 10, 2008 11:42 pm
by feral
sorry for the late reply.

there are three easy ways to make a actor 'appear'.
1. create actor
This can be done using events or directly in the script
eg: CreateActor("test", "icon", "(none)", "(none)", 0, 0, false);

see the script reference for more info
http://game-editor.com/docs/script_reference.htm

2. have the actor suddenly 'move' from off screen to onscreen
that is have your actor somewhere off the game screen and simply change its x and y coordinates to make it 'appear' on screen

3. have the actor in place already but have its transparency set to 1.0 ( fully transparent)
then to suddenly appear set transparency to 0.

this can be done using the changetransparency events or in the script
eg: ChangeTransparency("Event Actor", 1.000000);

again see script reference for more info.

To attach to a key press
The easiest way is to use the keydown event.

next: to make the character disappear.
essentially reverse the method of appearing
eg: destroy actor
or move back off screen
or change transparency to 1.0

if this should happen immediately after the key is released you can use the key up event

to have this occur over a few frames you will need to create a variable, then add 1 to it each frame
then use something like

if (i>10)
{
DestroyActor("Event Actor");
}

you can also use timers there is a good built in tutorial with GE that shoes how to use these..
select Help->Events and Actions->Timers

hope that helps

Re: small question...

PostPosted: Thu Jul 10, 2008 11:56 pm
by BlarghNRawr
k that was rather long but it made sense :lol:
I tried all of those but they dont really work that well
i need to press a key, then the actor appears for a split second only 2 dissapear (without using a key up)
i tried 2 make its transparency start at 0, then go to 1 when the key is pressed. Then i tried 2 use a timer 2 make it dissapear in about a millisecond... but i EPICLY FAIL at using timers lol :lol:

Re: small question...

PostPosted: Mon Sep 15, 2008 1:11 am
by BlarghNRawr
i want the actor to flicker, like 1 millisec...
everything i try fails, when i use a very short timer, it only appears every 5 times you press the button :?: that doesnt even make sense...

Re: Actor Flicker 1 millisec

PostPosted: Mon Sep 15, 2008 1:24 am
by edh
it may depend on what you are trying to accomplish, but what about an animation sequence? if you just want the actor to flicker, why not make two frame animation? you add an animation image file with two frames, one with the actor as it is now, and one blank. then add a sequence (called flicker or something) and when you press the key, change the animation to the flickr animation. You can control the frame rate of the animation in the animation sequence.

Re: Actor Flicker 1 millisec

PostPosted: Mon Sep 15, 2008 1:31 am
by BlarghNRawr
hey i never thought of that!
thanx :D