Stop a global variable from being higher/lower than another

Get help using Construct 2

Post » Sun Aug 31, 2014 8:49 pm

Hey guys, thanks for the beautiful and quick help so far.

My question this time is;
How do I stop a global variable from going over/under another global variable?

Say I have two global variables, one that stores the amount of missiles I have (Missile Ammo). And another that holds the maximum number of missiles I can hold (Maximum Missiles).

I have a UI with a text box set to make the text show the Missile Ammo variable.
How do I make it so that Missile Ammo doesn't go over Maximum Missiles (say MM is 10, how do I make Missile Ammo not go over that value?)

Also for my health global variable, I need to make it so that once it hits zero, it doesn't go into negatives.

Any help? I hope this is understandable.

Thanks for any suggestions and/or screenshots!
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Sun Aug 31, 2014 9:06 pm

Something like:
In the event where you add to your ammo add a subevent if ammo>MM set ammo: MM

Same applies to the health

in the event where you subtract from the health add a subevent health<0 set health:0
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Aug 31, 2014 10:42 pm

Another method. Hope it helps.
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Sep 03, 2014 11:09 am

Thanks guy, helped a lot! Sorry for the slow reply.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests