Can anybody spot what's wrong in my event commands?

Nosidag

Veteran
Veteran
Joined
Sep 29, 2013
Messages
30
Reaction score
3
First Language
English
Primarily Uses
I'm trying to make a game collecting chickens, and I got the part where I collect the chickens/variables just fine. But I want it timed, and I set conditions(or atleast am trying to) to where If I get all the chickens the clock automatically stops and congratulates you, and moves on, or when and if the clock stops and you don't have enough. But it keeps LOOPING back to where it tells me I don't have enough chickens over and over. How do I stop this error? I've tried making another page, with a switch where it does nothing, and what will happen is, the clock will hit zero and nothing happens, or I get all the chickens and nothing happens. So I'm back to square one. Where am I going wrong? Thanks in advance. Oh and also, how do I start an automatic event to where the screen is ALREADY black? Lol. I keep having an issue where when I playtest, it shows the map and my player and THEN goes black or fades.

untitled.png
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
After the Congratulations section you should get out of the loop created by the parallel process (they always loop by themselves). You can set a self switch to A and create a second page activated by this switch with nothing in it.
 

Nosidag

Veteran
Veteran
Joined
Sep 29, 2013
Messages
30
Reaction score
3
First Language
English
Primarily Uses
I had tried that, @ self switch, and what happened was when the timer hit zero, nothing happened..it's almost as if the game had skipped over all my success/failure conditional switch events and went straight to turning on the switch, where nothing happens.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
I had tried that, @ self switch, and what happened was when the timer hit zero, nothing happened..it's almost as if the game had skipped over all my success/failure conditional switch events and went straight to turning on the switch, where nothing happens.
Please use [Alt]+[Printscreen] and then insert into paint (or another picture program) to make the screenshot. That way we could see the entire event, because one of the most important parts of the event is missing in your Screenshot: the page list.

To get out of a parralel process, you need two event pages, the empty one conditioned to a self switch that is controlled at the end of the parallel process page.

Only using a control switch without making a page conditioned to that switch won't have any effect.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
I reproduced your script and got it working I think. Here are my modifications :

- Very first line :

Add a Label and name it, say "start"

- Before the conditionnal test for 8 chickens :

Add another Label and name it, say "test"

- At the end of this conditionnal (just below the text "Congratulations" but still inside this section)

Control Switch A=ON

And add another event page with the condition set to this switch to be ON. It does nothing in my case but you can start another cutscene or whatever.

- At the end of the other conditionnal (timer==0), just below the "sorry" text :

Jump to label : Start (or any name you set before)

- At the very end :

I added a Wait 2 frames just to avoid lag. Not sure if needed.

and insert a

Jump to label : Test (or any name you set before)

It works for me in my quick test.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
youre doing it wrong here. If you want to use the current format, you have to enclose the two conditionals in a loop. add a wait 5 frames after both conditions to avoid some lag, and within each condition also add "break loop" last. at the end of all this, self switch to a deactivated page like everyone's said.

that should be all you need assuming you did everything else right.

edit: the way it is right now, it goes through each command and only checks the conditionals once before looping to the beginning.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to VX Ace Support. Please be sure to post your threads in the correct forum next time. Thank you.

Yes, you're taking the wrong approach.

I would split this into 3 different events, and I'd put some of the processing into each 'chicken' event that you're supposed to catch.

Event 1:

Page 1: Autorun

