So it’s
Ftransform Location;
as var declaration, then that is what you have to convert , or better put the content of Location to an int.
So you just add the vector like here but with the name changed.
Here it shows you the indices representing int indexes made from vectors.
I don’t know if this method works out of unreal components, then you are going to have to use capture.
Anyway you just need to put the int index that you are trying to create out of your float points.
int yourintindex = Location.Add(xyz);
This works as long as you have an x,y,z float variables declared and used inside the array, maybe they are called something else so check that what ever they are named.
then do what ever with int yourindex to “==” with it.
Once you do that you are going to get the index out of your float and use that to compare. But I do not know if it works out of unreal components. If not you may want to add or convert in another form with capture or another form.
There are simple forms to convert.
Like:
But it may be unfrendly to unreal because unreal uses Fvector and especially Ftrasnform so you may not use raw C++ with these, so you have to use C++ like unreal likes with index points out of floats and captures. for the Fv or Ftr…
the == checks if it’s identical.
So this is what you are trying to do ?
if (UsedLocations.Find(Your_int_index_variable) == -1)
{
//Some code
}
But What is used locations, another Ftransform as I see. You have to convert also Ftransform UsedLocations to int indexes.
So …
if (Int array data that you converted.Find(Your_int_index_variable) == -1)
You may want to get indexes then store them to int type of array and then compare not with int variable but with the int array that you stored the indexes into.
Get indexes out of your Ftransforms both of them
Crete int arrays and store the indexes inside of them that you got from vectors
Use the arrays to compare with ==
As I see you are using the arrays to compare them not some simple index variable that contains one value maybe, so the array has the whole list.
if (Your_int_array with the values you had from check values.Find(Your_array with _index_variables from locations) == -1)
{
//Some code
}
Compare one array against the other but Int arrays not floats.
So if it works for you please let me know, I’ll use this too when I use relative possitions to check if the possitions have diffrrences after I switch from relative to world back.
Sweet but I don’t need noble premium hahaha, just a solution to check possitions, I was interestid in this also, why I replied because I’m going to use transforms to transform landscapes that I have.
Dont know what you want to achieve, but never use == for comparing float/double variables.
If you want compare FTransform then use FTransform::Equals function.
You should have two int32 arrays.
TArray NameUsedLocations2{};
TArray Locations2{};
Then…
int first = Locations.Add Locations.Add (Fvector(Locations3));
int second = UsedLocations.Add (Fvector(YourUsedLocations3));
To create an index you have to create another Fvector array I think also for each because when you dump the data in it, it’s when you create an index.
So you may want to use 4 arrays Fvector or in your case Ftransform and 2 int arrays. You have dump data from fvector or in your case ftransform to other two who have the same type otherwise it’s going to give conversion errors.
So when you get the data in the arrays is when you create an index, but you already have an array with data, so you have to dump it in to an identical type and then when you dump it you get index. And with the index you store it into the other two arrays that are int.
4 arrays Locations, UsedLocations, Locations2 , UsedLocations2, then the other two that are int UsedLocations3 and Locations3.
To get the data as index you have to use float x,y,z. But since you alrady have the floats into the arrays you have to dump them in other arrays that are identical as type to get index on them, it’s when you dump data inside the array that you make an int index out of them. Then use the int variables to store to int arrays.
it is in compilation progress, my incredibuild has expired and the project is large, it will take some time to compile , I will share the result in any case
So you need to have these as first step I think.
After that you need to dump one into another with the int that stores a value.
So use the first array to insert to a second array and when you do you make an index:
int a1 = Locations.2.Add(Location);
int a2 = UsedLocations2.Add(UsedLocations);
Corrected some code.
Now you have some int indexes.
Try placing the int array instead of a local variable a1 for example
instead of int a1 to capture it directly inside the array maybe.
For Example
Locations3 = Locations.2.Add(Location));
There is no reason to give conversion error if you do this properly with integer values.
Also if you add individual variables that are int if it does not work directly with the int array to store directly into array rather than storing it first inside an int variable, it’s the same.
Location3.Add…name of the int variable
UsedLocation3.Add…name of the int variable
and now they are inside the int array and ready to ======. what ever you are trying to compare.
So you just do this.
int your_variable = Location2.Add(Location);
And when you dump one fvector array into another fvector you create an index int.
Or maybe like this
Your_location_int_array = Location2.Add(Location);