Boy, I'm stuck..!

Non-platform specific questions.

Boy, I'm stuck..!

Postby Diana Kennedy » Mon Dec 12, 2005 6:44 am

A few nasty issues:

For some reason I can't make work the "destroy actor" action on a certain actor.

I explain: There is a bird appearing in the game. If someone shoots that bird, a button appears saying "Hey you commited an infraction." I created this button via the bird actor, whith the mouse down event that created a short timer, making appear the button. (In fact, when the player clicks on the bird to shoot it) So far so good. But when I also created a timer that should make the button disappear after a while, it doesn't work.

Is there a limit to the actions / timers that can be created with the same event on the same actor? Or would there be another way to destroy the button after a certain time?
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby ingsan » Mon Dec 12, 2005 11:56 am

No, normally, there isn't a limit for actions on a same actor. But I found it strange that my Timer doesn't work neither :?

Makslane, here is a Bird.ged. Maybe you could check whenether that is a bug.

Image Image Image
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby makslane » Mon Dec 12, 2005 12:32 pm

You need handle the Timer event
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: Boy, I'm stuck..!

Postby makslane » Mon Dec 12, 2005 12:35 pm

Diana Kennedy wrote:when I also created a timer that should make the button disappear after a while, it doesn't work.

Is there a limit to the actions / timers that can be created with the same event on the same actor?


There is no limit. Try create the timer in the button "Create Actor" event.
In the Timer event of button actor, just call "Destroy Actor" action.

Note: You must handle the Timer event in the actor that have a working timer. In this case, it's you button actor.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Mon Dec 12, 2005 1:36 pm

You must handle the Timer event in the actor that have a working timer
Oh yes, you are right !
So here's a new version of Bird !
new BIRD
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby Diana Kennedy » Tue Dec 13, 2005 1:02 am

Hm...I am not sure I could understand. Nevertheless It works for now, because I just stole Ingsans Bird.ged, replaced the graphics and merged it into my game. Not nice, but I hope I can learn a bit how it works. I see that Ingsam worked with a script and wit visibility function, this weas not the case for me, I woirked with path following to make the bird fly and create / destroy actors.

But as a summarsy:

Did I understand right that: When Actor A creates Actor B with a timer, Actor B should have the destroying timer? I put both timers in A, to be started by the mouseclick on Actor , but this didn't work.
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby makslane » Tue Dec 13, 2005 11:48 am

Diana Kennedy wrote:When Actor A creates Actor B with a timer, Actor B should have the destroying timer?.


If you create the timer in the actor B, the actor B must handle the timer events and timer destruction (if is a forever timer)

I put both timers in A, to be started by the mouseclick on Actor , but this didn't work.


Try use the "Create Timer" action in the actor A with this options:

Actor: B
Timer: your timer

Now, in the actor B, you can handle the Timer event to make what you want.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Sun Dec 18, 2005 1:58 am

As for this, thank you! It works by now, die to your help.
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron