Jump to content
Paco

How to work with SQSoldiers / Bots in Blueprints - how to sprint and attach weapon?

Recommended Posts

Paco   

I'm trying to move some of the bots around in blueprints. I've created a custom AIController, and I can get them to spawn, move around waypoints etc.

 

I've managed to get the bots to crouch/uncrouch using blueprints, and can even do lean right/left, but here is what I can't do - can someone tell me if it's even possible, or point me in the right direction?

 

1) Sprint - I can't get the bots to sprint, and can't find a sprint/walk command anywhere

2) Attach a weapon - I've tried adding a weapon to the inventory and switching to it, but no weapon shows up in game.

3) How to fire/aim a weapon? I can't even start with this until I get past 2!

 

Any help at all would be greatly appreciated - I've tried asking in discord without much luck - is here a better spot?

Share this post


Link to post
Share on other sites
Psyrus   
1 hour ago, Paco said:

1) Sprint - I can't get the bots to sprint, and can't find a sprint/walk command anywhere

 

I doubt there is a command... try looking for a boolean isSprinting/isWalking or something, as I guess it just checks for that boolean and modifies the rate of movement and animation played based on that. 

 

1 hour ago, Paco said:

3) How to fire/aim a weapon? I can't even start with this until I get past 2!

 

For this you might look at the playercontroller to see how it takes input and translates that into firing. 

Share this post


Link to post
Share on other sites
Paco   
38 minutes ago, Psyrus said:

 

I doubt there is a command... try looking for a boolean isSprinting/isWalking or something, as I guess it just checks for that boolean and modifies the rate of movement and animation played based on that. 

 

 

For this you might look at the playercontroller to see how it takes input and translates that into firing. 

 

That's a good thought. I just had a look and I can find lots of functions for testing to see if we are running or not, but can't see any variables I can set that have "run" or "sprint" in the name. I'll check again in the morning, maybe I'm just missing something there.

Share this post


Link to post
Share on other sites
Paco   

Yeah, had a good look - there isn't any state that I can set in any blueprint exposed class I can find.

 

Following wasti's suggestion on discord, I'm just setting the WalkingSpeed manually now - means that it won't calculate stamina or any of those things, or use the correct multipliers, but it's better than nothing.

 

I'm sure there must be a Sprint() fn that's not exposed to blueprints under there though that would do all of this for me.

 

Share this post


Link to post
Share on other sites
Paco   

If you're trying to disable it on the player - there are some settings I came across like sprint multiplier etc - if you set that to 1.0 then presumably you won't be able to move any faster than a  walk... It may still use stamina though, although i think i also saw a boolean to disable sprint affecting stamina.

 

Share this post


Link to post
Share on other sites

Yeppers. i've not looked properly yet at the Player Controller stuff, but i thought that's where this stuff might be hiding. I'm a fair way off doing that stuff yet though.

Share this post


Link to post
Share on other sites

×