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"

Urgent***Simple Scoring system for FPS

Hey guys i've tried several different ways to go about creating a very simplistic scoring system for my game but I have been unable to get anything to work. I have followed several tutorials but each time they are slightly different than what I have or need so I have been unable to get it to work.

The game is a little stupid but its for a class and my group members came up with the idea so bare with me lol.

The FPS is supposed to shoot a booty and in this case I have named the booty Targetbooty and it is a actor blueprint. Everytime the FPS shoots the booty he should be able to get 1 point which will display on his hub. I have created the hub and tried to link it to the booty but each time the bullet goes right through the target. I think it has something to do with the "Cast to FirstPersonCharacter is not compatible with Self Reference error that I keep getting when I try to plug into the target of Totalbootys

alt text

Here are pictures of my other blueprints and how I have them set up.

alt text

My character^^

alt text

My score hub^^

This is urgent only because this is a graded project and it is due in 72 hours and I just need to add the scoring system to be done.

Product Version: UE 4.11
Tags:
targetbooty.png (523.5 kB)
target.png (597.7 kB)
more ▼

asked May 05 '16 at 04:04 AM in Blueprint Scripting

avatar image

skullking
1 1 1

avatar image twenty one May 07 '16 at 04:14 PM

dont leave it late to do assignments..... especially when your extremely new to unreal

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

3 answers: sort voted first

Alright Mr Booty. Do you really need that totalbooty function inside booty BP? Put that booty function inside character and call it a day. Cast to character, dragout from character output and add the booties inside character. (just put it inside event graph, forget the function). Either that or create yourself a BPI for BootyCharacter or Event Dispatchers.

  • Follow this Video and you'll be golden for more booties.

Good luck! If this answered your question, please upvote and mark as answered.

more ▼

answered May 05 '16 at 04:21 AM

avatar image

VictorBurgos
2.4k 61 27 113

avatar image ScottSpadea May 05 '16 at 05:23 AM

this naming convention is hilarious, and kinda inspiring. it makes me wonder, is Projectile really the best name for bullets? i was thinking maybe a shorter word would be better, like Dart or Shot or Ball or Ammo or Shell.

avatar image skullking May 05 '16 at 05:25 AM

lol booty isnt the name of the projectile, booty is the name of the target that im hitting

avatar image skullking May 05 '16 at 05:24 AM

Well I went ahead and deleted the function from the Targetbooty and I had the function inside the FirstPersonCharacter. Are you saying in Targetbooty after the "OnComponentBeginOverlap(Cube)" to cast the FirstPersonCharacter and Addbooty cuz I did that and the projectile is still going through the booty instead of hitting it.

avatar image VictorBurgos May 05 '16 at 05:44 AM

Cast to FPC, on output, you +1 totalbooty, you are not using a function anymore. You are just doing the math manually from inside total booty, once BootyTarget gets hit, it casts to FPC, adds one (sets) to the value of TotalBooty (that's inside FPC) and that variable inside FPC is what you are using to keep track of the total booty. Keep it simple, don't make a function out of it, just comment it out and put it somewhere in event graph. I do still recommend watching that video, it would have helped you out with all this and thensome.

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

Actually, on looking at that mess of yours... there's too much booty and it got my booty confused. Okay, so listen. All you need to do is GET TOTAL BOOTY after casting from TargetBooty, +1, SET TOTAL BOOTY, done deal. You really have way too many variables/functions that are all doing the same thing....you need to refactor this whole thing...but yeah...just do what I said. delete anything that adds booty. Put the booty code inside FPC, cast to FPC, get, +1, set total booty, call it a day.

more ▼

answered May 05 '16 at 05:48 AM

avatar image

VictorBurgos
2.4k 61 27 113

avatar image skullking May 05 '16 at 09:00 PM

hey victor I feel like your on to something. I went ahead and deleted excess functions and variables and have now added it to the FPC but i get this error because I do not have an object. When I try to call Targetbooty as the object there it is not a simple get it has a back end as well...alt text

updated2.png (401.5 kB)
avatar image skullking May 05 '16 at 09:02 PM

By the way thanks for responding so quickly. Still new to this.

avatar image VictorBurgos May 05 '16 at 09:19 PM

Why are you casting to Targetbooty to increase it? Make all that code work INSIDE player character. All you need to do is from Targetbooty, cast to FPC, then have it add +1 to Totalbooty variable. You are going in circles.

avatar image skullking May 06 '16 at 12:32 AM

ok you were right so I tried to put everything in the FPC and I went ahead and followed that video you posted earlier but now im stuck again lol sorry im making it so difficult. Towards the end at around the 2 hour mark he sends his text box to a get percent but since im not using a percent where wouldnt I use an integer instead so when i look for SetInteger there is nothing so how do I tie the the text and the updatescorehub together?

Im also wondering if im binding the totalbooty and Targetbooty correctly because even if i get the text box to work it wont do any good if it isnt calling the targetbooty correclty Here are my blueprints so far alt text alt text alt text alt text

addbooty.png (354.3 kB)
fpcevent.png (397.4 kB)
scorehub.png (379.3 kB)
targetbooty.png (429.4 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

What the... LOL. Again...you ONLY need ONE function/event adding to booty... Is that first call in FPC, always set to 0 (default) I am assuming? On begin play. If it is, okay, I wouldn't have done it like that, but let's just leave it, as long as it's working since it only happens in the beginning and only once. That addbooty call looks fine, it's adding one and sending it along with the call to update the UMG. But before I get to the UMG, what the heck is that set totalbooty doing? I've actually never used Other Body Index, but that doesn't sound like it should be setting anything of TotalBooty. If anything, that's almost like a player index, but anyway, take that out. not needed. What you need to do, is when Targetbooty is hit, you call the AddBooty function inside FPC. You really went about this the wrong way. But anyways, finally that UMG...we need that to update. The text block should be the one that's bounded, and so you should have an output, but that's inside event graph...so that's completely wrong. you need to bind the text, so you can manipulate it.

Anyway, once you figure that UMG stuff out you are good to go. Upvote and mark this as resolved when you get done please:)

more ▼

answered May 06 '16 at 03:10 AM

avatar image

VictorBurgos
2.4k 61 27 113

avatar image skullking May 06 '16 at 05:00 AM

ok you were right ive got it showing up as 0 now. So now I just have to figure out how to add 1 each time the object is hit

(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