[Zombies]Aim assist WaW(lock on)
-
This is a modify version of the script made by "dontknowletspl" to work in waw engine, here´s the original post:
https://forum.plutonium.pw/topic/21826/release-zombies-black-ops-1-aim-assistcode_text //Call of Duty World at War //Credits to "dontknowletspl" for the original script #include maps\_utility; #include common_scripts\utility; init() { if(level.zombiemode == true) { level thread onPlayerConnect(); SetDvar( "aim_assist_lock", "1" ); } } onPlayerConnect() { level endon( "end_game" ); for ( ;; ) { if(isDefined(level.player_out_of_playable_area_monitor) && level.player_out_of_playable_area_monitor) //disable death barriers level.player_out_of_playable_area_monitor = 0; if(isDefined(level.player_too_many_weapons_monitor) && level.player_too_many_weapons_monitor) //disable too many weapons check level.player_too_many_weapons_monitor = 0; level waittill( "connected", player ); player thread AimAssist(); } } AimAssist() { level endon("end_game"); self endon("disconnect"); for(;;) { if(self hasperk("specialty_bulletaccuracy")) //waw custom perk check tag = "j_head"; else tag = "j_spine4"; view_pos = self Geteye(); self.head = self getTagOrigin("j_head"); zombies = get_array_of_closest( view_pos, getaispeciesarray("axis", "all"), undefined, undefined, undefined ); range_squared = 500 * 500; for ( i = 0; i < zombies.size; i++ ) { zombies[i].head = zombies[i] getTagOrigin(tag); if ( !IsDefined( zombies[i] ) || !IsAlive( zombies[i] )) { continue; } enemy_origin = zombies[i].origin; test_range_squared = DistanceSquared( view_pos, enemy_origin ); if ( test_range_squared < range_squared && GetDvar( "aim_assist_lock" ) == "1") { if(zombies[i] player_can_see_me(self) && bulletTracePassed(self.head, zombies[i].head, false, undefined)) { if(self adsButtonPressed() && self playerADS() < 0.6) { self setPlayerAngles(vectorToAngles((zombies[i] getTagOrigin(tag)) - (self getEye()))); while( self adsButtonPressed() ) { wait .05; } break; } } } } wait 0.05; } } player_can_see_me( player ) { playerangles = player getplayerangles(); playerforwardvec = anglesToForward( playerangles ); playerunitforwardvec = vectornormalize( playerforwardvec ); banzaipos = self.origin; playerpos = player getorigin(); playertobanzaivec = banzaipos - playerpos; playertobanzaiunitvec = vectornormalize( playertobanzaivec ); forwarddotbanzai = vectordot( playerunitforwardvec, playertobanzaiunitvec ); if ( forwarddotbanzai >= 1 ) { anglefromcenter = 0; } else if ( forwarddotbanzai <= -1 ) { anglefromcenter = 180; } else { anglefromcenter = acos( forwarddotbanzai ); } playerfov = getDvarFloat( "cg_fov" ); banzaivsplayerfovbuffer = 0.2; if ( banzaivsplayerfovbuffer <= 0 ) { banzaivsplayerfovbuffer = 0.2; } distance = self check_distance(player); playercanseeme = anglefromcenter <= ( ( playerfov * distance ) * ( 1 - banzaivsplayerfovbuffer ) ); return playercanseeme; } check_distance(player) { if(distance(self.origin, player.origin) < 90) return .45; if(distance(self.origin, player.origin) <= 100) return .4; if(distance(self.origin, player.origin) <= 150) return .3; if(distance(self.origin, player.origin) <= 200) return .25; if(distance(self.origin, player.origin) <= 250) return .225; if(distance(self.origin, player.origin) <= 300) return .2; if(distance(self.origin, player.origin) <= 350) return .175; if(distance(self.origin, player.origin) <= 400) return .15; return .125; }
INSTALL: Copy the code to text editor save as aim_assist.gsc then copy the file to:
%localappdata%\Plutonium\storage\t4\scripts\sp
The script works automatically upon launching any zombie map or custom map, to disable the aim lock just type "aim_assist_lock 0" into the console, the script has some issues with melee, reload and some other actions, ill fix this things probably nex week. Any recommendations will be welcome
-
I was able to get the bo1 script created by dontknowletspl working perfectly
Although, I can't seem to get this W@W Script to work whether i put it in the sp folder or zom folder
Maybe I'm doing something wrong not sure though. Any help is appreciated! -
Hulkster did u manage to fix it?
-
Unitivebeatle41 I Actually did. I placed the aim_assist.gsc file in %localappdata%\Plutonium\storage\t4\raw\scripts\sp and it started working. I guess I was just placing the file in the regular scripts folder in the t4 directory and not inside the the scripts folder located in the raw folder. So just make sure you select the scripts folder inside the RAW folder. Hope this helps!
-
I thought pluto already added aim assist to t4? What’s the intent behind this to try to match how it works on Xbox?
Or is the aim assist on pluto only making the camera follow a zombie but does not work on ADS?
-
Lachara_43 I was able to add failsafes to 100% block aim assist when player IsMeleeing(), IsThrowingGrenade(), isSwitchingWeapons(), or holding an invalid weapon that doesn't have ADS. These were all pretty easy, the first 3 have simple engine functions you can use, and the last one I suggest just making an if statement at the very top of the loop with a function that you returns 0 if player is holding betties, perks, grenade launcher, etc. and returns 1 otherwise.
For reloading, this was a bit tricky because there is no IsReloading() in WaW, simply add a variable check for self.is_reloading == false and then thread this function as part of your aim assist init:
is_reloading_checker() { level endon("end_game"); self endon("disconnect"); self endon("death"); for(;;) { self.is_reloading = false; self waittill( "reload_start" ); if(GetDvar( "aim_assist_lock" ) != "1") { wait(1); continue; } weap = self getCurrentWeapon(); while( (self GetWeaponAmmoClip( weap ) != WeaponClipSize( weap ) && self GetWeaponAmmoStock( weap ) != 0 ) && !self isMeleeing() && !self IsThrowingGrenade() && !self isSwitchingWeapons() ) // if we switch weps, throw grenade, or melee we cancel reload { self.is_reloading = true; wait(0.5); } } }
I also cleaned it up a bit and I am now implementing a toggle that will work on co-op, because as it stands remember that GetDvar() will always just returns the value of the host. I added an aim assist button to Game Options and found a way to send a menu script response to GSC which will either kill all aim assist functions or thread the aim assist functions to begin them. Still have a few kinks to work out but my modification of this aim assist script will be implemented into my WAW zombies remaster mod, with credit given.