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"

< not working

Hello guys. I'm following a youtube RPG tutorial and on the Mana I kind of went my own way with it and paused the video it all seems to be working great, when I cast a spell the Mana loses 0.1 points, I have a < set so if Mana is less than the cost of the spell the script will run (false)

The problem is it will stop at 0.1 Mana and won't go down to zero. Been trying to figure this out but I can't. Any help would be appreciated am a n00b.

Product Version: UE 4.16
Tags:
more ▼

asked Jul 24 '17 at 08:00 PM in Blueprint Scripting

avatar image

LEEBOI999
6 1 1

avatar image LEEBOI999 Jul 24 '17 at 08:23 PM

Ok, so I changed the Mana var to 100 instead of 1 and everything associated with it and that works well. But doesn't work with in .1 oh well. Now my problem is the HUD bar doesn't follow the value till it reaches 0

avatar image LEEBOI999 Jul 24 '17 at 08:46 PM

alt text

Ok, so I just edited all the rest of the code off to give the simple version of what I have. It will not go past 0.1 though.

Mana = 1 Healmana = 0.1

mana.png (216.1 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Could you put a screenshot of your setup? I did a quick one that I imagine yours might look like. This runs until mana = 0. alt text

mana.png (93.8 kB)
more ▼

answered Jul 24 '17 at 08:23 PM

avatar image

vivalabugz
729 10 8 13

avatar image LEEBOI999 Jul 24 '17 at 08:37 PM

Thanks for replying. I'm not sure how I can get the code in, it is very messy and long. I have figured if I put the figures to 100 - 10 instead of 1 - 0.1 then it works perfectly and won't cast the spell when it is under 10.

The only problem with that is the progress bar doesn't work doing it like that

avatar image LEEBOI999 Jul 24 '17 at 08:40 PM

I also noticed when I used 100 - 10 it went down to 0.00 where as with 1 it will go down to -0.00 (when not using a condition)

avatar image LEEBOI999 Jul 24 '17 at 08:49 PM

I just uploaded a pic above thanks for your help.

avatar image vivalabugz Jul 24 '17 at 09:04 PM

from the screenshot, if your Healmana = 0.1 always, then based on the condition, it will never reach 0. Mana will always stop at 0.1. You need to set your condition to Mana < 0.0 based on the screenshot

avatar image LEEBOI999 Jul 24 '17 at 09:15 PM

Thanks, I tried that but if I put mana to 0.08 and then cast the spell the mana drops to -0.02.

From what I see mana should take away Healmana till mana is less than Healmana.

So Mana is stopping at 0.1 (which is the same as Healmana value) but as it is set to less than shouldnt that put it to 0?

When I set the values - Mana 100 Healmana 10

it works perfectly?

avatar image vivalabugz Jul 24 '17 at 09:28 PM

So Mana is stopping at 0.1 (which is the same as Healmana value) but as it is set to less than shouldnt that put it to 0?

You're right but for some reason it doesnt work. It's not working for me either. This seems like it might be a bug
avatar image LEEBOI999 Jul 24 '17 at 09:32 PM

I have been pulling my hair out for hours over it haha least I have a pass for it at the moment. Thanks for your help mate

avatar image LEEBOI999 Jul 24 '17 at 09:21 PM

Ok... So I have now set the values to Mana 100 Healmana 10

Then in the HUD mana function I divided Mana by 100 and now it works perfectly and shows on the HUD.

I don;t understand why it is not working with 1.0 - 0.1 still but otherwise I have got a bypass for it.

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

Try a <= node.

On a side note, personally I think it's logically easier to read from the true part of the branch, so I'd switch it around. If mana is >= healmana do stuff.

Hope you get this working.

more ▼

answered Jul 26 '17 at 10:00 AM

avatar image

Radiance37k
61 2 3 7

avatar image LEEBOI999 Jul 26 '17 at 10:30 AM

<= will not work because that will be true when mana and healmana are the same.

I have got it working, I had to x the values by 100. So Mana = 100 and heal mana = 10.

So it is a bug for some reason as it should work with 1 and 0.1

(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