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"

Something like a struct but with more control?

So last night I was working on an inventory system, and made a struct to create a slot variable. I had the thought to add a Boolean that would return weather or not the slot was empty, based on if an object was set. <- Really that's my question. Aside from constantly running a check inside of a bp class, is there anything that would kind of let me do this? Basically like a struct with "rules" where certain values rely on other values in the struct. Probably not, probably a completely noobish question, but I figured I'd ask.

Product Version: UE 4.19
Tags:
more ▼

asked Apr 27 '18 at 01:28 PM in Blueprint Scripting

avatar image

Tyguy717
6 1 4

avatar image goncasmage Apr 27 '18 at 01:31 PM

Assuming you had an array of these structs to represent your inventory, i think it would be enough to simply add a slot whenever an item is added, for instance, and so every slot in the array is a valid item.

avatar image Tyguy717 Apr 27 '18 at 01:33 PM

Yea, when it comes to the inventory system I know there are plenty of work arounds that don't involve doing what I asked in the question, I'm just wondering if anything of that sort exists. I feel as though it would be useful. Thanks for the quick response

avatar image goncasmage Apr 27 '18 at 01:37 PM

Well in your specific case of returning whether a slot was empty, you could make a function called IsEmpty, that would do those necessary calculations and return whether the slot ia empty, if that's what you're looking for ;)

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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