.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Enhancement Workshop > Metamod and metamod plugins
Metamod and metamod plugins Plugins and improvements for the metamod server-side mod

Reply
 
Thread Tools
Weapon Accuracy
Old
  (#1)
nG-Juggernaut
Guest
 
Status:
Posts: n/a
Default Weapon Accuracy - 17-03-2004

Hello,
I am trying to make a mod to increase teh accuracy of the mac-10, I am relatively new to plugin coding, but I am a c++ programmer, Any suggestions, links, or source code would be nice

ThankYou,
Juggernaut
#NationGaming
New site coming soon! ( Surreal-Media )
  
Reply With Quote
Re: Weapon Accuracy
Old
  (#2)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Weapon Accuracy - 17-03-2004

When a bot does a traceline you can force the trace to point directly at the intended target, this will give you precise aim even with a MAC-10 shooting from far away while the bot is running and jumping like a fool

Code:
pfnTraceLine( pentToSkip->v.origin + pentToSkip->v.view_ofs, pentToSkip->v.origin + pentToSkip-v.view_ofs + gpGlobals->v_forward * 9999, fNoMonsters, pentToSkip, ptr );



You can adjust things to make it more or less precise, otherwise the aim will be too good and very unrealistic.



Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Weapon Accuracy
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Weapon Accuracy - 17-03-2004

don't forget to call MAKE_VECTORS before this to build the base referential. And this should not be fNoMonsters, but dont_ignore_monsters (if you ignore monsters you will ignore clients as well, and your bullets will simply "pass through" them)



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Weapon Accuracy
Old
  (#4)
nG-Juggernaut
Guest
 
Status:
Posts: n/a
Default Re: Weapon Accuracy - 17-03-2004

Ok, That is semi-helpful, I understand what you are saying, but first, I want to make the accuracy of the gun for EVERYONE in the server, not just a bot(i dont run bots), I also am wondering if anyone can give me detailed in structions on how to do this, and what libs i need to compile this, and what compiler is best for this type of thing, I have the hl sdk(full multi/single), And i use dev-c++, any links, tutorials, or even a fll peice of sourse code to do this would be MUCh appreciated.

ThankYou,
Juggernaut
#NationGaming
New Site coming soon! ( Surreal-Media )
  
Reply With Quote
Re: Weapon Accuracy
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Weapon Accuracy - 17-03-2004

This is not a problem, you can very well make a plugin that will affect the accuracy of the gun for everyone and not just a bot.

Make your plugin hook the TraceLine function. Then, do a check on pentToSkip to know if it's a player (having the FL_CLIENT flag set), and if so, to know which gun model he's carrying (check for pentToSkip->v.weaponmodel). Once you know it's a player with a Mac10 in hand, just modify the return results of the TraceLine yourself the way we described and make the function exit with your modified TraceResult



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Weapon Accuracy
Old
  (#6)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Weapon Accuracy - 17-03-2004

Quote:
Originally Posted by Pierre-Marie Baty
don't forget to call MAKE_VECTORS before this to build the base referential. And this should not be fNoMonsters, but dont_ignore_monsters (if you ignore monsters you will ignore clients as well, and your bullets will simply "pass through" them)
What I'm doing is hooking onto the engine pfnTraceLine and passing the same arguments back to the real engine call, i.e., fNoMonsters is one of the arguments which is passed back unaltered.

The only things that are changed are v1, and v2 as shown in my first post, but I'm not using MAKE_VECTORS anywhere and it seems to be working fine for months now. Are you sure a call to MAKE_VECTORS is needed?

???


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Weapon Accuracy
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Weapon Accuracy - 18-03-2004

MAKE_VECTORS() builds an orthonormal referential of vectors out of a view angle and store each of the 3 vectors coordinates in the gpGlobals structure. If you don't call MAKE_VECTORS() before using gpGlobals->v_forward, gpGlobals->v_up or gpGlobals->v_right, you will use the vectors from the last referential that was declared using MAKE_VECTORS() - which may have been frames ago, for a totally different bot using a totally different view angle.

If your code works for months, that's because you're a lucky man: the player who is firing your TraceLine executed a MAKE_VECTORS() call in the engine with his view angle just before. But what if he doesn't ? What if your player calls MAKE_VECTORS() every 4 or 5 frames or so ? You never know what happens in the game DLL

Keep this in mind as this is systematic: before using any vector from the gpGlobals referential, ensure the referential is BUILT for the view angles you want to use it with. Calling MAKE_VECTORS() is not very much CPU intensive. I do it systematically. If you don't, you're never sure you're safe.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com