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
for instance :
first frame
condition : end of frame
=> set global value A to player X pos
=> set global value B to player Y pos
second frame
condition : start of frame
=> set player X pos to global value A
=> set player Y pos to global value B (you can rename them)
no, I don't need to keep the same position in frame 2 as frame 1 when it ended. Here's what i need to do: when player collided with active, jump to frame 2. In frame 2 when player collided with active jump to frame 1 and change position of player in frame 1... But still thanks for your help. :)
How did you do it?
Global Value A and B should have the X and Y positions of the player for frame 1. Global Value C and D should have the X and Y positions of the player for frame 2, etc.
But while this works, it's not efficient as you need two values per frame, and you'll quickly run out of values if you have a lot of frames in your game.
Take the same concept though and apply it to INIs. Using the INI object, you can create groups of coordinates for each frame position just to use like global memory, or even save them to the drive for later.
Alternative to INIs, you can also use an array object to do the same thing.
What ever method you use, the idea is still the same: Save the coordinates for the player for each frame somewhere at the end of the frame, and then re use those saved coordinates when they return to that frame.
There are a LOT of tutorials on youtube and other such places covering how objects like INI and array work if you want to go those routes.
Since we have limited amount of global values.
Easy example:
Create active object, name it player.
Add String Tokenizer to the scene.
Add 2 Edit Objects to the scene. (Edit X & Edit Y)
Always > Set Player X position to XMouse > Set Player Y position to YMouse.
Upon pressing "Space bar" > Set Global String A to Str$(X( "Player" )) + "." + Str$(Y( "Player" )) > Split String Global String A with delimiters "." (1D) > Edit X Set text Element$("String tokenizer", 0) > Edit Y Set text Element$("String tokenizer", 1)
0 is the first value in the string and 1 is the second value in the string, a third value would be 2 and so on.
End result:
https://i.imgur.com/R0YtncT.gif