Jump to content

Welcome to Omni-bot Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Riflenade with Paththrough

- - - - - Riflenade

  • Please log in to reply
1 reply to this topic

#1
VargaTom

VargaTom

    Junior Member

  • Members
  • 103 posts
  • LocationNorth of Hungary

Hi,

I would likew to create a paththrough when axis engineer shot with his GPG40 weapon. It works one time,  but not the other.

It is not working in the attached video. That is, according to the program the shot will take place but it will not happen in the game.

Here's the code

grenadeshot2 =
		{
			wpInfo = Util.WpNameInfo("Garand_shot_2"),
			EvalFunc = function(_this)
			{
				return Map.rifle_g_bots2 < 1 && Map.GoldRoomTriggerCount > 0 && _this.Bot.HasAmmo(WEAPON.GPG40) && (_this.Bot.HasWeapon(WEAPON.GPG40) || this.Bot.HasWeapon(WEAPON.K43));		// && _this.Bot.HasWeapon(WEAPON.GPG40) || this.Bot.HasWeapon(WEAPON.K43)
			},
			navigate = function(_this)
			{
				Map.rifle_g_bots2 += 1;
				
				_this.AddAimRequest(Priority.VeryHigh, "facing", Vec3(-0.982, 0.179, 0.058));
				_this.AddWeaponRequest(Priority.VeryHigh, WEAPON.GPG40);	
				if ( _this.Goto(Map.Navigation.grenadeshot2.wpInfo.position) == EVENT.PATH_SUCCESS )
				{
					Util.MapDebugPrint("^lGoldRoomTriggerCount" ":" +Map.GoldRoomTriggerCount);
					_this.BlockForWeaponChange( WEAPON.GPG40 );
					_this.Bot.HoldButton(BTN.ATTACK1, 0.3);
					Util.MapDebugPrint("^lATTACK");
					sleep(3.3);
					Util.MapDebugPrint("^lSLEEP");
				}
				Map.rifle_g_bots2 -= 1;

			},
		},

 

https://youtu.be/3RUNsjRjtw8

 

 

Someone has an idea?



#2
palota

palota

    Senior Member

  • Administrators
  • 563 posts

The engineer must wait until the weapon is charged.

grenadeshot2  =
{
	wpInfo = Util.WpNameInfo("Garand_shot_2"),
	EvalFunc = function(_this)
	{
		return Map.rifle_g_bots2 < 1 && Map.GoldRoomTriggerCount > 0 && _this.Bot.HasAmmo(WEAPON.GPG40) && _this.Bot.HasWeapon(WEAPON.GPG40);
	},
	navigate = function(_this)
	{
		Map.rifle_g_bots2 += 1;
		if ( _this.Goto(Map.Navigation.grenadeshot2.wpInfo.position) == EVENT.PATH_SUCCESS )
		{
			while (Map.GoldRoomTriggerCount > 0 && _this.Bot.HasAmmo(WEAPON.GPG40))
			{
				Util.MapDebugPrint("^lGoldRoomTriggerCount" ":" +Map.GoldRoomTriggerCount, true);
				if (!_this.Bot.IsWeaponCharged(WEAPON.GPG40))
				{
					_this.ReleaseWeaponRequest();
					_this.ReleaseAimRequest();
					dowhile (!_this.Bot.IsWeaponCharged(WEAPON.GPG40))
					{
						sleep(1);
					}
				}
				_this.AddAimRequest(Priority.VeryHigh, "facing", Vec3(-0.982, 0.179, 0.058));
				_this.AddWeaponRequest(Priority.VeryHigh, WEAPON.GPG40);
				_this.BlockForWeaponChange( WEAPON.GPG40 );
				sleep(0.5);
				Util.MapDebugPrint("^lATTACK", true);
				_this.Bot.HoldButton(BTN.ATTACK1, 0.3);
				sleep(1.0);
			}
		}
		Map.rifle_g_bots2 -= 1;
	},
},


  • VargaTom likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users