Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Driven crazy by simple int check


this one is hard to describe and probably hard to believe but I have now for 5 hours tried to work out what is happening without success, so I thought it must be a bug and maybe someone else knows about it.

Sorry I can't show exactly what is happening because I have some very project specific functions. That doesn't matter though because if I am correct then this is super strange whatever I do down stream.

I have this variable called 'HitLevel' that I calculate on component hit based off velocity vectors.

I Print this value just before comparing with it and it prints as 1. (it really does)

Then I do this comparison, alt text

Later downstream I print some more text to verify that I get that far.

I then try to trigger a montage animation. But when I have that check in the picture in there, it just won't play. It does print the debug text I just mentioned immediately preceeding the montage setoff.

Super strangely if I don't have the check with 'HitLevel', if I dis-connect that variable and just type in '1', as in 1>0, it then plays the animation. (and prints the message of course)

Two things are very strange. Why does it not play the animation even if it gets through the variable check, proved by my printing the second message? And why would it be doing two different things when I just do a check with a variable. (it shouldn't as I test before with the print). I don't use that variable in the animation functions, but also I don't change the variable.

This is driving me crazy! Please say that you have an idea what's happening?

Cheers Fredrik

Product Version: UE 4.14
madness1.png (80.4 kB)
more ▼

asked Feb 16 '17 at 10:47 PM in Bug Reports

avatar image

76 3 6 7

avatar image Rudy Q ♦♦ STAFF Feb 17 '17 at 03:56 PM

Hello Fredrum,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?

  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?

  3. Could you provide screen shots of any blueprints/settings that may be involved with this issue?

  4. Could you try placing a break point on the node that you think is giving you an issue and right click watch value to make sure that you are getting the correct results?

avatar image Fredrum Feb 17 '17 at 04:38 PM

Hi and thanks for answering.

(1). I'll try later but my main issue is to get a solution or workaround for my own project.

(3). If all else fails I will. There's a lot and it doesn't look pretty.

(4). Break point is that called 'Watch this Value' in Blueprints? To test this I need to build and run over two LAN connected computers. Can I read the breakpoint off a built/cooked game? EDIT: I'm reading about adding breakpoints. But it seems to say I can only use these with the editor? That wouldn't work for me as I need to test this over LAN. It is a 2 player game for VR.

avatar image Fredrum Feb 17 '17 at 05:00 PM

I just discovered that the problem only ocurs on the Client machine (im using listen server - client). Not sure why I didn't think to try this before.

It is still the same perplexing problem, why is is failing just because I do a (successful) check of that int variable?

Here's an image showing how I print out the var on just the client and just for that Pawn that is meant to get the animation triggered on it. (works on Server). So it still prints as '1' and DOES get past the check but anim does not get triggered. (it does without the var check)

alt text

EDIT: Downstream: alt text

client_err.png (191.0 kB)
client_err2.png (353.3 kB)
avatar image Fredrum Feb 17 '17 at 06:11 PM

So here are two more pictures I am not sure how I can show you more clearly than this! Note that when running the game like in the picture here that doesn't work it still prints out the "SHOULD TRIGGER STAGGER" message from above previous picture client_err2.png

alt text

alt text

client_trig.png (271.5 kB)
client_notrig.png (316.2 kB)
avatar image Fredrum Feb 17 '17 at 06:22 PM

One more that doesn't work but has the print after the check. (Also prints the other messages further downstream)

alt text

client_notrig2.png (266.0 kB)
avatar image Rudy Q ♦♦ STAFF Feb 17 '17 at 06:30 PM

After taking a quick look at the information provided I have a couple more questions:

Additional questions:

  1. Is the variable replicated?

  2. If you set the variable Hit Level to 1 by default does this change the behavior?

avatar image Fredrum Feb 17 '17 at 06:50 PM
  • No the variable is not replicated and calculated on each Pawn on all clients (server or not).

  • I tried changing the variables Default value from -1 to 1. No difference.

  • When I force the variable to 1 just before the check, it works. (it should be 1 already though as all prints claim it's 1)

alt text

client_trig2.png (157.1 kB)
avatar image Fredrum Feb 17 '17 at 07:03 PM

Another example of printing the variable and it should be already good. alt text

client_trig3.png (167.7 kB)
avatar image Fredrum Feb 17 '17 at 09:16 PM

Hmm...getting a bit closer. This one does not make it work. Would you be able to derive an explanation for a situation that would result in these combined behaviours?

I have a probably somewhat un-orthodox hit mechanism going upstream. Maybe it has to do with that although I can't see how that would explain the behaviour in previous image 'client_trig3.png'?

alt text

client_notrig3.png (201.7 kB)
avatar image Fredrum Feb 17 '17 at 09:28 PM

And this works, (of course the LocallyControlled things can be ignored here). So I have to now figure out what this means...

alt text

client_trig4.png (184.8 kB)
avatar image Fredrum Feb 17 '17 at 10:41 PM

Hi Rudy,

if I wrote my own c++ BP node that I inserted, would I be able to create a breakpoint like that and check it in VS?

For a cooked/built game run?

avatar image Rudy Q ♦♦ STAFF Feb 20 '17 at 02:53 PM

Would it be possible for you to provide a zipped down copy of your project so that I could take a closer look? If you would like to provide it privately, you could do so by sending it to me in a private message on the forums via a google drive or drop box link.

avatar image Fredrum Feb 20 '17 at 04:34 PM

Great I will try to reduce the size to fit in my dropbox. It is very large at the moment. I'll send you a PM when I have that uploaded!

avatar image Fredrum Feb 20 '17 at 05:52 PM

Hi Rudy, I am trying to find your Forum username to be able to send you pm over the forum. I can't see anything resembling 'triplett'...?

avatar image Rudy Q ♦♦ STAFF Feb 20 '17 at 08:27 PM

You will need to ensure that you use capital letters for the R and the T. I hope that this helps.

Example: (Rudy Triplett)

avatar image Rudy Q ♦♦ STAFF Feb 20 '17 at 09:44 PM

I tested the project, while playing in Editor. It appears to be working correctly. Does this issue only occur when using two different machines?

avatar image Fredrum Feb 20 '17 at 09:52 PM

Yes it works when playing 2 player PIE and it works over LAN on the listen server machine. It does not work playing over LAN and as Client.

avatar image Fredrum Feb 20 '17 at 11:22 PM

I am just trying running the cooked game on my 2nd machine and playing as client in editor on my dev machine and so hoping that the debug tools could work that way.

It prints watched values but not making me any wiser. Either it prints 1 and True, which is not the effect I am getting. Or when I am using the dropdown menu to switch to the other character it prints -1 and True. Does it not update properly by just switching in the dropdown?

(of course the effect I am getting is of a False but none of them say False)

alt text

debug.png (95.1 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Aha I'm pretty sure I have found my problem! Though I haven't got the fix yet I'm super happy to at least have identified the issue. When I force the last bit, the one we have been looking at, to only execute only on the client it just doesn't play at all. It's something to do with it not being the owner of the client and attempting to do a RPC I reckon. When it was working in the example above when setting the var directly it was actually playing and replicating the animation off the server. When I thought I made it work I actually didn't and it kept me thinking in the wrong way. I'll change how I do this tomorrow but I'm pretty sure there won't be any trouble.

more ▼

answered Feb 21 '17 at 04:20 AM

avatar image

76 3 6 7

avatar image Rudy Q ♦♦ STAFF Mar 14 '17 at 07:56 PM

It sounds like you were able to find a solution. I am happy to hear that you were able to narrow down your issue. I will be converting you last comment to an answer. If the issue returns or you need further assistance, please feel free to reopen this thread with any additional information you may have.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question