|
Post by jgiroux on Oct 17, 2016 22:43:08 GMT
Want a simple to use Combo Attack option for your game? well this is a simple start, but should get many of you a solid foundation to build upon. Can do any number of single button/movement combos with keyboard/joystick(analog movement) and Joystick R and L trigger support, uses the default Invector InputManager so it will work right of the box with their current melee/movement asset packages. It's a simple Class script ,so to start just create a new C# script and call it "KeyCombo" and copy/paste/build the below code (in the C# code section) into your project.
// // // // // // // // // // // // // // Combo System Add-On // // // // // // // // // // // // // // // // =========================================================================================================== // // How to use: create a new script. or add to an existing one the following variables and update() functions // and place on your player character. // you do not need to add this "KeyCombo".cs class script to anything, just add the variables below and // call the function when needed, // personally I would just make a separate script to just handle combos, since you more than // likely will have a lot of If statement cluttering up your main scripts // // ************************************************************************************************************ // // private KeyCombo your_combo1_name_here = new KeyCombo(new string[] { "up", "down", "up", "up" }); // private KeyCombo your_combo2_name_here = new KeyCombo(new string[] { "up", "down", "B", "B" }); // private KeyCombo Kick_to_the_Face = new KeyCombo(new string[] { "left", "right", "up","up","X","Y" }); // private KeyCombo JumpingMegaKillerMove = new KeyCombo(new string[] { "left", "right", "LT", "RT", "X", "X" }); // etc... // // ************************************************************************************************************* // and then in your Update() script // you can check for them like so. // // ============================================================================================================= // // if (your_combo1_name_here.Check()) // { // //do combo1 stuff // Debug.Log("COMBO 1 ACTIVATED"); // } // if (your_combo2_name_here.Check()) // { // // do combo2 stuff // Debug.Log("COMBO 2 ACTIVATED"); // } // if (Kick_to_the_Face.Check()) // { // // do Kick to the face combo stuff // Debug.Log("Kick to the Face ACTIVATED"); // } // etc.... // =========================================================================================================== // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
using UnityEngine;
public class KeyCombo { public string[] buttons; // set up an array for the series of buttons player must hit within allowed time to activate combo private int currentIndex = 0; //keep an index of the buttons player has/is pressed/pressing public float allowedTimeBetweenButtons = 0.3f; //the amount of time allowed to press between buttons to keep combo buildup alive private float timeLastButtonPressed; // so we need to keep a floating time of when the last button or joystick move was
public KeyCombo(string[] b) { buttons = b; }
// Combo Function, returns true if player successfully completed the series of button presses. public bool Check() { if (Time.time > timeLastButtonPressed + allowedTimeBetweenButtons) currentIndex = 0; { if (currentIndex < buttons.Length) { //==================================================================================================================== // just checking for the standard movement handling, since joystick are an Axis, and Invector already // has the cross platform input, so lets just check for those things. We also want to check specifically // for the RT and LT triggers since those are axis as well and not buttons. // remember to still use your InputManager settings and not the actual "letters" if basing game on Keyboard/Mouse only // ==================================================================================================================== if ((buttons[currentIndex] == "down" && Input.GetAxisRaw("Vertical") == -1) || (buttons[currentIndex] == "up" && Input.GetAxisRaw("Vertical") == 1) || (buttons[currentIndex] == "left" && Input.GetAxisRaw("Horizontal") == -1) || (buttons[currentIndex] == "right" && Input.GetAxisRaw("Horizontal") == 1) || (buttons[currentIndex] == "down" && Input.GetAxisRaw("LeftAnalogVertical") == -1) || (buttons[currentIndex] == "up" && Input.GetAxisRaw("LeftAnalogVertical") == 1) || (buttons[currentIndex] == "left" && Input.GetAxisRaw("LeftAnalogHorizontal") == -1) || (buttons[currentIndex] == "right" && Input.GetAxisRaw("LeftAnalogHorizontal") == 1) || (buttons[currentIndex] == "LT" && Input.GetAxisRaw("LT") == 1) || (buttons[currentIndex] == "RT" && Input.GetAxisRaw("RT") == 1) || (buttons[currentIndex] != "down" && buttons[currentIndex] != "up" && buttons[currentIndex] != "left" && buttons[currentIndex] != "right" && Input.GetButtonDown(buttons[currentIndex]))) { timeLastButtonPressed = Time.time; //keep track of button press delays currentIndex++; }
if (currentIndex >= buttons.Length) { currentIndex = 0; return true; // Combo was successfully completed } else return false; // failed } } return false; }
}
to check for your combos in game, simply set up some variables (combo routines) in either a new script or an existing script that will be on your Player character. I suggest a new script , just because it will surely be cluttered with all your combo options.
________________________________________________________________________________ private KeyCombo your_combo1_name_here = new KeyCombo(new string[] { "up", "down", "up", "up" }); private KeyCombo your_combo2_name_here = new KeyCombo(new string[] { "up", "down", "B", "B" }); private KeyCombo Kick_to_the_Face = new KeyCombo(new string[] { "left", "right", "up","up","X","Y" }); private KeyCombo JumpingMegaKillerMove = new KeyCombo(new string[] { "left", "right", "LT", "RT", "X", "X" }); ________________________________________________________________________________ etc, etc....
and then somewhere in your Update() script check for the combos like so.
________________________________________________________________________________ if (your_combo1_name_here.Check()) { //do combo1 stuff Debug.Log("COMBO 1 ACTIVATED"); } if (your_combo2_name_here.Check()) { // do combo2 stuff Debug.Log("COMBO 2 ACTIVATED"); } if (Kick_to_the_Face.Check()) { // do Kick to the face combo stuff Debug.Log("Kick to the Face ACTIVATED"); } ________________________________________________________________________________
etc, etc....
that's it, play your game and try out your new combos, its a very simplified version of a true combo system and as such, doesn't have press and hold button features, or more than one button press at same time checks. but its a start
|
|
|
Post by Invector on Oct 17, 2016 22:45:01 GMT
hey j, check your inbox
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 4, 2016 13:07:37 GMT
Does it work like street fighters? Around the attack/combo moves.
|
|
|
Post by G 4 greatness on Jan 4, 2017 19:29:26 GMT
please make a simple video or simple step by step for non coders like me I am an armteur
|
|
|
Post by jgiroux on Jan 10, 2017 22:59:38 GMT
Its pretty straightforward already, but for the sake of simplicity here is an actual step by step
Step 1)create a new C# script and call it "KeyCombo" and copy/paste/build the below code (inside the box only)
// // // // // // // // // // // // // // Combo System Add-On // // // // // // // // // // // // // // // // =========================================================================================================== // // How to use: create a new script. or add to an existing one the following variables and update() functions // and place on your player character. // you do not need to add this "KeyCombo".cs class script to anything, just add the variables below and // call the function when needed, // personally I would just make a separate script to just handle combos, since you more than // likely will have a lot of If statement cluttering up your main scripts // // ************************************************************************************************************ // // private KeyCombo your_combo1_name_here = new KeyCombo(new string[] { "up", "down", "up", "up" }); // private KeyCombo your_combo2_name_here = new KeyCombo(new string[] { "up", "down", "B", "B" }); // private KeyCombo Kick_to_the_Face = new KeyCombo(new string[] { "left", "right", "up","up","X","Y" }); // private KeyCombo JumpingMegaKillerMove = new KeyCombo(new string[] { "left", "right", "LT", "RT", "X", "X" }); // etc... // // ************************************************************************************************************* // and then in your Update() script // you can check for them like so. // // ============================================================================================================= // // if (your_combo1_name_here.Check()) // { // //do combo1 stuff // Debug.Log("COMBO 1 ACTIVATED"); // } // if (your_combo2_name_here.Check()) // { // // do combo2 stuff // Debug.Log("COMBO 2 ACTIVATED"); // } // if (Kick_to_the_Face.Check()) // { // // do Kick to the face combo stuff // Debug.Log("Kick to the Face ACTIVATED"); // } // etc.... // =========================================================================================================== // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
using UnityEngine;
public class KeyCombo { public string[] buttons; // set up an array for the series of buttons player must hit within allowed time to activate combo private int currentIndex = 0; //keep an index of the buttons player has/is pressed/pressing public float allowedTimeBetweenButtons = 0.3f; //the amount of time allowed to press between buttons to keep combo buildup alive private float timeLastButtonPressed; // so we need to keep a floating time of when the last button or joystick move was
public KeyCombo(string[] b) { buttons = b; }
// Combo Function, returns true if player successfully completed the series of button presses. public bool Check() { if (Time.time > timeLastButtonPressed + allowedTimeBetweenButtons) currentIndex = 0; { if (currentIndex < buttons.Length) { //==================================================================================================================== // just checking for the standard movement handling, since joystick are an Axis, and Invector already // has the cross platform input, so lets just check for those things. We also want to check specifically // for the RT and LT triggers since those are axis as well and not buttons. // remember to still use your InputManager settings and not the actual "letters" if basing game on Keyboard/Mouse only // ==================================================================================================================== if ((buttons[currentIndex] == "down" && Input.GetAxisRaw("Vertical") == -1) || (buttons[currentIndex] == "up" && Input.GetAxisRaw("Vertical") == 1) || (buttons[currentIndex] == "left" && Input.GetAxisRaw("Horizontal") == -1) || (buttons[currentIndex] == "right" && Input.GetAxisRaw("Horizontal") == 1) || (buttons[currentIndex] == "down" && Input.GetAxisRaw("LeftAnalogVertical") == -1) || (buttons[currentIndex] == "up" && Input.GetAxisRaw("LeftAnalogVertical") == 1) || (buttons[currentIndex] == "left" && Input.GetAxisRaw("LeftAnalogHorizontal") == -1) || (buttons[currentIndex] == "right" && Input.GetAxisRaw("LeftAnalogHorizontal") == 1) || (buttons[currentIndex] == "LT" && Input.GetAxisRaw("LT") == 1) || (buttons[currentIndex] == "RT" && Input.GetAxisRaw("RT") == 1) || (buttons[currentIndex] != "down" && buttons[currentIndex] != "up" && buttons[currentIndex] != "left" && buttons[currentIndex] != "right" && Input.GetButtonDown(buttons[currentIndex]))) { timeLastButtonPressed = Time.time; //keep track of button press delays currentIndex++; }
if (currentIndex >= buttons.Length) { currentIndex = 0; return true; // Combo was successfully completed } else return false; // failed } } return false; }
} step2 : create a new c# script call it "comboTest" and copy/paste the below code into your new script. (again only the parts in the box)
using UnityEngine; using System.Collections;
public class comboTest : MonoBehaviour { private KeyCombo your_combo1_name_here = new KeyCombo(new string[] { "up", "down", "up", "up" }); private KeyCombo your_combo2_name_here = new KeyCombo(new string[] { "up", "down", "B", "B" }); private KeyCombo Kick_to_the_Face = new KeyCombo(new string[] { "left", "right", "up","up","X","Y" }); private KeyCombo JumpingMegaKillerMove = new KeyCombo(new string[] { "left", "right", "LT", "RT", "X", "X" });
void Update() { if (your_combo1_name_here.Check()) { //do combo1 stuff Debug.Log("COMBO 1 ACTIVATED"); } if (your_combo2_name_here.Check()) { // do combo2 stuff Debug.Log("COMBO 2 ACTIVATED"); } if (Kick_to_the_Face.Check()) { // do Kick to the face combo stuff Debug.Log("Kick to the Face ACTIVATED"); } } }
Step 3) Add the comboTest script *and only that one* to your player character.
now when you do your combo moves it will display a debug.... Im not going to go into how to setup parameters on your animations to trigger animation states, because you should at the very least learn that part to be able to do anything with custom animations and triggers.
try up, down , up , up
up, down, B, B (you will have to check your input settings for what the keyboard values are for B and X, A and Y on a joystick as I forget off hand if you are going to be using keyboard and not a joystick.
|
|
|
Post by G 4 greatness on Jan 12, 2017 15:35:10 GMT
OK THANKS looks and sound easy but an example simple basic video is not harmful.... I will do exactly that and see how it goes ...how about making the script text box in highlight in bold lines because they are a lot of underlining in there because I learn easier that way
|
|
|
Post by jgiroux on Jan 12, 2017 21:10:52 GMT
OK THANKS looks and sound easy but an example simple basic video is not harmful.... I will do exactly that and see how it goes ...how about making the script text box in highlight in bold lines because they are a lot of underlining in there because I learn easier that way Hello Gwin, while I am normally unopposed to assisting where assistance is needed, I really think you need to re-evauluate what you have for base knowledge on scripting, if I were to do a video on this? it would simply be me copying and pasting the 2 above scripts as mentioned, and dragging the component onto the player. I really don't think you or anyone would *gain* any knowledge from this, and if I explained it in detail, again, its pretty cut and dry clear. If you know a little about scripting.
I am unable to make the script in the text box bold, as its for c# code, I don't have the luxury of highlights, bold, etc in code box. if I don't put it in the code box, it looks like crap and would be even harder to understand.
of all the add-ons I have written, this sincerely is the easiest to setup. Please give it a try and you will see how easy it is. But it seems you may be in over your head, as you would still need to setup animation transitions for all the "combo attacks" etc..
once again, I am sorry I cannot be of more assistance. But give it a go, worse thing that can happen is you cannot get it to work.
if I have time, I will do a quick video for you and post it, but I have a lot on my plate right now, so it may be a few weeks before I get back to this.
|
|
|
Post by G 4 greatness on Jan 15, 2017 16:20:55 GMT
i understand
|
|
|
Post by codeassembler on Feb 19, 2017 0:25:15 GMT
Thanks a Lot for taking the time for this and even more for sharing it, will try it and give feedback later on!
|
|
|
Post by warpzone on Apr 19, 2017 16:43:12 GMT
Oh this looks really useful! I'll have to start a clean project and get to know this system. If a combo includes punch, kick, will the punch and the kick still both get delivered? Cuz if not, that's not a combo system, it's more of a special attack system. (You know, Hadoken, Shoryuken, that sort of thing.) Not that I'm complaining! I needed something just like this to diversify the player's moveset a little bit. OK THANKS looks and sound easy but an example simple basic video is not harmful.... I will do exactly that and see how it goes ...how about making the script text box in highlight in bold lines because they are a lot of underlining in there because I learn easier that way if I have time, I will do a quick video for you and post it, but I have a lot on my plate right now, so it may be a few weeks before I get back to this. Just my two cents, I can appreciate where gwinyaibere is coming from because I have the opposite situation. I learn better from being able to read and parse a big wall-o'-text at my own pace. It drives me nuts how most Blender and Unity tutorials are only available in video form these days. Different people learn differently. In a perfect world, all tutorials would be available in both formats, text and video. And, yeah, attaching a script is a pretty basic skill, but we were all new once. Here's a video tutorial on how to attach a script in general: Hope that helps.
|
|
|
Post by warpzone on Apr 20, 2017 8:47:34 GMT
It doesn't work. Nevermind, got it working. Update: that was the Debug test, of course. Now for the "fun" part. It's time for... Angry Chronicles of Unity Animation!jgiroux doesn't want to teach us how to actually use his system, of course. Because we're all seasoned Unity professionals here, right? No need to tell us what we all already know. It would be insulting to both of us and a huge waste of time. Except, no. We're not all seasoned professionals. Some of us bought this product precisely because we don't understand how to do animation. If we understood how to do it already, we'd probably just roll our own solution tailor-made for our game. Hell, some of us might even have gotten to this forum thread completely by accident, after googling Unity+Animation. It's happened to me before. You try to figure out how Unity does something, you google it, the top search result is a Unity Answers page, and when you click through to the Answer... they're saying the person who asked the question should stop bothering them and go Google it.It's like, "Dude. I didn't ask to be here. Google put me here. Now are you gonna be part of the solution, or part of the problem?" I'm sick and tired of this bad attitude infesting what used to be an amazing community. A few years ago, before the Asset Store turned coding chops into a goddamned commodity, the Unity community was a place where people helped each other. We were all new once. And I don't care how long you've been using Unity, there will always be some feature or trick you don't know, if only because they keep making features obsolete with every new release faster than even paid asset developers can keep up. (See all those warnings in the console? Yeah. I'm talkin' about that.) So why do we always give people grief when they come to us, hat in hand, asking us how to do basic shit? Fortunately, Google seems to be in a particularly helpful mood as I type this. Here are links the documentation for [ Animation Parameters] and [ Animation States], just in case you, the Future Person in The Space Future reading this, got to this page because Google was trolling you having a bad day. (I put the links in brackets because this forum hates making links visible and easy to click on. UGH.) Coming up next, we'll walk through how to actually trigger an animation, once I figure out what the hell I'm doing. Update: Punching a Bitch Right in the Face, a Helpful Guide, Part 1So in the folder Invector-3rdPersonController\Melee Combat\Animator in your project's Assets folder, there's an Animator named Invector_MeleeCombatv2. I recommend copying this, moving it outside the Invector folder, and renaming it, so you can customize your Player character, for example, to have different moves than the enemies. Later, you can create one Animator for each enemy type you have, but for right now, let's start simple. By keeping Invector_MeleeCombatv2 vanilla, you can always refer back to it for pointers on how it's "supposed to look,"and by moving your edits outside of Invector's folder, you ensure that if you accidentally the Animator, you can always reload the original without losing any of your edits. If you double-click Invector_MeleeCombatv2, it will open in the Animator window. I like to keep this docked with the console and the Animation window, but feel free to customize your layout however you feel best suits your workflow. On the left side of the Animator window, you'll see two tabs, called Layers and Parameters. For starters, let's click on Parameters. You'll see a fuckton of variable names on the left, these are the parameters. There's booleans like WeakAttack and StrongAttack that it's reasonable to assume trigger the chains of attack animations you might have already noticed if you messed around traversing the state machine over on the right side of the window, as well as various words you might recognize from some of the guts of 3rdPersonController's scripts, such as isGrounded and isDead. But there's also some stuff here I've never seen before. RandomAttack? ReactionID? Interesting... Just for fun, let's see if we can figure out how to trigger RandomAttack. A windows search for the string randomattack in the Assets folder points to v_AIController.cs and v_AImotor.cs. So basically, it's used by NPCs and enemies. That makes sense. v_AIController is a red herring, it's just part of the boolean variable name randomAttackCount, which appears but does not get declared here. v_AImotor declares but does not use randomAttackCount. It strikes me as odd that v_AIController doesn't implement v_AImotor. But upon further inspection, it does implement v_AIAnimator, which implements v_AImotor. Isn't OOP fun? Instead of Spaghetti Code, it's like Spaghetti-threaded-through-Portals-from-the-game-Portal-Code. So we couldn't actually find the string "RandomAttack" anywhere in our code. So what causes it to Do Things? Well, according to docs.unity3d.com/Manual/AnimationParameters.html, while a script CAN read and write Animation Parameters, they can also be set from within an animation curve. So that might be what's going on here. I'm not sure yet. There's a lot of animations to look through, and I'm still getting a handle on what all these controls actually DO. It's also possible Invector implemented RandomAttack but never ended up using it. Fortunately, docs.unity3d.com/Manual/AnimationParameters.html does give us the easy solution for playing an animation via a parameter: using UnityEngine; using System.Collections;
public class SimplePlayer : MonoBehaviour { Animator animator; // Use this for initialization void Start () { animator = GetComponent<Animator>(); } // Update is called once per frame void Update () { float h = Input.GetAxis("Horizontal"); float v = Input.GetAxis("Vertical"); bool fire = Input.GetButtonDown("Fire1");
animator.SetFloat("Forward",v); animator.SetFloat("Strafe",h); animator.SetBool("Fire", fire); }
void OnCollisionEnter(Collision col) { if (col.gameObject.CompareTag("Enemy")) { animator.SetTrigger("Die"); } } } Looks like we can set any of these floats or booleans we want to. using different flavors of Animatior.Set commands, and doing that just updates the animation at runtime. It's not that simple, of course, because of the whole Finite State Machine angle. Can you only transition into some animations from certain other animations? Or does the FSM just dictate how blending happens, and leave the logic of how animations fit together up to the scripts? One way to find out... Update: Punching a Bitch Right in the Face, a Helpful Guide, Part 2Sorry for the delay. Mowed the lawn. Took a shower. Back to work. So it turns out I was making a lot of naive assumptions. Among other things, I assumed the Animation Parameter RandomAttack referred to which of the three types of basic attacks it would pick. I added a reference to the animator in my script and tried the following: animator.SetInt("RandomAttack",Random.Range(0,2)); Now, those of you who came to Invector with previous knowledge of Unity's animation system are probably smacking your foreheads right now, for the same reason Unity's compiler did: There's no such thing as Animator.SetInt! I don't know what this parameter is, but it's not an index. It's a float, because only bools and floats exist. I couldn't tell you what it does... when I messed with it in the editor at runtime, nothing happened. And that's the other thing. Messing with the various floats and bools under Parameters would sometimes trigger animations or state changes to start playing, but they never disabled themselves again when the animation finished playing. That is, the floats don't go back to 0 and the checkboxes don't uncheck themselves. This suggests that I might have to do it manually in script with some sort of timer or callback. But then, when I call animator.SetBool("WeakAttack", true) as a consequence of inputting combo 1, it does uncheck the box again. In fact, I never actually see the boolean turn true, it just plays the weak attack animation. It costs stamina to do this, but oddly enough it works even if you have no stamina. So I'm not sure how Invector's scripts would normally do an attack, but this method clearly ain't it. At best, this is a messy kludge that circumvents key parts of Invector's original code. (Never mind the fact that I was going to disable stamina anyway for my project, it's the principle of the thing. It's not enough to figure out how to trigger an animation. I'm gonna figure out how to trigger an animation correctly, stamina cost and all. Who knows, maybe I can keep the stamina meter around as a special attack gauge. But that's only possible with a deeper integration. So to recap, here's the code jgiroux didn't want you to see: using UnityEngine; using System.Collections;
public class comboTest : MonoBehaviour { private KeyCombo your_combo1_name_here = new KeyCombo(new string[] { "up", "down", "up", "up" }); private KeyCombo your_combo2_name_here = new KeyCombo(new string[] { "up", "down", "B", "B" }); private KeyCombo Kick_to_the_Face = new KeyCombo(new string[] { "left", "right", "up","up","X","Y" }); private KeyCombo JumpingMegaKillerMove = new KeyCombo(new string[] { "left", "right", "LT", "RT", "X", "X" });
Animator animator; // Use this for initialization void Start () { animator = GetComponent<Animator>(); } void Update() { if (your_combo1_name_here.Check()) { //do combo1 stuff animator.SetBool("WeakAttack", true); Debug.Log("COMBO 1 ACTIVATED"); } if (your_combo2_name_here.Check()) { // do combo2 stuff Debug.Log("COMBO 2 ACTIVATED"); } if (Kick_to_the_Face.Check()) { // do Kick to the face combo stuff Debug.Log("Kick to the Face ACTIVATED"); } } } And then you'd do what I did for combo 1 with the other combos. God, I feel like such a monster, giving newbies this kind of unspeakable power, the power to write five additional lines of code! I hope the fucking chaperones at the school dance don't tell our parents about all this hand-holding.That's it for now. Stay tuned while I dig deeper into Invector's code and the concept of Animation States in general. At some point, I'm going to want to add my own animations. But of course, that can only happen after I make my own animations. (Turns out making video games is a lot of work across multiple disciplines, who'd of thunk it.) And, hey. If you didn't know how Unity's animation system worked until I typed this, a little thank you wouldn't hurt. And if you do know all about Unity's animation system and you see something wrong here, for the love of god correct me publicly in this thread. I'm giving away half-assed information here because that's all the ass I have to work with. Don't let me misinform newbies when you know better. Speak up! Spread the knowledge! Be part of the solution, goddammit!
|
|
|
Post by jgiroux on Apr 20, 2017 18:54:44 GMT
warpzone, ok, not sure if you are trolling me lol, but I really enjoy your posts. I mean... they are always quite entertaining. You should seriously think about blogging or something like that. I really did enjoy it. but now to answer some things so you better understand, I am not being hostile, nor am I trying to be a jerk to "noobs" as you said, we have all been there at one point. I supplied the code only with no video tuts simply because I don't believe its "robust" enough to have a full length tutorial on how to get it to work. if you see my Vehicle Add-On you will see Ive done a number of in depth video tutorials. also, I am doing this for free, with absolutely *no* incentive to share other than to be kind... so in that regard, calling me out for not *helping* is a little premature don't you think? making a video takes time,editing, uploading, time I could very well be working on "my own" issues with learning, as you said noobs, im still learning. so I cannot consider myself a "master" of any degree. but enough with all that,like I said, I don't want to sound like an a$$. but you also make some very decent points, and for that I will acknowledge that you did yourself, try and help. so if I were to do a video tutorial explaining how to do something, what might you be interested in knowing? how to create new animations in Invector and how to create parameters etc? to make those animations work? speak up my friend. We are all civilized here and usually willing to help. keep up the excellent posts though... they are really funny (I hope that was their intent and I didn't just insult you)
|
|
|
Post by warpzone on Apr 20, 2017 21:15:24 GMT
Heh. Thanks, man. That's really gratifying. I wasn't trolling you. The Angry Chronicles posts (shout out to Invector for coming up with the name! XD invector.proboards.com/thread/387/bugfix-make-enemies-dodge-same ) are my coping mechanism for wading through Somebody Else's Code. By talking about each step of my own muddled process, I coax the next step out of my brain. I ended up getting really deep into character this time, (think Karkat if you're into Homestuck,) but I'm glad I was able to entertain you. My comments about the state of the community were more about the larger trend I saw reflected in your "Im not going to go into how to setup parameters on your animations to trigger animation states, because you should at the very least learn that part to be able to do anything with custom animations and triggers." comment, than about your post specifically or you as a person. Obviously you're a great guy for posting this code in the first place, and we should all be grateful for it. But if I have to spend five hours teaching myself how to write five lines of code, I'm dang well gonna show my work so the next poor schlub who wiki-walks through here can get it in five minutes. gwinyaibere's the one who learns better from videos. I learn better from text. (The problem is Unity Team seems content to just publish packages with working examples half the time and let us figure it out that way. Then a little cottage industry takes over, releasing better examples via the asset store, and articles and videos to earn money off of advertising revenue. Unfortunately, the bottom fell out of ad banners at the same time network TV was taking over youtube. This means videos make more money than text-based articles, these days, so there's no incentive for the people who know how to type up articles and find hosting space for them.) You didn't come across like a a$$... like an ass. (I just cussed like 20 times in the article, I think you can say the word ass without offending me.) There are absolutely elements of humor, frustration, schadenfreude, and sarcasm in what I wrote. (And some of them were even intentional! HEYO!!! Take that, me!) So. Let's see. Blank check for additional help. That's actually pretty tempting, thank you! I'm not sure what I need or what you're good at, but I do think anything we teach each other should be done publicly so as many people as possible can learn from it. The goal on my personal project, which you can read about at invector.proboards.com/thread/404/sadly-name-neon-chrome, is to take Invector's Dark Souls Clone engine, and stretch it into a Devil May Cry Clone Engine. (As I told Invector in an email, the world doesn't need that straight of a Dark Souls clone. Dark Souls is already the Dark Souls of Dark Souls.) I've had some luck making faster attacks that cover a wider area, and I've even played around with adjusting the speeds and start and stop time of various animations in the Animator to make them flow a little better. But I'm nearing the limits of what I can do with Invector's animations. Pretty soon I'm gonna need to start rolling my own, and that's going to be a whole new can of worms. My immediate plans are to figure out how to get your system talking to Invector's Stamina meter, like I said in the post. Longer term, there's a bunch of other stuff I have to do like make a proper menu, get LOD squared away, etc. In fact, I may rebuild the whole thing soon in an effort to get rid of a mysterious editor crash bug. Mostly all I've contributed to my own project is art assets and kludges to Invector's code. I'll tell you what, one thing that would really help me out would be a text-based explanation of how to make a new animation using my character model in Blender, and then import that into Unity in such a way that I can add it to Invector's existing Animator setup. I'm not even sure if that's possible, even with Mechanim, but I want to try. And I'm sure a video version would help people like gwinyaibere who learn better from videos. (Do you want help editing? I can do light video editing and compositing in Blender and audio cleanup and arranging in Audacity, if that helps. I may not be very fast at this, but the least I can do is try to pull some of my own weight.) Thanks again, man. You're a good sport.
|
|
|
Post by warpzone on Apr 22, 2017 13:08:02 GMT
jgiroux, one thing I notice is that if I make a combo be "up, up, up," holding down the up button totally triggers the combo.
Is there any way to distinguish between tapping and holding a button? And then I guess the next logical step would be to detect holding one button while pressing another. And then the next most important feature would be comparing the game state, such as enemies nearby/locked or whether or not the player is airborne, that kind of thing, as a prerequisite for triggering combos.
With those three features, you could build all kinds of gameplay off of this system. That's a pipe dream, of course.
In the meantime, have you used this script as-is in an actual game? If so, how'd that turn out? Is it playable? How does the gameplay feel to you?
|
|
|
Post by jgiroux on Apr 22, 2017 15:58:40 GMT
In the meantime, have you used this script as-is in an actual game? If so, how'd that turn out? Is it playable? How does the gameplay feel to you? Heya Warp!
I have used that script but for my needs I used it for a vehicular combat project. (think PS2 twisted metal/Vigilante 8/Rogue Trip) so for my needs I had a combo meter, so any combos drained the meter thus you couldn't necessarily *trigger* another one. so gameplay for my needs was fine, which is probably why I didn't delve into the features of it so much since it did what I needed it to do for my needs.
but yes, I noticed that as well since there is no timer count between button presses etc. that it would trigger *quite* fast can it be done? of course. it would take some serious coding though to set timer variable properly, check for long and short button presses.etc
I do know there is an asset package on the unity store. called GAC CLICK ME FOR LINK
they are charging 50$ for it, which I guarantee even if I update this add-on, it would pale in comparison.
ill look into what I would need to code it, and if it isn't a huge ordeal, ill dive in, otherwise im afraid I just wouldn't be able to commit to a project of that scope without some type of financial compensation. and as mentioned, I don't want to charge for my services. as I want people to learn and not all of us have money for these expensive asset packages. so I'd have to leave the add-on as is.
its a "simple" combo system with no real options built into it.
|
|