A checking system

So I’m making a game where if you become a fugitive you have a suspicion meter and as it rises a council comes closer to capturing you and when it reaches 100 the council grabs you.

The problem is that I don’t know how to code this and that this happens ONLY when you become a fugitive, so if your not a fugitive you shouldn’t be captured. Can anyone help

Create a subscene (?is that the name I forget it’s been a long time since I coded) and direct the code toward that every time your suspicion increases

Have the scene check if it’s 100% and if it is, it redirects you to like gameover.txt or something

Unfortunately if using fairmath, the highest a percentage can go is 99 or use fixed increases for every mistake made – which may become quite a handful compared to using fairmath – and then at specific intervals in the code having an if statement checking if suspicion is higher than 90, and if so using a goto for a capture scene. Idk if you’re wanting it to prematurely end the game or whatnot.

I created something super simplistic that can utilize this concept.

*create suspicion 0

Let me rob something.
*choice
  #Rob something successfully.
    Cool!
    *goto next
  #Rob something unsuccessfully.
    Crap…
    *set suspicion +50
    *label next
    
    You go into the next room, where there's more things to rob!
    *choice
      #Rob something successfully.
        Amazing, you're a natural!
        *goto next1
      #Rob something unsuccessfully.
        Dang it bobby.
        *set suspicion +50
        *label next1
        *if (suspicion = 100)
          *label failure
          
          Someone caught you for being bad at your job.
          *finish
        *else
          You escape with the loot you were able to successfully grab.
          *finish

Why not make a check of a “Fugitive” variable that triggers whenever your suspicion meter reaches 100?

Fugitive = on/off

When suspicion = 100 goto sub council_scene

sub council_scene

if fugitive = yes/1 then goto sub capture

if fugitive = no/0 then go to continue_game …

So right now I have

*If (Fugitive = true)
*percent fugitive

In my stats and

*create Suspicion
*create Fugitive false

But I want it to check every time you make a desicion but not to check if your not a fugitive

But I’m gonna try @Eiwynn ideas

Suspicion is hidden until revealed by the choices the player makes so it didn’t work in my fugitive scene because even tho I wasn’t a fugitive I was still brought to my council.

Maybe it was a error on my part

Try making the Boolean a different name other than fugitive. It may be messing up because you have two different types of variables named the same.

Right I didn’t notice I have to change it to

*If (Fugitive = true)
*percent Suspicion

Let me see if it works

Okay it fixed the error but I still get sent straight to the council regardless of being a fugitive or not.

Prereqs

*create fugi false
*create susp 0
*create capture_scene false

Fugitive flag switch

*choice
   #Become a fugitive
      *set fugi true

Fugitive meter modifier

*set susp +X
or
*set susp -X

100% suspicion checker

*label check_susp
*if fugi and (susp >= 100)
   You're captured or something
   *set capture_scene true
*return

Checking and transition to capture scene

*gosub check_susp
*if capture_scene
   <<can be filled with custom scene-per-chapter that fits the current narrative>>
   *goto <A chapter where the MC gets captured>

Note that this system allows your suspicion to raise to 100% even without being a fugitive. When player does became one, they’ll get insta-captured without warning.

1 Like

Where would I put the Suspicion checker before or after the text

Put it whenever you want the narrative to check if player should be captured or not.

1 Like

I mean would it be like

Text text text textText text text textText text text textText text text text
*if fugi and (susp = 100)
You’re captured or something
*set capture_scene true
*return

Or

*if fugi and (susp = 100)
You’re captured or something
*set capture_scene true
*return
Text text text text

And how to you properly use *return i’ve never used it before.

Oh, I see what you meant.

*label check_susp is a subroutine: a code that can be reused without copy-pasting it all over the place. If you’re unfamiliar with subroutine, I’d recommend to learn about *gosub and *gosub_scene command.

2 Likes

So let me see if I can code this right before trying it.

*create Fugitive false
*create Suspicion 0
*create captured false
  #Run away from council
   *set Fugitive true
   *set Suspicion +50
*Label check suspicion 
*if Fugitive and (Suspicion >= 100)
 *set captured true
*return
*gosub check_ suspicion 
*If captured true
 *goto captured_scene
*else
 Text text text text text text text text text text text 
1 Like

*label subtext shouldn’t contain any spaces, as well as its *gosub counterparts. Otherwise, it’s p good.

2 Likes

So *Check_Suspicion so on right?

*label check_suspicion

Pretty much like variable declaration *create, as well as the rules (no space, Capitalization is discouraged).

1 Like

I’m having a problem with the *else even tho the text under it is indented it’s completely ignoring the *else and going to the capture scene

*gosub check_ suspicion 
*If captured true
 *goto captured_scene
*else
 You were always on the move, traveling by night and resting by day. You soon discovered that the sun burn't your skin and that it could kill you if you stayed in it  long enough.

 It was your dad's job to get the food and your mom's to find a place for yall to sleep and eventually it was your responsibilty to cook dinner

Don’t capitalize the If in *If captured true. Other than that, I wouldn’t be able to pinpoint any other error without seeing more of the previous code.

1 Like