Ok, so drag off the variable and type ‘make array’, then drag off from that and choose ‘promote to variable’
that works
Getting there yet?
Yeah I think so, sorry for the hassle man but please bear with me as I’m sure to fall over somewhere and I’m conscious of the draw on your time which I apologise for.
Similarly I really appreciate your help!
No worries, we’ll get you fixed there…
In the function how did you get function “distance (vector)” I can’t seem to find it, also the large get array?
Lastly (at this point I’m pretty sure you hate me and I honestly apologise) which triggers array feeds into this large “get” array?
You’re running quite an old engine there, maybe you don’t have ‘distance’, I think you can just subtract one vector from the other:
Large get array, what’s that? ( can you do a pic of my pic? )
There is only one array of triggers. We change what’s in that array on each game round.
Just pull from the triggers array and type get ( you’ll see get( a copy ) )
It won’t connect from the “large get” to “get actor location” function, it also seems to have automatically added a “make array” function between the trigger array and the “large get” mine looks like this?
Here’s the pic
Notice I have an int coming in, you have a bool.
Notice the triggers variable has the array icon on it. Somehow you made a variable which is not an array, that’s why the system turned into one for you.
Also notice the vector length node near the exit ( sorry - edit - it needs to be the ‘vector length’ node in your case ). The function returns a float.
It seems your main problem at the moment, is getting the array of trigger boxes right. If you look back over this convo, maybe you can sort it.
I’ll come back and see if we can’t sort it out tomorrow…
I really appreciate your help man!
I think you’re right, How did you select your trigger array?
I’m going to interject with a note for someone else that ends up on here via Google.
This works accurately for short, linear distances.
If you are trying to calculate a distance between 2 cities or locations further than 50km apart on a tiled map you would probably need to solve the distance using a spherical approximation formula (great circle distance).
The further the 2 places to measure, the bigger the error of that measure between the 2 formulas.
Say you measure London to Manchester using the distance node on a flattened map. you probably get something in excess of the real distance by a lot (20k+)
This is usually due to using maps which aren’t actually spherical within unreal. (Ue4, every flat earther’s dream.)
That’s all.
Here’s a link to the formula to use for distance when calculating real world location.
Reminder it’s still an approximation. So if you are trying re-create the world in a 1:1 scale, well, good luck is all I can say.
we’re not looking for real world distance, and it may be an idea to have a separate post for this?
Delta - are you around?
Will be in an hour, got the kids to look after!
For the trigger array variable can you please let me know which options you selected from the menu as you’re definitely right, this seems to be what’s clearly wrong
I was thinking about hooking up on Discord. Drop me a line when you’re about…
Hi I’m on now, don’t think I’ve got discord.
I’m REALLY SORRY for the draw on your time.
I think the problem lies with the type of array I’ve used for the triggers:
Is this right from the level BP, my blueprint menu on the left, click add new >> variable >> variable >> but from the details panel on the left which “variable type” do I use I’ve used Structure >> “Array of Actor” as it was the only one that seemed right?
I think this is where I’ve messed up and the problem is.
Well, the offer’s open - we could do skype also etc.
In the meantime, the type of the array should be ‘trigger box’
This is why we spent all that time working backwards from the variable to the array, to get the right type.
I’m assuming that what you have in the level is trigger boxes, they look like this:
just found my discord pwd, very new to this tbh, I don’t have a mic, but sure I really appreciate the offer, lets talk on there if easier
yes they look exactly like that just regular triggers, but there’s no trigger box array option for variables