Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Alterable value = 1, do one thing
Alterable valye = 0, do another.
Or, on the same event you're using to change the alterable value from 1 to 0, copy that same event and instead of changing the value, add an additional check to whatever other condition/s you already have in place, so that it also checks to see if alt value = 1.
This way, say your set up lets you have your alterable value at 2, and you can set it to 0. Well with the additional check that if alterable value = 1, the event won't actually fire in any other circumstance.
I bought VACCiNE 2 as my input system, and it works like "if Z on keyboard/A on xbox gamepad/Circle on PS4 controller is pushed, set the alterable value "JumpPressed" to 1."
It must check if the buttom is pressed every frame, so even I change the value after I got the event it still got instant refreshed.
I want to press the buttom to toggle a flag, and I don't want it to do that 60 times a second.
Maybe VACCiNE 2 has the solution itself, but I often find it inconvenient when I can't just detect variation per frame especially when it's related to physics.
So... do I have to wish for that in CTF 3?
It has no Global value in its mfa file.
The only way I can think of for now is to get the condition "Is the value CHANGED to 1 this frame?" so it goes like "upon pressing a buttom" instead of "repeat while a buttom is pressed."
If I can't figure out how to get the control done, I would have to redo the level desigh I guess.
"If previous value = 0"
and "Current value = 1"
Do blablabla
I hope you understood that. I'm terrible at explaining
♥♥♥♥♥♥♥♥♥
IT WORKED
So, I just figured out how to detect the changing in alterable value, let me try to explain how I did it.
How to know the value from last frame and use it in calculation?
Just creat another value and have a always event "set value* to value" and put this after the
target event but before the events that changes the value. This order matters A LOT.
In my case, I created a "buttomPressed*" and "awlays set it to buttomPressed", and my target event condition- which is what I'm asking in this post- is "buttomPressed=1" AND "buttonPressed*=0". (Note: It's better to set "bP>bP*" but you get the idea.)
So this would only occur for a frame, because later in the same frame "always set buttomPressed* to buttomPressed" would be triggered and they would both be 1.
And since that is a way we can get the value from last frame, with "value - value*" I can finally get the acceleration with the speed value.
It's kind of stupid that I have to set a new value everytime I want to have the variation in a value, but right now I just fell so great that I don't have to learn GMS. Yet.