I was wondering if i could pick your brains a tad to see where I’ve gone wrong with my initial version in the hope of understanding the best way to develop BP’s for the future.
I know your highly professional looking, elegantly coded and efficient BP that most importantly worked every time was a massive improvement over the way I very amateurishly and manually coded mine.
However, could I ask as I need to also develop a version that works using a single target location or trigger box in one room that needs to be found 4 times, then again the player has to find a different target 4 times in a second room.
Before finally going back to the first room to find the first target once then the second target in the second room once.
Would the amateur hour BP I originally developed be able to do this correctly, as I don’t want to mess with yours and am hoping it’ll save us both some time.
I’d really appreciate your help and am very eager to learn where I’ve gone wrong and how to sort of optimise stuff correctly.
I apologise for being a real pain and genuinely really appreciate all your very kind help.
This the code I’m using to set the trigger location within a variable, I do this after moving the first trigger in to place, I’m not sure if this would be better set from the outset of play using OnBeginPlay, as it doesn’t change until the player moves into the second room where it’s updated to the location of the second trigger.
I have to use multiple triggers that are separately moved into location so they don’t all fire off when the player reaches the target location.
I then ultimately use this code to calculate horizontal distance to trigger (just thought it’d be more accurate and logical to discount vertical path, not sure if this is correct):
It’s only me, unfortunately with yet another question, although hopefully a quick one:
From this position in the thick red outlined trigger box, the distance to the thinner outlined trigger box in front, I’m getting a reading of 180.55, each trigger box is 100 x 100 does this sound correct?
Seems like its a lot more than it should be?
XYZ co ords are;
First trigger (thick outline): -115, 67, 115
Second Trigger (thin outline): -115, 247, 55
I’d really appreciate your help as it seems to be the last hurdle.
I’m still having a strange problem with this unsure what it is?
The actual distance from a 40uu cubed trigger (based at -120, -90, 90 to the target trigger box a 100uu cubed trigger box based at -115, 247, 55) is 340 uu.
Having manually positioned the player in the trigger I get the following readings using my BP:
Round 1) 300
Round 2) 314
Round 3) 288
Round 4) 297
Round 5) 171
The first 4 are acceptable given it’d be difficult to position the player in the exact same spot every time but the last is not, it’s way off.
Moreover my BP, although very amateurishly designed uses repetitive chain of cascading triggers, it’s only repeated 4 times, so why does it result in 5 tries?
I’ve attached the BP in separate bits in the hope that it’s understandable, but it’s honestly driving me up the wall as to why the last distance reading is wrong?
What am i doing wrong, please help Clockwork mate!
Overall BP, bit big and a little difficult to understand but just to give you an idea:
You’ve managed to produce ‘procedural’ code, even though the engine is trying to guide you into an ‘object orientated’ path. You see that repeating pattern in the picture of your code?
That’s the cue to put it in one object, with four different parameters. This is the danger of using the level blueprint.
It’s totally un-debuggable by anyone other than the author I’m afraid.
The only thing I can do is get you to give me a short précis of the current game goal ( no extensions added later ) and I can write you something again, but that’s about all I’m afraid.
Hi CO,
The game has two rooms, the player has to find a trigger 4 times from different locations in the first room before moving to the second room where they need to find another trigger again 4 times.
Finally they go back to the first room to again find that first trigger then they are moved to the second room to find where that trigger was to complete the game.
if they can’t find the trigger I’d like them to press a key from their current position (where they think the trigger is) which outputs to screen the distance between where they are and where the trigger actually is.
Actually, maybe it will be more helpful if I fix your code. All you have to do is, in the blueprint, select all ( CTRL-A, CTRL-C ) and paste it into a notepad file. The upload that as attachment here.