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 can I add multiple hitboxes with the same name?

See preview: i have created a function called: InventorySpaces. This will be drawn on a predetermined location which will create my inventory. Now i use integers to spawn items. e.g. if the int is 1 it will spawn texture 1 with hitbox 1. But here comes the problem. When i use the mouse over hitbox event it works fine with the first hitbox e.g. hitbox 1 (1) but when it draws a second hitbox with the same name hitbox 1 (2) it doesnt respond to the mouse hover over.

How can i add multiple hitboxes with the same name?

alt text

Product Version: Not Selected
Tags:
capture.png (163.7 kB)
more ▼

asked May 16 '14 at 01:22 PM in Blueprint Scripting

avatar image

Emptyless
0 3 4 5

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

1 answer: sort voted first

Hey Emptyless,

Hitboxes will need to have a unique name in order for them to respond to their own Events like Cursor Over. If you are using something like a ForEachLoop to generate inventory boxes/icons in your HUD, you can generate unique HitBox names every time for each item you need to draw by using a setup like this:

HitBoxes

Since the Array Index will increment for each item, each HitBox will be named uniquely. If you need different functionality for each HitBox (or if you want to do some debugging with each one), you can plug in a Switch to your Event Receive Hit Box Begin Cursor Over:

Boxes2

Hope this helps! If this solution doesn't fit what you need, reply back with more specific information about what you want to do and we'll provide further guidance.

Cheers,

-Steve

hitboxes.png (104.6 kB)
hitboxes2.png (32.5 kB)
more ▼

answered May 17 '14 at 04:14 PM

avatar image

Steve Allison STAFF
4.3k 123 58 209

avatar image Emptyless May 19 '14 at 07:27 PM

Im sorry i wasnt able to reply sooner but thanks very much for this answer!

Though i stumble upon a problem when using the switch on Name. When i have for example 22 logs in my inventory i need to create 22 hitbox names in the switch on name. I would think that it should be easier to add interaction with just the one item i created.

What i want to create is an inventory that i can interact with. Like the old runescape inventory for example. I can right click to see my interactions with an answer.

I have 3 images describing the current situation. I use a tree and when i chop it down it spawn an event. this event triggers an "item number" eg 1 and this goes in my item function. This function checks for the next available slot and depending on the number of this item it spawns a texture. now what i want is to interact with these textures and have the same interaction for each texture clicked. So if i click my willow log in my second inventory space to act the same as my willow log in my 9th inventory space. So if i decide to burn the 9th that one dissapears and i can do the same with the 2nd.

But for weapons for example i want to be able to wear them and not show the burn option. This is for all gear etc. If i have to create a switch on name like described i could be busy for like a year to write 28 name switches per item for an inventory with 28 items

hope this helps but already thanks very much for help

alt text

alt text

alt text

avatar image Steve Allison STAFF May 20 '14 at 10:33 PM

Hey Emptyless,

It sounds like if you have that many items you need to check against, you might want to store all of the HitBox Names you create in an array and when you trigger the Event Receive Hit Box Begin Cursor Over or any other Event for your inventory, have that run through a ForEachLoop on that HitBox namearray and compare the Box Name to each entry, then execute the rest of your code. Depending on what you need it to do, this would potentially make your inventory list more customizable in size and the code burden would be much less (not having to create multiple Switch On nodes with lots of possible entries).

-Steve

(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