Jump to content

NPC Firerate


Go to solution Solved by Langerd,

Recommended Posts

  • Solution

The class of the npc is important too. Class jan and lando shots faster than stormtrooper i think (but it give the undisarmable bonus). The other shooting classes change their fire speed that depends on the game difficulty settings.

 

In npc file ... no. You can only set fire distance . If you want npc that shoots faster or it using alt fire - use script.

Asgarath83 likes this
Link to comment

Isn't it possible to just create a new class?

//Generated by BehavEd

set ( /*@SET_TYPES*/ "SET_WEAPON", /*@[member='weaponx']_NAMES*/ "WP_BLASTER" );
set ( /*@SET_TYPES*/ "SET_ALT_FIRE", /*@BOOL_TYPES*/ "false" );
set ( /*@SET_TYPES*/ "SET_SHOT_SPACING", 1500 );

Here is a simple script you can use for any NPC. You can select their weapon, if you want them to use alt fire or not (set to true or false) and the shot spacing. That is as complicated as this is. You just muck about with the variables, like shot spacing. You can also set Aim, Aggression, vis range, hearing range, and more by adding them to the script. 

 

Then, give the NPC a spawnscript and a value (your script name)

 

Key: Spawnscript

Value: Script folder name/fire_rate_1500 ( name of folder script is in & script name)

 

That's it. Its much easier to script stuff plus you get the added benefit of being able to do much more with that specific NPC. If you want, for example, your stormtrooper to shoot faster but crouch, you'll have to script the crouching anyhow.

Asgarath83 likes this
Link to comment

@@IrocJeff - do you have list of options that we can put in the script for npc ?

 

Not really, no. I went through Behaved a bazillion times and read all the commands for {E "set_types", <str>} which is what you'll choose for most of this. There are some decent descriptions there but you have to really  go through all of them and see what is relevant to the NPC directly. 

 

Below is one of many similar scripts from my project. Do put the Default Behavior state in which i forgot to mention in the above posting example a few replies back. This script is an ambush script were a stormtrooper would run around a corner to intercept the player. I had a ton of these scripts in my project with different aim, aggression, ect.

 

I also never used the waypoint system cause I never got it to work properly which is why I have the nav_goals set up. In the map, I'd just put combat_points all over the place.  Worked out well.

//Generated by BehavEd

set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_DEFAULT" );
set ( /*@SET_TYPES*/ "SET_RUNNING", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_AIM", 5 );
set ( /*@SET_TYPES*/ "SET_AGGRESSION", 5 );
set ( /*@SET_TYPES*/ "SET_ALT_FIRE", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_LOOK_FOR_ENEMIES", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_CHASE_ENEMIES", /*@BOOL_TYPES*/ "true" );

task ( "go1" )
{
	set ( /*@SET_TYPES*/ "SET_NAVGOAL", "pointa" );
}


task ( "go2" )
{
	set ( /*@SET_TYPES*/ "SET_NAVGOAL", "pointb" );
}

dowait ( "go1" );
dowait ( "go2" );

Here is one of a stationary stormtrooper crouched next to a crate or doorway or wherever. This one has the "set_no_combat_talk" set to false so this guy won't say " Hey, a Rebel" or "I should get a commendation for this" when he kills you. Also, he can see you at 2048 grid units away. Setting him not to flee means he'll stay put.

//Generated by BehavEd

set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_DEFAULT" );
set ( /*@SET_TYPES*/ "SET_NO_COMBAT_TALK", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_VISRANGE", 2048.000 );
set ( /*@SET_TYPES*/ "SET_ALT_FIRE", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_CHASE_ENEMIES", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_CROUCHED", /*@BOOL_TYPES*/ "false" );
set ( /*@SET_TYPES*/ "SET_DONT_FLEE", /*@BOOL_TYPES*/ "true" );
set ( /*@SET_TYPES*/ "SET_AIM", 5 );
set ( /*@SET_TYPES*/ "SET_AGGRESSION", 5 );

Langerd likes this
Link to comment

The rank key also influences the rate of fire, but sometimes yields... strange results... for example, alt firing and akimbo wielded blaster pistols. Also try the npc class, as it's been mentioned earlier, classes jan and lando shoot faster than stormtroopers.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...