Multiplication node using only pin A

Hi there. Im posting here because I feel its a very basic problem and im not seeing it. So I have my player that has a modifier function that spits out a float var. It spawns a projectile and then sets a variable(playermods) within the projectile. My problem is that when I multiply anything with this (i.e. my DMG type function in the pic), my ‘playermods’ is calculated as though it was set to 1 which is its default.

In the Editor, I used printString to find that the ‘playermods’ var. is going into the multiply node with the value I want it as but the multiply node spits out only whatever I pin to A.

I have tried truncating the long decimals with strings and appending, set all variables involved to public, used custom events and using CastTo instead of using variables. Any help will be appreciated. Thanks!

Player BP:

Projectile BP:

286246-capture.png

Edit: Here a more full shot of my BPs.

BP of the DMGType Check

It’s pretty hard to tell without much of the BP. I’d love to see a print just before the SET in the 2nd image ( all 3 vars ).

I set a print before the set and it returned 82.5 as well…

Hi - I notice that DMG type check modifies PlayerMods. I also notice the DMG uses a sequence node.

I haven’t looked too closely yet, but are you aware that you need to read a sequence node as if the pins are run in random order? ( excuse me if you already know about this ).

Pin 3 can finish running before pin1 has completed. All the sequence node does is start running those pins in that order, but there’s no check that pin1 has completed before pin2 starts, etc.

Edit: Yup, sorry the piccy’s too fuzzy to read properly, but I’d lay money on the Seq node :slight_smile:

Actually for the Sequence node, smaller numbers are guaranteed to run before the larger ones (so 0 always runs and finishes before 1), EXCEPT any latent action - so a Delay in Sequence 0 will surely run after all the sequence pins have been evaluated, but the sequence of non-latent actions is fixed, not random.

Anyways, the multiplication node surely works, can you Print ALL DMGTypeCheck, Playermode and the result of the multiplication BEFORE setting TotalDMGReceived? The ProjectileBP calculation you attached is surely impossible if DMGTypeCheck is constant (it’s constant. right?).

I’m pretty sure the sequence node does call them in order, but no pin is waiting for the previous pin to complete before running…

It does not “wait” for it. It’s just done on a single thread, so just like in other parts of BP, whatever is called first, executes first. If a latent action is present, then it’s registered to be called later, and the next pin is called. Feel free to try it out. Without latent actions (like delays or waiting for dispatchers) the lower pins are always executed and done before the next one even starts.

thanks for the awesome responses. I slapped a print on all of those you mentioned. The prints in the DMGcheck came out as I wanted them too with ‘pierce’ giving 62.5 in pin1 in the sequence and ‘ice’ giving 20.0 in pin2 thus adding to the 82.5, so no problem there. The print for the ‘playermod’ before multiplication is however set to 1.

Edit: So im zeroing in the problem. I put a Print after the Modifiers function in the PlayerBP and another print after Playermods in the ProjectileBP. They should be equal to each other but Player mods is using 1 which is its default value. I’m messing around with the ordering of some nodes.