How to check something that repeatedly comes up

You can ask the question and tag @szaal or someone/anyone else you find helpful so when they get on they’ll see your post in notifications and answer asap :relaxed:

Thanks for the helpful information.

1 Like

Noooh! Why did you do that?
You shall take responsibility of your doing :angry:

Sees @MightyMadness
Oh, right! What can I help you with? :blush: :pray:

2 Likes

You are doing it in choice script right ?

After each shot fired put a *gosub ammocheck

*label ammocheck
*if (ammo = 0)
    *set boolean false
    *goto differentpath
*else 
    *return

1 Like

Thank you for that great answer.

No problem. :+1: ( 20 characters )

Ok, ok, ok, ok, New question. I have two weapons and I only want the second weapon to be used if the first weapon is out of ammo. Here is what my variables and booleans are looking like.

First Weapon
nine = nine is the ammo variable
ninegun = this is the boolean for the weapon itself and if its set false i want it to change to weapon two

Second Weapon
revolver = revolver is the ammo variable
revolvergun = revolvergun is the boolean for the weapon itself and if its set false i want the character to die

Sorry that I am getting you guys to do the coding for me and I am basically telling you my story in each question I ask lol. But I just need to get to know the coding so that I dont have any trouble writing these anymore and I will be able to make more choice of games stories without any help. Thank you for all the work you help me with!

Used as in choice or as in text ( I.e. if one is out of ammo option two will be used everywhere )

1 Like

For choice

*choice
    *selectable_if ( nine > 0 )
        #Ninegun
            *set ninegun true
            *set revolvergun false
            *goto lol
    *selectable_if  (revolver > 0)
        #Revolver 
            *set revolvergun true
            *set ninegun false
            *goto lol
    *if ((revolver = 0) and ( nine = 0 ))
        #You died
            *goto ending

For text

*if ( nine > 0 )
    *set ninegun true 
    *set revolvergun false
    *goto lol
*if (( nine = 0 ) and ( revolver > 0 ))
    *set ninegun false
    *set revolvergun true
    *goto lol
*else
    *goto ending

*label lol
*if (ninegun = true)
    Ninegun text
*if (revolvergun = true )
    Revolvergun text


*label ending
You died
2 Likes

In both options instead of Goto-ing you can also display text there ( where goto is ) with each option having its specific flavour text.

So, do you want the player to switch their weapon manually if the weapon runs out of ammo, or will the game switch the weapon automatically?

The former will require the player to pass a *choice, while the latter is just simply require a conditional check.

1 Like

I want as text not choice and it will automatically switch the weapon for the player.