Clickteam Fusion 2.5

Clickteam Fusion 2.5

noass Jan 13, 2019 @ 6:44am
How to save player's position on the last frame???
When I go and jump to a different frame for example frame 2 and I start at frame 1, it just moves the player's position at where it started at. How do i change to a different position then where the player started?

I'm using 8 directions movement.
< >
Showing 1-6 of 6 comments
Xsoul Jan 13, 2019 @ 7:11am 
you need to store player values in variables
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)
noass Jan 13, 2019 @ 7:34am 
Originally posted by Xsoul:
you need to store player values in variables
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. :)
noass Jan 13, 2019 @ 8:23am 
It's all fine I did it.
HeatherBlade Sep 4, 2024 @ 9:05am 
Originally posted by noass:
It's all fine I did it.

How did you do it?
SpellSword0 Sep 4, 2024 @ 1:29pm 
Originally posted by HeatherBlade:
Originally posted by noass:
It's all fine I did it.

How did you do it?
Using global values like Xsoul said five years ago, but to be more specific about 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.
Zethell Sep 5, 2024 @ 3:14pm 
Highly recommend using a String Parser so you can store both X and Y in the same value (although in this case a global string) and still grab each value separated from each other with a token like "," or "." for example.
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
Last edited by Zethell; Sep 5, 2024 @ 3:37pm
< >
Showing 1-6 of 6 comments
Per page: 1530 50