Help me check this logic please


This is MyGameMode blueprint, i get reference of Datacenter actor, then i get one variable of it’s Last Level.
I put this value into Get Number Vectors node ( this node increment simple ).
Then out of Get Number Vectors node, i get reference of Datacenter actor and i Set new value for Last Level variable of Datacenter.
Have other actor i’m using as trigger for jumpping to next level name’s Gate.
I want everytime player touch to Gate, gameplay going up next level by Open Level (by Name) and it’ll open my level.
But difference with what i think ( new level open with new value of Last Level variable saved before ) new level open with default value is 1.
What did i wrong in this logic ?
Somebody help me please.

hi @Tamquocchi2021

Im sorry im having a little problem understanding your english so if you can help me out a little.

Am i right, you want to open a new level using a level number? (newcurrentlevel)
by incrementing the lastlevelnumber by 1?

If im right the logic is this:

  1. currentlevel number is stored
  2. on activating the level change the lastlevelnumber is set to the stored currentlevel
  3. change levels and set the new current level number to lastlevelnumber + 1 ( or whatever value you need to use)
1 Like

Yah, it seem’s right with what i’m thinking
Simple,

Gameplay start

i get Last Level from “Get Actor of Class” node
Put it in “Get NumVector”
take new value from “GetNumVector” then
save it into "Get Actor of Class " (by Set node - new Last Level value)


After this logic have one trigger (Open Level by Name) open this level again with new Last Level value.
This’s all what i’m thinking in my logic blueprint.

But my problem here is new level open always open default ( lvl 1 )
Even i checked output of Set Last Level always increment as i want
But it seem’s not save that value into Datacenter by Set node ?

it might be because you are setting the lastlevel node with the output of the “newcurrentlevel” from your get num vectors. Surely this should be lastlevel?

i might have misinterpreted what you are doing there.

maybe have a new output pin on getnum vectors with the lastlevel (which im guessing comes from the current level?) set that BEFORE you set the new current level

1 Like


This’s way of current level moving in Get NumVector.
i don’t get what you mean " new output pin on getnum vectors with the “Set Last Level” (?) before set new current level ?


And yah, this’s details of Current Level variable, it have default = 1
idk if that’s main problem here ? i made it before so i’m wondering should i remove this variable ? Or how can i fixing without removing it ?

you are setting the NEW current level to “last Level” (see red underline)

surely you should be setting one of the 2 variables circled in yellow to the last level?

1 Like

well, i don’t get what you mean.
As in screenshot i posted before, you can call Current Level is X and New Current Level is X+1
Get Last Level > connect to > X
X+1 > connect to > Set Last Level


Incase you don’t get what’s my problem here, i wanna save new value for Last Level in Datacenter actor. But i don’t known this’s right or wrong because when my gameplay going up to next level ( as first screenshot ) i get Last Level from “Get Actor of Class” (Datacenter) but this value always is default, it’s not last value saved in Last Level.
This’s looking like a loop until player die.

ok so the fix is to SET the last level inside the datacenter actor to the current level right before you change levels

OR

SET the last level inside the datacenter actor after changing levels using current level -1

or do it on the fly just using a basic math currentlevel -1 everytime you need last level

1 Like

Thanks bro, i’ll try it.