What happened to OC? - CLOSED Carnage?!
Sign in to follow this  
Followers 0
Red Herring

[Solved] Modifying velocity seems to lead to self-harm?

function MakeProjectilesVeryFast()
	local stuff_to_modify = { "weapons\\pistol\\bullet", "weapons\\assault rifle\\bullet", "weapons\\sniper rifle\\sniper bullet", "weapons\\shotgun\\pellet", "vehicles\\warthog\\bullet", "vehicles\\scorpion\\bullet" }
	for i = 1, #stuff_to_modify do
		local tag = lookup_tag("proj", stuff_to_modify[i])
		local tag_name = read_string(read_dword(tag + 0x10))
		local tag_data = read_dword(tag + 0x14)
		local proj_vel = tag_data + 0x1e8
		write_float(proj_vel, 1000)
		print("Made projectile speed of '" .. tag_name .. "' very fast.")
	end
end

I modified the velocity of the bullet/pellet projectiles. When I shoot the assault rifle, holding down, there will be times where it will inflict damage onto myself. Most noticeable after killing another player. Had the velocity at 1000000 initially and also tried 40, but both had the same quirk happen. I also modified the accuracy, headshot bonus flag, and damage on the assault rifle, but after testing with those unmodified, it seems that the problem stems from this function. Any clues?

 

Edit: This is really weird. It only happens when I damage health.

 

Edit: Devieth pointed me to his existing script, 

which results in the same effect. Also, it might have been ambiguous above, but it only happens for the assault rifle.

 

Edit: Okay, so, it seems that I have to set the initial velocity too for some reason. Hopefully probably fixed.

 

Edit: Devieth told me to make sure the lifespan matches the new velocities, which probably explains why this thing was happening in the first place.

Edited by Red Herring
Takka likes this

Share this post


Link to post
Share on other sites

Tiddy-bits:

Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.