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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to separate strings and compare them

Hello,

I am trying to input an Arduino serial data, which is a string that returns either "x number" or "y number", the number is a number between -500 and 500. What I'm trying to do here is to tell the blueprint to aknowledge if it has to move forward/backward or sideways depending of what letter it receives, x sideways, y forward/backwards. I am kinda new to Blueprints and I tried looking over the web for some answers and I found some useful but I'm still stuck.

What I'm trying to say is that I need to separate the y from the number and then make it compare only the letter to know what coordinates it has to move.

Here's a screenshot of what I have at the moment:

alt text

Thanks in advance for checking this

Product Version: UE older version
Tags:
captura.png (179.8 kB)
more ▼

asked Mar 23 '17 at 12:25 PM in Blueprint Scripting

avatar image

Pyromann
1 1

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

1 answer: sort voted first

There is a "Split" node that you can use. You can specifiy the character that it should split at, so if you know there is a space between x/y and the value, you can simply split at that space.

You should also be able to simply cast the string to a float, and the engine should be able to translate the value correctly, as long as it has a standard format

more ▼

answered Mar 26 '17 at 12:57 PM

avatar image

pulp_user
1.2k 46 29 59

(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