Actor Flicker 1 millisec

Non-platform specific questions.

Actor Flicker 1 millisec

Postby BlarghNRawr » Thu Jul 10, 2008 1:57 am

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...
Last edited by BlarghNRawr on Mon Sep 15, 2008 1:13 am, edited 2 times in total.
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: small question...

Postby feral » Thu Jul 10, 2008 11:42 pm

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
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: small question...

Postby BlarghNRawr » Thu Jul 10, 2008 11:56 pm

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:
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: small question...

Postby BlarghNRawr » Mon Sep 15, 2008 1:11 am

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...
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Actor Flicker 1 millisec

Postby edh » Mon Sep 15, 2008 1:24 am

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.
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: Actor Flicker 1 millisec

Postby BlarghNRawr » Mon Sep 15, 2008 1:31 am

hey i never thought of that!
thanx :D
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron