x

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"

Change boolean multiplayer

Hey guys, so im trying to change a boolean value from either of the players. One player is hosting the game and one joins. This boolean is supposed to check between 3 animations which one to play off from. Booleans are replicated. It does not trigger the event, i have tried many different ways. i will send the latest method, maybe it will give a more insight. alt text alt text alt text

alt text

Product Version: UE 4.13
Tags:
more ▼

asked Oct 28 '16 at 07:59 PM in Blueprint Scripting

avatar image

oppne
80 6 14 26

avatar image oppne Oct 28 '16 at 08:00 PM

Apparently something wrong with the image uploading here, but heres the last link to the last picture https://answers.unrealengine.com/storage/temp/112873-jobbkortcard2_animation_issues.png

avatar image oppne Oct 29 '16 at 08:50 AM

I tried on repnotify, and in the function i called a set. But that makes the button unclickable and nothing happends.. What the hell.

avatar image Holybreath Oct 29 '16 at 09:13 AM

Is BossCard2Choosen boolean Boss card true pin, not connected to Sets Boss Animation 2 on purpose?

avatar image oppne Oct 29 '16 at 11:42 AM

Yes, because apparently it doesn't work to send a custom event from the server to all clients to an custom event inside an umg?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The way replication works is:

  • Player calls a server function.

  • Server changes the replicated variable.

Variable value is replicated to all clients.

So you must change the value of bool in your BossCard2Choosen function

Below is an example of How to replicate variables. (Do this in PlayerController) alt text

more ▼

answered Oct 29 '16 at 09:17 AM

avatar image

Holybreath
383 10 7 19

avatar image oppne Oct 29 '16 at 09:33 AM

alt text

alt text

alt text

So i did this, but you see, the boolean comes as true at all stanges, until the event construct is triggered and the print string shows it as false at joined client, even tough its replicated.

avatar image oppne Oct 29 '16 at 09:55 AM

I tried the thing you said holy breath, didint work! :/ I thought I understood replicated and how to use the server to send information, apparently not lol, so it still goes to false right after event construct, but it stays true before that I seen it in print strings. This is so confusing

avatar image Holybreath Oct 29 '16 at 03:26 PM

don't use rep notify for this. Rep notify is useful when you need something to happen once the value is replicated.

avatar image Holybreath Oct 29 '16 at 03:27 PM

plus the server doesn't call rep notify function.

avatar image oppne Oct 29 '16 at 04:11 PM

I didint use repnotify, but I just tried to change the value after replicated didint work!

avatar image Holybreath Oct 29 '16 at 08:44 PM

check my updated answer.

avatar image Holybreath Oct 29 '16 at 07:08 PM

may be its because you check in event construct, but the widget was already created.

avatar image oppne Jan 12 '17 at 09:52 PM

Thanks btw, this worked!

(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