Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show focus information (healthbar and name) #12

Closed
szapp opened this issue Aug 16, 2016 · 4 comments
Closed

Show focus information (healthbar and name) #12

szapp opened this issue Aug 16, 2016 · 4 comments

Comments

@szapp
Copy link
Owner

szapp commented Aug 16, 2016

Show the healthbar and focus name of NPCs that is being aimed at (and only as long as they are being aimed at!). The focus collection (from Focus.d) does not free the focused NPCs. Thus, another possibility would be to shoot a trace ray and if the intersection polygon is an NPC show their healthbar (how?).

@szapp
Copy link
Owner Author

szapp commented Aug 18, 2016

Idea

Set focus collection to a small angle. During aiming check if focus vob is in a narrow angle (oCNpc::GetAngle) in front of the player model (center is [0.5, 0.5]). If the current focus vob is not in that angle, clear focus vob. Remaining question: Will the focus collections (Focus.d) then continuously set the new (correct) focus vob?

This approach is not satisfying. It is, however, available in the branch focusbyangles.

@szapp
Copy link
Owner Author

szapp commented Aug 18, 2016

Improve trace ray

  • Exclude origin vob (hero)
  • Set flags to (zTRACERAY_VOB_IGNORE_NO_CD_DYN | zTRACERAY_VOB_BBOX) (1 + 4 = 5), or (zTRACERAY_VOB_IGNORE_NO_CD_DYN | zTRACERAY_VOB_BBOX | zTRACERAY_STAT_POLY | zTRACERAY_POLY_NORMAL) (1 + 4 + 32 + 128 = 165)
  • Check if trace ray changes input arguments (vectors)
  • Experiment with zTBBox3D::GetSphere3D and zTBSphere3D::IsIntersecting

@szapp
Copy link
Owner Author

szapp commented Aug 19, 2016

This here does not give any results (always returns zero) and does really make sense to me anyways:

const int zTBBox3D__GetSphere3D = 5528768; //0x545CC0
CALL_RetValIsStruct(24); // sizeof_zTBBox3D
CALL__thiscall(_@(her)+124, zTBBox3D__GetSphere3D); // zTBBox3D
var int sphere3d1; sphere3d1 = CALL_RetValAsInt();
CALL_RetValIsStruct(24); // sizeof_zTBBox3D
CALL__thiscall(MEM_World.foundVob+124, zTBBox3D__GetSphere3D);
var int sphere3d2; sphere3d2 = CALL_RetValAsInt();

const int zTBSphere3D__IsIntersecting = 5521632; //0x5440E0
CALL_PtrParam(sphere3d2);
CALL__thiscall(sphere3d1, zTBSphere3D__IsIntersecting);
var int answ; answ = CALL_RetValAsInt();
MEM_Free(sphere3d1);
MEM_Free(sphere3d2);

MEM_Info(ConcatStrings("Sphere test returns: ", IntToString(answ)));

@szapp
Copy link
Owner Author

szapp commented Oct 13, 2016

Fix #12 set focus vob by bounding box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant