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"

Implementing a refresh move history function and a more specific launch direction for an airdash.

Currently I have this blueprint model set up:

alt text

And I really need it to be able to do two things in particular before I start adding animation. One is that I need it to refresh the input history after it has been detected that the key has been hit twice. And I also need it to be able to launch in specific directions(probably via a different velocity method?) so that I can map appropriate facing directions for each keyboard character and their respective forward left right backward directions.

I tried utilizing this way of refreshing the input history: http://gregmladucky.com/blog/?p=690

But I can't find the proper way to plug it into my current function.

If someone could help point me in the direction of using a better velocity launching method then that would help greatly as well. I think trying to either change or modify the get forward vector part of the function and have tried a couple things so far.

An extra thing that I'm going to want once I can achieve these two things is to be able to only use these particular types of dashes in the air, as I want to create separate dash styles for grounded-movement.

I would greatly appreciate the help, thank you!

Product Version: UE 4.18
Tags:
ue4question.png (281.1 kB)
more ▼

asked Oct 25 '17 at 07:06 AM in Blueprint Scripting

avatar image

MotokoChill
1 1 1

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

1 answer: sort voted first

Hello Motoko. I saw your question in discord. And if you've seen my last answer, that had a problem when the camera turned in the middle of the double tap.

alt text

Here is the Event Graph. With each directional input requesting their respective dash direction.

alt text

In here you see the Check Dash Double Tap macro, which receives a input and check if it's been requested before. Don't forget to set the initial value of Last Input to 255. (Also, use Get Time Seconds, because it's the in-game time count. Get Real Time Seconds is the active system time which counts even if the game is paused)

alt text

And here's the Try Dashing function, which checks if the player is either walking or falling, then proceeds to dash if it's possible.

alt text

And here are the properties.

Now one thing to note, it's a pretty bare bones logic. You might need to adjust the inputs the more complex your character movement gets.

I hope it helps! Let me know if I missed something.

dashexample-01.png (155.2 kB)
dashexample-02.png (202.3 kB)
dashexample-03.png (184.4 kB)
dashexample-04.png (23.4 kB)
more ▼

answered Oct 25 '17 at 10:11 PM

avatar image

KaelAlexis
6 1 2

avatar image MotokoChill Oct 25 '17 at 11:49 PM

First of all I want to say thank you for responding to this. It's definitely a functional step in the right direction. However I did come across one problem in particular. I tried to plug in my original launch character method in place of your Do Dash function within the Try Dashing function. However I was not able to add a Flow Control Delay after the launch character script in that place(Refer to the end of my initial BP image to see what I'm talking about). The dash at this point is not working with launch character plugged into that place, with or without the original end components.

With that said, can I see your Do Dash function?

avatar image KaelAlexis Oct 26 '17 at 12:23 AM

Delay is a latent function and can only be added in the Event Graph, they're not allowed inside other functions. But don't worry, here's how I would do it.

I would never use Delay functions for movement commands, because you might want to check if the command is still being processed, and with a Delay function I'm not sure if there's a way to do that other than messing your Even Graph with booleans.

alt text

On the Even Graph, Add a new event (In this case I named Stop Dash), the connect the functions to immediately stop character movement.

alt text

Before I had nothing inside here, just a Print String to tell me if things were working. But here's how I would do the dash. After setting the velocity in the character movement, I activate a timer to tell when the Dash should stop, it will call the Stop Dash event in the Event Graph. And don't forget to connect a Timer Handle, because you'll need it later.

alt text

With the timer handle, put it in the Try Dashing function, it'll check if the dashing is still happening and will not attempt to dash again in case it's active.

alt text

Here are the newly created properties.

dashexample-05.png (103.9 kB)
dashexample-06.png (134.9 kB)
dashexample-07.png (149.6 kB)
dashexample-08.png (12.9 kB)
avatar image MotokoChill Oct 26 '17 at 02:32 AM

Originally the delay was set up so that the user couldn't infinitely dash, and although I seemed to have plugged in everything you've listed here I still can't get it to work. I attempted to plug in that Do Dash at the end of the Try Dash part mentioned recently and replicated everything as you put it here and it still doesn't work. Could there perhaps be something missing?

avatar image KaelAlexis Oct 26 '17 at 03:11 AM

Make sure Can Ground Dash and Can Air Dash are initially set to true. Also, now I noticed the last delay is an interval for the Dash after it's been executed. So here it is.

alt text

In this context, I like to use Delay since it's just an interval to reactivate a boolean. I also added a Stop Dash Immediately which can be called while dashing is still processing.

alt text

To make things cleaner, you can create a function to check if the character can dash. And replace the logic in Try Dashing with this function. (Don't forget to put up there to check if Dash is Enabled)

alt text

Just like this~

alt text

Set DashEnabled to false at the end of Do Dash function.

alt text

Here are the new properties.

(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