Score number as event activator

Non-platform specific questions.

Postby Novice » Mon May 29, 2006 11:20 pm

You have to make sure that you didn't put anything in draw or create actor that would move your background.
Do you have any other events for that actor?
Post the code that you are using to create it.
It's probabliy a small mistake that does it, it happens to me all the time. :wink:
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Diana Kennedy » Mon May 29, 2006 11:58 pm

Yes, I am pretty sure it's just a tiny little problem.

You have to make sure that you didn't put anything in draw or create actor that would move your background.
Do you have any other events for that actor?


Ehw...I am not sure about which actor you talk right now? The one that has to be displayd and that stucks in the upper left corner? (In fact its 2 actors) or the actor that create those two, by using the famous code:

Code: Select all
if (score.textNumber>=120)
CreateActor("swampintro", "introswamp", "no parent", "no path", 0, 0, false);

else if (score.textNumber<120)
CreateActor("gameover", "gameover", "no parent", "no path", 0, 0, false);[/quote]


Well this one is an actor I called timer, that creates the timer that finishes the game and that destroys all charcters of the game. It has the other following script set on the timer:

Code: Select all
stopSound(galopp);


To stop the galoping sound of the rider. But no draw actor event. But the rider (hero) is the parent of the view, to make it follow. At the timer, this changes, also, so it can't be that.

*siiigh*
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 May 30, 2006 1:45 am

What's the event and action that you create the gameover actor?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Tue May 30, 2006 1:54 am

makslane wrote:What's the event and action that you create the gameover actor?


A timer.

The timer is created by an actor "timer" at "create actor". The timer has the said if-script. And this script works so far as it really creates wehter gameover actor or swampintro actor, depending on the score number. But even if I write the coordinates, it does not follow them.

And the timer also has the script:

Code: Select all
view. x = -668;
view.y = -608;


To bring back the view where the swampintro or gameover actors are created, but it does not follow, too.


I am desperated. I worked on hours, trying out any new coordinates, but the view does not obey.
:cry: :cry:

To show the problem:


Here's how the whole things are arranged:

Image

I used those coordinates in the scripts and it gives me this:

Image
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 May 30, 2006 2:44 am

Create the gameover actor with view as parent:

CreateActor("gameover", "gameover", "view", "no path", 497, 410, false);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Tue May 30, 2006 3:01 am

Same problem. Now it's stuck in the upper left corner.

Image

I don't understand this...
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 May 30, 2006 3:16 am

Works here. Please, show the whole script are you using.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Tue May 30, 2006 3:36 am

Actor gametimer creates the timer.

On Timer:

Script Editor:

Code: Select all
if (score.textNumber>=130)
CreateActor("swampintro", "introswampy", "no parent", "no path", 0, 14, false);

else if (score.textNumber<130)
CreateActor("gameover", "icon", "gameover", "no path", -28, -22, false);


Alternatively I made "view" as parent - same result. It doesn'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 Diana Kennedy » Tue May 30, 2006 3:48 am

Maybe it will be more easy if I do not work with create actor but with visibility state. This way, I can place the actors where I want them and the if script just decides which actor shall be visible and which not.

Can you tell me how this code
Code: Select all
if (score.textNumber>=130)
CreateActor("swampintro", "introswampy", "no parent", "no path", 0, 14, false);

else if (score.textNumber<130)
CreateActor("gameover", "icon", "gameover", "no path", -28, -22, false)


Would be like if it is not creaActor but visibiliry state?
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 May 30, 2006 3:51 am

Make the view parent of gameover.
Look the code above.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Tue May 30, 2006 2:39 pm

makslane wrote:Make the view parent of gameover.
Look the code above.


I DID! It does NOT 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 May 30, 2006 2:49 pm

I'm sorry. I don't know what's happen.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Tue May 30, 2006 2:52 pm

:cry: :cry: :cry: :cry:

But could'nt I try it with a visibility statement? as I mentioned above? Which would be the code for that?
Last edited by Diana Kennedy on Tue May 30, 2006 3:12 pm, edited 1 time in total.
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 Novice » Tue May 30, 2006 3:10 pm

Change this
Code: Select all
CreateActor("gameover", "icon", "gameover", "no path", -28, -22, false);
to
Code: Select all
CreateActor("gameover", "icon", "gameover", "no path", -28, -22, true);

The TRUE part means that the actor position is not relative to the creators position. This means that all this time it was relative to the creating actor. Now just enter the right coordinates.
I think that this should solve your problem.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Diana Kennedy » Tue May 30, 2006 3:30 pm

This looked like a very good solution, Novice - but it ddn't work either. :( There must be an other problem. I will try oit the code without any other aditional actors and events, just this to se if eventualy if it works without the other things, those tgings my be the problem.
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

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest