Welcome to Open Carnage

A resource for Halo Custom Edition and MCC modding, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time!

EST. 14th of February, 2012

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.")

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
Tucker933 likes this

Share this post

Link to post
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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

    No registered users viewing this page.