Wait 200 frame(s)Fadein ScreenTint Screen: (0, 0, 0, 0), @1, Wait (why do you have a fadein AND a tint?)Text: Ready? ....\{ Start!Wait 60 frames(s)Play SE: 'Bell3', 80, 150Control Timer: Startup (0, min. 30 sec.)Play BGM: 'Town1', 100, 145Control Switches [0001: Started] = ONPage 2: Action ButtonConditions: Switch [0001: Started] is ON

no event commands

Event 2:

Page 1: Parallel Process

Conditions: Switch [0001: Started] is ON

Conditional Branch: Timer 0 min 0 sec or lessPlay BGM: (None)Wait 60 frame(s)Play SE: 'Buzzer1', 80, 100Wait 120 frame(s)Text: Aww I'm sorry, but you've only caught \v[3] chickens. Better luck next timeThen on each chicken event, after adding to variable [0003: Chickens caught], add this:
Code:
Conditional Branch: Variable [0003: Chickens caught] == 8Control Timer: StopPlay BGM: (None)Wait 60 frame(s)Play SE: 'Bell2', 80, 100Wait: 120 frame(s)Play SE: 'Applause1', 80, 100Wait: 120 frame(s)Text: Congratulations!  You did it!
(This could also be set up as a common event, and each 'chicken' event could just do a Call Common Event, so you don't have to repeat the code on all of them)You still need to do more, as nowhere in this event do you say what to do AFTER all chickens are caught, or after the timer runs out. Are they meant to do it all again? If so, in the event that checks the timer, reset the variable, make the chickens all come back so there's enough to be caught, and turn off the switch to make it all start again. If they're meant to be able to do something else on the same map, you'll need an extra page on the timer event conditioned by a switch, set to action button with no event commands, and turn on that switch in the '8 chickens caught' test. If they're meant to go to another map, then you should have a transfer event in there somewhere.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
@Shaz : I'm definitely not a pro on scripts, but that looks more complicated than my solution, which I tried and worked. Do I get something wrong in my script ?

(Sorry, if this is considered hijacking the thread, just delete this post).

Label: startText: Ready? ....\{ Start!Wait 60 frames(s)Play SE: 'Bell3', 80, 150Control Timer: Startup (0, min. 30 sec.)Play BGM: 'Town1', 100, 145Label: test Conditional Branch: Variable [0001: Chicken] == 8 Control Timer: Stop Play BGM: (None) Wait 60 frame(s) Play SE: 'Bell2', 80, 100 Wait: 120 frame(s) Play SE: 'Applause1', 80, 100 Wait: 120 frame(s) Text: Congratulations! You did it! Control Self Switch: A = ONElseBranch EndConditional Branch: Timer 0 min 0 sec or less Play BGM: (None) Wait 60 frame(s) Play SE: 'Buzzer1', 80, 100 Wait 120 frame(s) Text: Aww I'm sorry, but you've only caught \v[1] chickens. Better luck next time Jump to Label : startBranch EndWait 2 frame(s)Jump to Label : test
I didn't reset the number of chickens caught nor the chickens themselves, but that's not the most difficult part.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
@Shaz : I'm definitely not a pro on scripts, but that looks more complicated than my solution, which I tried and worked. Do I get something wrong in my script ?

(Sorry, if this is considered hijacking the thread, just delete this post).

Label: startText: Ready? ....\{ Start!Wait 60 frames(s)Play SE: 'Bell3', 80, 150Control Timer: Startup (0, min. 30 sec.)Play BGM: 'Town1', 100, 145Label: test Conditional Branch: Variable [0001: Chicken] == 8 Control Timer: Stop Play BGM: (None) Wait 60 frame(s) Play SE: 'Bell2', 80, 100 Wait: 120 frame(s) Play SE: 'Applause1', 80, 100 Wait: 120 frame(s) Text: Congratulations! You did it! Control Self Switch: A = ONElseBranch EndConditional Branch: Timer 0 min 0 sec or less Play BGM: (None) Wait 60 frame(s) Play SE: 'Buzzer1', 80, 100 Wait 120 frame(s) Text: Aww I'm sorry, but you've only caught \v[1] chickens. Better luck next time Jump to Label : startBranch EndWait 2 frame(s)Jump to Label : test
I didn't reset the number of chickens caught nor the chickens themselves, but that's not the most difficult part.
Shaz' method is considered cleaner and easier to follow because it's split into separate pages. Your method is similar to mine, except you use labels instead of loops. Plus, your version doesn't have a way to exit the event. He doesn't want it to loop, so you would move that label to the bottom and have it exit the event via a self switch, erase event or what have you.

I prefer the loop because you can see clearly what is inside it, as opposed to looking for the labels that don't indent the enclosed area within. Labels are more often used for complicated eventing that requires a lot of back and forth movement. In this case, a loop would be preferable.

Also, this isn't considered scripting, this is purely eventing.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
Oh yes, eventing and not scripting, my bad.

I see your point in the loop/label distinctions. I'm not used to this kind of eventing but it will surely come in handy to know how it works.

Thanks for the clarifications.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top