Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
Enter Animations

Complicated Event

Question

Okay, I know this is a simple-sounding event, but all the things I've tried to do have made the game freeze! >:o

I'm trying to make a certain event only play at night. (I've already made "Night" into a common event and trigger, I just don't know how to make it into a sequence...)

Here's how I tried it...

 

I made the "Day" and "Night" into common events that just change the color and made it autorun to day and night respectively... but every time the common event is activated, the game freezes.

 

Now my query...

 

I just want to make a candle light up during the night and be unlit during the day! Can anyone help me?

 

(If you could MSG me VIA MSN, that would be nice. Mines GotQuestions@Hotmail.com)

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

For the freezing bit, make sure that the event which called the common event is not in Autorun, but Parallel Process. For the cadle light only during the day, it will need to use conditional branches, self-switches and calling parts of your common event. If you post a demo with the day and night common event in, I can code one for you if you so wish.

Share this post


Link to post
Share on other sites
  • 0

[!]Your Answer in bold

Don't make your day and night sequence linear.

Just make two variables: Minutes and Hours.

Every 20 frames add to minutes

If Minutes = 60

Add +1 to Hours

Set Minutes to 0

When Hours = 24

Set Hours to 1

 

When hours = 18

Switch:0001 [Lights] = On

 

etc...

Share this post


Link to post
Share on other sites
  • 0

[!]Your Answer in bold

Don't make your day and night sequence linear.

Just make two variables: Minutes and Hours.

Every 20 frames add to minutes

If Minutes = 60

Add +1 to Hours

Set Minutes to 0

When Hours = 24

Set Hours to 1

 

When hours = 18

Switch:0001 [Lights] = On

 

etc...

I'm not familiar with variables, I'd be forever in your debt if you could show me how to do what you just said! :D

Share this post


Link to post
Share on other sites
  • 0

Ok, here's how you can do it:

Timer.zip

 

In this demo you have 3 control events at the top of the map. It should be noted that these use the trigger parallel process, so the game does not freeze. In the first event, the variables are setup exactly how you want them. Every 20 frames (appox. 1sec) the minutes variable is increased by 1. Once the mintues variable gets to 60, it resets to 0 and the hours variable is increased by 1.

 

I have set up this particular demo to turn on the a switch when the hour variable = 1, so test the demo and wait on the map for a minute to test it. The other two control events set this up.

 

By the way, this is very bad way to create a day/night if that is what you're trying to do. For the system to work on more than one map, you have to the copy the event to all of those maps. It isn't very efficient, and there are scripts for this. But this demo does do what you originally wanted, its just very limited. For example, because you didn't request it, the hours variable will continue to go up and not reset at 24.

Share this post


Link to post
Share on other sites
  • 0

But If I wanted to make the hours reset, all I'd have to do is put in another looped conditional branch, right? (Thank you very much by the way, this helps a lot, regardless of how inefficient it is) I'm not making an incredibly complex game, so I don't mind having to do a few extra things.

 

 

EDIT -

 

Oh wait, okay, I just turn the switch controlling nighttime off, huh? Nevermind. I'll play around with this and figure it out.

 

Thank you very much! This is a big help, I'll be sure to mention you in the credits. XD

Share this post


Link to post
Share on other sites
  • 0

You would another conditional branch inside the loop. In words, where hours = 24, set variable hours to 0.

 

No problem, I'm glad we solved your problem. No need to add in the credits, it is what we're here for. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...