Welcome to Open Carnage

A resource for Halo 1 modding and tech, with unique means of rewarding individual content creation and support. Have a wander to see why we're worth the time! EST. 2012

Sign in to follow this  
Followers 0
IceCrow14

Friendly/Ally reticle enabler script

Members of Open Carnage never see off-site ads.

I was just thinking about righting this, but kept thing "haha ha, I'm to lazy hell no." Really cice, it is a little sensitive though.

 

Update: You could do this btw.

local obj_ID = read_dword(dl_player + 0x2F8 + (unit_weap_slot * 0x4))

Instead of what your doing currently with this: 

local obj_ID = 0
if unit_weap_slot == 0 then
	obj_ID = read_dword(dl_player + 0x2F8) -- Primary
elseif unit_weap_slot == 1 then
	obj_ID = read_dword(dl_player + 0x2FC) -- Secondary
elseif unit_weap_slot == 2 then
	obj_ID = read_dword(dl_player + 0x300) -- Tertiary
elseif unit_weap_slot == 3 then
	obj_ID = read_dword(dl_player + 0x304) -- Quaternary
end


 

Edited by Devieth
For a change you could make.

Share this post


Link to post
Share on other sites

In regards to the vehicle reticles: do you mean the actual reticle for the vehicle weapons, or the little triangle on the hogs? 

Share this post


Link to post
Share on other sites
22 hours ago, Devieth said:

I was just thinking about righting this, but kept thing "haha ha, I'm to lazy hell no." Really cice, it is a little sensitive though.

 

Update: You could do this btw.


local obj_ID = read_dword(dl_player + 0x2F8 + (unit_weap_slot * 0x4))

Instead of what your doing currently with this: 


local obj_ID = 0
if unit_weap_slot == 0 then
	obj_ID = read_dword(dl_player + 0x2F8) -- Primary
elseif unit_weap_slot == 1 then
	obj_ID = read_dword(dl_player + 0x2FC) -- Secondary
elseif unit_weap_slot == 2 then
	obj_ID = read_dword(dl_player + 0x300) -- Tertiary
elseif unit_weap_slot == 3 then
	obj_ID = read_dword(dl_player + 0x304) -- Quaternary
end

 

I'm just going to leave this here and hope it's what you meant.

ally_reticle_enabler - Devieth Edit - v001.lua

Devieth and IceCrow14 like this

Share this post


Link to post
Share on other sites
4 hours ago, VoidsShadow said:

I'm just going to leave this here and hope it's what you meant.

ally_reticle_enabler - Devieth Edit - v001.lua


Yeah that't about it, I went in and make a much bigger change though myself which will make the crosshair color change be a bit more sensitive and accurate.

 

ally_retical_modified_by_devieth.lua

 

Video: 

Note: I did't add a distance limit here but it would be easy enough to add.
Note2: This will also work through walls.

IceCrow14, if you would like to look at the changes and officially add this to your script that would be cool.

Edited by Devieth
Added "Note2:"
IceCrow14 and (SBB) Storm like this

Share this post


Link to post
Share on other sites

@Sceny For none of them, actually. The script is meant to read and write to the 'child' object ID tag (the biped's weapon), and vehicles, if I recall correct are considered as 'parent' objects to the biped (even though it would be possible to upgrade the script to also manipulate vehicle HUDs).

 

@Devieth About your first post, you're right, that can save some lines of code (Thx for the syntax tips you wrote in the edited scripts, they may be useful for other proyects). The reason why with the main script the reticle is somewhat oversensitive is because what triggers the color change is an address that changes its value everytime a player's name is about to be displayed in the screen. Initially I thought about implementing the detection part the way you did in your second edit but I didn't want to mess with the math back then :P but it's great that you did because now it might be possible to improve the script to also detect when you're aiming at NPCs. Possibly implementing something that constantly performs 'collision checks' between the camera vector and the bipeds' in-game collision model would do the thing but I think I have no clue about how to do that yet.

 

PS: I'll add all the files that have been posted here in the main post.

Share this post


Link to post
Share on other sites
2 hours ago, IceCrow14 said:

@Sceny For none of them, actually. The script is meant to read and write to the 'child' object ID tag (the biped's weapon), and vehicles, if I recall correct are considered as 'parent' objects to the biped (even though it would be possible to upgrade the script to also manipulate vehicle HUDs).

 

@Devieth About your first post, you're right, that can save some lines of code (Thx for the syntax tips you wrote in the edited scripts, they may be useful for other proyects). The reason why with the main script the reticle is somewhat oversensitive is because what triggers the color change is an address that changes its value everytime a player's name is about to be displayed in the screen. Initially I thought about implementing the detection part the way you did in your second edit but I didn't want to mess with the math back then :P but it's great that you did because now it might be possible to improve the script to also detect when you're aiming at NPCs. Possibly implementing something that constantly performs 'collision checks' between the camera vector and the bipeds' in-game collision model would do the thing but I think I have no clue about how to do that yet.

 

PS: I'll add all the files that have been posted here in the main post.

You can do NPC's by looping though the tags when the map loads and save friendly MetaID's to a table.  The just do a `if friendly_metaIds[MetaID] then` style check to see if that MetaID is in the friendly_metaIds table.

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.