Let’s say i have a music, and i want to create an object when the offset of the music reach to a group of specific time
example:
I have numbers 2,6,11,16,28,34
i want to create an object when the offset of the music is equal or greater than 2 and create another object when the offset of the music is equal or greater than 6 and then another at 11 and so on.
Is there a way to do that in one event using some sort of array of variables or something like that and not making separate events for each number?
something like storing all the numbers in one group of variable and make one event that do:
trigger once
when the offset of the music is equal or greater than [list of variables] > create an object
Well for me the main reason I don’t use Arrays is because sometimes I need to define the pair KEY/VALUE and the arrays only accepts numbers as key and always start from 0. but usually I sue this for Player data like
Key->Hp — Value->100 so later is easy to find instead of array that would be like KEY->0 VALUE->100 so if I forget that the key 0 of the array is the hp of the player I’m f**cked
ok thank you for explanation
And how do I set all added values to numbers?
cause from what I understand structures are string values.
And for the offset I need number values
Add an structure variable then add some keys that you easily can remember in this case the keys and the values are the same but only are going to use the values
If you want to get this more clear do like this:
Hi,
I’ve tried your solution, it kinda works and kinda don’t. It only creates object at the first variable in this case the variable with value 2. Once it creates one object at the first variable then it won’t trigger at those next variables (6,11,16,28,34).
Is there a way to fix this?
I know it’s a little bit confusing, basically what I’m trying to do is when the offset of the music is equal or bigger than the variable it creates an object at a random position. I’m trying to make something like the game “OSU” where you have to click on notes base on the beat. I actually have a list where i have the timestamps of every beat in the one music I’m using in this game and I’m trying to manually type in the timestamps into the variables to let the system know when to create a note or beat to let player click.
Hope i explained clearly this time
this is my variable (timestamps when to create beat)
I’m guessing here but I think you need a parent Foreach NewObject so the next event were for every child can identify wich NewObject need to use
Like
Main event
For each NewObject
Subevent
For every child…
The playing… → Create NewObject2 at NewObject.X(),NewObject.Y()
So this way every NewObject get at least one pass thru the foreach
Tip: Please try to name properly your objects so it’s easy for you to identify what is each object.