Jump to content

Home

Long Range Weapons mod v1.0


TheMunchkinLord

Recommended Posts

My new Long Range Weapons mod is available in pcgamemods.com's KOTOR section, under Guns.

 

11 (5 upgradeable) new long range guns for your destructive pleasure.

 

Contains 6 completely new (modded firing range, base damage, critical range, etc.) types of gun that can be purchased from Suvam Tan's store on Yavin IV or constructed by T3-M4:

 

Type of gun (number in game) ....................... Range (meters)

 

Long Range Heavy Blaster(2) ..................................... 32m

Long Range Blaster Rifle(2) ........................................ 40m

Long Range Disruptor Pistol(2) ................................... 32m

Long Range Disruptor Rifle(2) ..................................... 40m

Long Range Heavy Repeating Disruptor Rifle :) (2) .......... 36m

Long Range Stun Pistol (1) ......................................... 32m

 

Download here: http://www.pcgamemods.com/se/195/0/name/

Link to comment
Share on other sites

very nice. i always have had an affinity for long range weapons (up close at point blank scares the crap out of me :( ). i've got a couple of my own, but i'm not sure adding extra range actually helps. if i'm not mistaken (ie, i still have to test this), adding range really does nothing more than change the "range" description for the weapon. why??? because your pc (or npc) can only see the target at a certain range (around 28m), no matter what the awareness rating is. don't believe me?? try it. i'm not tryin to say it has anything to do with you, its the existing problem is probably hardcoded. :(

Link to comment
Share on other sites

Originally posted by stingerhs

very nice. i always have had an affinity for long range weapons (up close at point blank scares the crap out of me :( ). i've got a couple of my own, but i'm not sure adding extra range actually helps. if i'm not mistaken (ie, i still have to test this), adding range really does nothing more than change the "range" description for the weapon. why??? because your pc (or npc) can only see the target at a certain range (around 28m), no matter what the awareness rating is. don't believe me?? try it. i'm not tryin to say it has anything to do with you, its the existing problem is probably hardcoded. :(

 

You may have already caught this, but in Baseitems.2da there is a max range column and a preferred range column.

If you set max to 50 but keep pref at 23, then your shooter will probably close to 23 before shooting no matter what you do.

 

I could be wrong though. That's the first thing that sprang to mind when I saw your post.

Link to comment
Share on other sites

Originally posted by Achillies

You may have already caught this, but in Baseitems.2da there is a max range column and a preferred range column.

If you set max to 50 but keep pref at 23, then your shooter will probably close to 23 before shooting no matter what you do.

 

I could be wrong though. That's the first thing that sprang to mind when I saw your post.

 

actually, i was refering to when you actually "see" the target. ie, on dantooine running towards a kath hound. you, as a person can see the rendered 3d object of a kath hound, but you character cannnot see it until you reach a certain distance between your character and the target. (hope that didn't sound too technical), which for me was always around 28m, no matter what i changed in the baseitems.2da.

Link to comment
Share on other sites

Originally posted by stingerhs

actually, i was refering to when you actually "see" the target. ie, on dantooine running towards a kath hound. you, as a person can see the rendered 3d object of a kath hound, but you character cannnot see it until you reach a certain distance between your character and the target. (hope that didn't sound too technical), which for me was always around 28m, no matter what i changed in the baseitems.2da.

 

Ah gotcha. That must have something to do with the AI scripting, which means a simple 2da edit won't fix it. Luckily it appears that distances shorter than 28m can be selected using Baseitems :D

Link to comment
Share on other sites

Originally posted by Achillies

Ah gotcha. That must have something to do with the AI scripting, which means a simple 2da edit won't fix it. Luckily it appears that distances shorter than 28m can be selected using Baseitems :D

 

Actually the problem might also stem from the perception range or whatever it is in the NPC's .utc file that might also be the cilprit for hindering the longer range weapons from working.

 

(In KOTOR Tool open a .utc file it is in the Advanced tab labled Perception Range)

 

If that has allready been discussed then please ignore my ramblings! :D

Link to comment
Share on other sites

Originally posted by RedHawke

Actually the problem might also stem from the perception range or whatever it is in the NPC's .utc file that might also be the cilprit for hindering the longer range weapons from working.

 

(In KOTOR Tool open a .utc file it is in the Advanced tab labled Perception Range)

 

If that has allready been discussed then please ignore my ramblings! :D

 

hmm, never thought of that. but i'm thinkin that just makin hk-47 a sniper (actually, i just came up with another mod idea, hee hee hee!!!) wouldn't have the same appeal as your pc being the sniper.

Link to comment
Share on other sites

Originally posted by RedHawke

Actually the problem might also stem from the perception range or whatever it is in the NPC's .utc file that might also be the cilprit for hindering the longer range weapons from working.

 

(In KOTOR Tool open a .utc file it is in the Advanced tab labled Perception Range)

 

If that has allready been discussed then please ignore my ramblings! :D

 

I thought perception range was one of the AI scripts on the Scripts tab? Either way, it appears that "Long" is the best option anyway (which is what everyone is set to).

Link to comment
Share on other sites

Originally posted by Achillies

I thought perception range was one of the AI scripts on the Scripts tab? Either way, it appears that "Long" is the best option anyway (which is what everyone is set to).

 

There is an OnNotice script but I don't recall a perception script? :confused:

 

But I could be wrong! :D

Link to comment
Share on other sites

Originally posted by RedHawke

There is an OnNotice script but I don't recall a perception script? :confused:

 

But I could be wrong! :D

 

The onnotice is probably the one that I was thinking of (I was too lazy to look it up :D). I'd just assumed that was the scrip t that made you notice stuff.

Link to comment
Share on other sites

Originally posted by Achillies

The onnotice is probably the one that I was thinking of (I was too lazy to look it up :D). I'd just assumed that was the scrip t that made you notice stuff.

 

The OnNotice script, I think the most coomon entry in that one is the script k_def_percept01 or whatever it is called and it looks like it probably uses the Perception Range in the .utc file for its calculations.

 

That would mean the Perception Range is the key to the long range problem... the ranges are probably hardcoded into the listed catgories... Oh well! :D

Link to comment
Share on other sites

Originally posted by RedHawke

The OnNotice script, I think the most coomon entry in that one is the script k_def_percept01 or whatever it is called and it looks like it probably uses the Perception Range in the .utc file for its calculations.

 

That would mean the Perception Range is the key to the long range problem... the ranges are probably hardcoded into the listed catgories... Oh well! :D

 

Looking at k_def_percept01, I was unable to see anything that looked like it was helping to determine range. Actually, if I had to take an educated guess, it looks like it pretty much just keeps you from recognizing the same enemy over and over again (probably something to do with auto pause).

 

On a hunch, I started digging through the 2da files and found ranges.2da. The labels there seemed to align with the perception options in the utc files.

 

Based on the table, the longest perception range available is 250m (this is the Player range). When I went over to the utc files, Player was an option in the drop down. Very encouraging!

 

The second longest range is Long (weighing in at 35m). So, if a change in the perception to Player will actually stick, a 50+ meter ranged weapon may be a reality. Then all you have to worry about is line of sight and game balance :p

 

Have fun testing it out everyone!

Link to comment
Share on other sites

Thanks for the feedback guys. I have been looking into the "perception" range of the characters too.. so far it looks like on the game's default settings, under "real" conditions, you can spot enemies around 25-30m, give or take, depending on your current LOS (line of sight). So if anyone comes across an editable section in a valid override file, I'm sure it'll be posted if I don't find it :)

 

About the 2da.. I set the "preferred attack range" on the new long range guns to 2 meters less than the range of the weapons themselves, so the AI shouldn't try and close to 20 meters before firing, like the default settings. This does seem to let your NPCs fire sooner, as far as I can tell, although they still do stupid things sometimes, like running right up on an enemy if they were around a corner or something.. but that's more dependant on the AI logic itself, so I won't get into that here. One interesting thing to note about the default 2da are the grenade settings, which have their maxrange as 10m, but maxattackrange as 25m, which is actually where you can throw one from, seeming to make the maxrange value ignored. Also of note is the prefattack distance of 0.5. Now this may be different because it's a thrown weapon, but something to look at if we want to understand the 2da's impact on the mechanics of the game.

 

But at any rate, even with the long range pistol's range of 32m, under favorable LOS conditions, you *can* hit enemies before they can hit you :) Try it on some immobile turrets for a demonstration. Version 1.0 was a quick release to get the mod out there and see if anyone was interested, seems like you are, so I'll probably be updating as new developments are made.

 

Happy blasting.

Link to comment
Share on other sites

We appreciate the update. I thought I was on to something there with the Ranges.2da but no dice :(.

 

I'm especially interested in what you find out regarding grenades, as I was mulling over a grenade mod. Whatever you find could be considerably helpful :D

Link to comment
Share on other sites

Achilles - k_def_percept01 is almost completely commented out, it has only one real line of code - it calls k_ai_master. Your character perceives everyone in a map, but the characters will not take any action until they see them - using the command GetLastPerceptionSeen().

 

Also, I do not believe the AI uses the preferred weapon range check the following code snipet from the k_ai_master:

 

//P.W. (June 8) - Put this check in to try and reduce the instances of NPCs running right up

//to their enemies with blasters.

if(GetDistanceBetween(OBJECT_SELF, oTarget) < 20.0 && !GetObjectSeen(oTarget))

{

ActionMoveToObject(oTarget, TRUE, 2.0);

}

else

{

if(GN_GetWeaponType(OBJECT_SELF) == 1

{

ActionMoveToObject(oTarget, TRUE, 4.0);

}

else

{

ActionMoveToObject(oTarget, TRUE, 15.0);

}

}

 

So, if your character is using blasters and are farther then 20 away from the target and he can not "see" the enemy he will move to 15 away from the target.

 

Last, with your checks changing the 2da's did you start a new game? If you did not I would try it out just to be sure.

Link to comment
Share on other sites

I would start a new game before you rule out the ranges.2da. Many of the parameters from the 2da actually get stored in your save game, so to be 100% sure you need to start a new game.

 

After checking the NWN forum I am pretty sure this is the 2da file you need to change. Make sure you change both the primary and secondary ranges. Acording to the documentation I have read the secondary range actually controls how far a character "sees".

Link to comment
Share on other sites

Ok, I tried using ranges.2da on a new game, no luck as far as I can tell. Someone might want to double-check this though. It might help if someone knew a way to display the actual distance your current target is at, but with the modifications below, new game or no, the targets unfortunately still became targetable at the same range as unmodified on my machine.

 

The values I changed are:

 

label, primaryrange, secondaryrange

 

PercepRngMed, 50, 50

PercepRngDefault, 50, 50

PercepRngPlayer, 250 (default), 50

PartyCombat, 50, 50

Link to comment
Share on other sites

Originally posted by TheMunchkinLord

Ok, I tried using ranges.2da on a new game, no luck as far as I can tell. Someone might want to double-check this though. It might help if someone knew a way to display the actual distance your current target is at, but with the modifications below, new game or no, the targets unfortunately still became targetable at the same range as unmodified on my machine.

What I did was walk toward an enemy with an insta-kill pistol and drop it where it stood as soon as I had the option to attack. Then I counted the running steps it took to get from where I fired to where the enemy was.

Link to comment
Share on other sites

I have been meaning to post a follow up, but I got a little distracted. :rolleyes: Unfortunately, everything I found out was bad. I figured out how to get an exact measurement of your range to a monster. I modifyed my k_ai_master to post the exact range you are at when you attack. No matter what ranged weapon I used the farthest away I could attack was around 26 meters.

 

I also doubled checked the perception script and found that in the ranges.2da it is the primary field that determines if a object is in sight. So the PC has a range of 250. I ran a few tests and found that my character would "perceive" a character halfway across the map, but the attack symbol would not pop up until I was around 26 meters.

 

I am pretty sure that the max range you can attack is hardcoded at around 26 meters.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...