Scripts / HELP NEEDED! Setting up Randomized Attacks for Player

Author
Message
ALieNz
4
Years of Service
User Offline
Joined: 8th Apr 2020
Location:
Posted: 8th Apr 2020 16:30 Edited at: 8th Apr 2020 17:55
Hi guys,

I haven't had a whole lot of activity on the discord channel, so perhaps a forum post might net me more responses, LOOKING AT YOU smallg & AmenMoses!

I am trying to create brawler/beat'em up type game. While playing around with the "chainsaw brute" .lua script I was fascinated by how there were two different randomized attacks... a heavy, and a light one.

I'm wanting to create something similar, and spent a couple hours last night studying the gameplayer.lua that I've attached to this post. I couldn't quite figure it out, but made giant hard to miss notes on where I think those areas may be...

What I am wanting is....
* template that allows 4 different attack types (light punch, heavy punch, light kick, hard kick) assigned to 4 different keys.

*Each type of attack has a few different animations to randomly choose from

*Damage ranges from when the damage begins, and when it ends for each animation

...Is it possible to force the enemy player into an animation if a certain animation is prompted by the player? (player throws the enemy, etc.) it may be nice to coordinate some of these with the enemy.

All I am needing are places in the script that Ive attached that will allow me to plug these animation frames in... I have no clue how to set it up though... any help would be greatly appreciated. There are roughly 3 animations of each attack.. (3 light punches, 3 heavy punches, 3 light kicks, 3 heavy kicks)
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Apr 2020 19:34
are you adding it to existing AI?
you will need to set a "state" where they play the animation then exit that state when the animation is done - e.g. flinching in the stock AI
unless you want to delve deep into the AI scripts the easiest method - as there will always be code in the stock AI that is constantly checking for the correct state to be in - you will likely want to add your code above all other code in the "core" script and 'return' while in that state so no other checks can be run
i.e. ai_soldier.lua and ai_soldier_main(e)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
BatmanLegacy
4
Years of Service
User Offline
Joined: 26th Jan 2020
Location:
Posted: 8th Apr 2020 21:24 Edited at: 8th Apr 2020 21:45
First off, thank you for the quick reply smallg

I created a list of the custom animations, using the classic character list as a template to edit..then i put this lkst in the .fpe of my character.

However as you mentioned..I realized that there is only one state for kick, and one state for punch.
I noted these animations, but wasnt aure how to create/add new states for the character. Can you point me to which files i will have to look at to do this?

Ive only been at this for 2.5 months, so im still learning haha. The best way thats helped me to learn is to use the stock scripts and add to them, if i can have something as a template i have a better shot at figuring it out...however this ine has me stumped.

***
Edit
Its ALieNz, i didnt realize i was on an old name still signed on my phone from when I first created when I first started with gameguru
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 8th Apr 2020 22:13
Quote: "Its ALieNz, i didnt realize i was on an old name still signed on my phone from when I first created when I first started with gameguru"

Ok but one account has to go … Multiple accounts are not allowed unfortunately.
Can I assume you want to keep the BatmanLegacy ?
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
ALieNz
4
Years of Service
User Offline
Joined: 8th Apr 2020
Location:
Posted: 8th Apr 2020 22:34
Actually the one I go by on discord "ALieNz" is the one I would like to keep.

I ddint even remember that I had the Batman Legacy account.

PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 8th Apr 2020 23:36
Ok no worries. You may lose the Batman Legacy post though so I will hold out first to see if you get your reply
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
ALieNz
4
Years of Service
User Offline
Joined: 8th Apr 2020
Location:
Posted: 9th Apr 2020 00:44
No need to Synchro , I'll repost.
****
First off, thank you for the quick reply smallg

I created a list of the custom animations, using the classic character list as a template to edit..then i put this lkst in the .fpe of my character.

However as you mentioned..I realized that there is only one state for kick, and one state for punch.
I noted these animations, but wasnt aure how to create/add new states for the character. Can you point me to which files i will have to look at to do this?

Ive only been at this for 2.5 months, so im still learning haha. The best way thats helped me to learn is to use the stock scripts and add to them, if i can have something as a template i have a better shot at figuring it out...however this ine has me stumped.

PM
ALieNz
4
Years of Service
User Offline
Joined: 8th Apr 2020
Location:
Posted: 9th Apr 2020 18:49
Small_G.. could you provide a small example of what you were referring to in adding/creating my own states and how it would look?

The ai script im using is the gameplayer.lua since this is a character that the player will use use..

Would it be better to use a different script to work off of? Such as the "chainsaw brutescript" that came with TBone's giant asset expansion?

That script seems to offer something like what I am trying to do...but not quite sure how, where, and what all i need to do in order to create new "states." I ujderstand the .fpe is one section. If its a lot of work I dont mind doing it. I just need a little guidance onnwhere to start
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Apr 2020 11:24
Quote: "The ai script im using is the gameplayer.lua since this is a character that the player will use use.."

oh this is for the player? well then that's going to be a lot more difficult.. i don't really know how third person works anymore but you used to be able to assign your script to the entity before you attached it to the start marker and it would sort of work.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
ALieNz
4
Years of Service
User Offline
Joined: 8th Apr 2020
Location:
Posted: 10th Apr 2020 13:46
Yeaaah i have heard 3rd person has been an "after thought" but it seems like they really ironed it out compared to what people have mentioned about it from before.

I created my own custom character with a long range of animations, just as much as the stock animations. As you mentioned, i just place him on the marker, and as far as functionality goes everything works great

I just dont know how to do a variety of attacks vs the one assigned "punch" when no weapon is held.

I dont really mind using a different script other than the gameplayer control as a base... i suppose im just trying to start with a good template that will allow me to customize it with ranges or states...andni thought the gameplayer would be a good starting template..but it seemed very confusing

If i get it working, i dont mind sharing the script with the community as it seemed to be quite useful
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Apr 2020 14:18
There is a folder in scriptbank called tpp and in there is a script called thirdperson.lua.

Lee added that to apparently allow us to customise the third person experience but I'm not sure what he was expecting us to put in there as at present it is an empty script.
Been there, done that, got all the T-Shirts!
PM
ALieNz
4
Years of Service
User Offline
Joined: 8th Apr 2020
Location:
Posted: 10th Apr 2020 16:39 Edited at: 10th Apr 2020 16:44
lol yeah i was so disappointed in that when I went to open it.

I realized some of you may not have the add on pack and have no clue what I am talking about with the chainsaw_brute, so I attached it.

….can any script really be used as a 3rd person script? it seems that way when I test it out, but I didn't know if I would run into problems later down the road as my game would have more features such as an inventory/other interactive features.

If any script can be used..maybe I can use this chainsaw_brute script as a starting template as it already has two randomized attacks at different damage levels? It also looks like it requires "states" so im not sure how to add more. [img]null[/img]

Attachments

Login to view attachments
PM

Login to post a reply

Server time is: 2024-04-26 04:23:19
Your offset time is: 2024-04-26 04:23:19