Logo

Conditional screens in SM5?

Register Log In Back To Forums

Post #1 · Posted at 2015-06-12 04:36:23pm 8.8 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

Hello friends, I was wondering how could I create a conditional screen in SM5? I want to create the special ending in SM5 and the shock arrows warning, the conditions are final result in AA or better and a song with mines, but how do I do this? I create the screens in the metrics, but how could SM5 check if the screen meets the conditions to show? Or how can I handle this. Thanks. Very Happy

Post #2 · Posted at 2015-06-12 05:04:34pm 8.8 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."
Each screen has a NextScreen metric and a PrevScreen metric.
You can set these metrics to call lua functions, and then create the lua functions in a file in Scripts. The lua function must return a string that is a valid name for a screen.
For clarity, the default themes use the Branch table to store all the functions they use to control what screen comes next.

If you look at the metrics for ScreenGameplay, you can see that it calls Branch.AfterGameplay. Then you go look at _fallback/Scripts/02 Branches.lua, and you see that it has a function named AfterGameplay. The AfterGameplay function checks a setting in the players' profiles, and sends them off to ScreenHeartEntry if appropriate. Otherwise, it calls Branch.EvaluationScreen to decide where to go. Branch.EvaluationScreen checks whether the game is in online mode, and returns either ScreenNetEvaluation or ScreenEvaluationNormal.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Post #3 · Posted at 2015-06-12 08:54:59pm 8.8 years ago

Offline MadkaT
MadkaT Avatar Member
820 Posts
Not Set
Reg. 2009-11-24

Ohh I see, then I have to create a New Branch on my theme folder and assing it on the metrics. Thanks, I will try, if I have troubles I will come back again.

Post #4 · Posted at 2015-06-12 09:23:39pm 8.8 years ago

Offline Kyzentun
Kyzentun Avatar Member
3,209 Posts
United States
Reg. 2008-02-20

"I'm honestly pissed off."
Just be careful not to replace the Branch table that is used by all the logic in the _fallback theme. Put your branching logic in your own table with a different name.
silenttype01: Kyzentun is never harsh. He says it how it is.

GENERATION 24: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 4% · Database: 8% · Server Time: 2024-04-24 23:56:18
This page took 0.003 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language