Author Topic: Get critter info over mouse and onhead via client module  (Read 5001 times)

Offline adumbperson

  • Turn around in orbit!
Get critter info over mouse and onhead via client module
« on: July 17, 2016, 02:33:14 pm »
Hello, I have made another module using methods from vault112 to show some critter info over the mouse and onhead.
vault112 were using loop() dangerously as FODE and maybe others.
I think the best place for that kind of need, is to attach a callback to some gui interface methods from the *screen* you want to work in...
but be aware that it's called a lot.
For mousemove it throws the function each times you moves your mouse on the right active screen.
For Draw func it throws the function all the times the screen is active!

https://gist.github.com/anonymous/bd7682b2fb6346f64821309a4c097884
Used cpp extension for syntax colors.

If you have Questions or critics, don't hesitate.
« Last Edit: July 17, 2016, 02:43:43 pm by adumbperson »
The Death After Life.
About me. I hate people generally I still may have respectful talk and recognize the good persons. Careful to what you say, I'm not a kid. My experiences defines me.
[Awaxx] -2024/10/17-

Offline adumbperson

  • Turn around in orbit!
Re: Get critter info over mouse and onhead via client module
« Reply #1 on: July 18, 2016, 01:05:59 am »
Let's call this one v2 : https://gist.github.com/anonymous/f9cf38cdc5baf5d144daaea3c52c839c

It's now comparing critters array for changes... and update in case there is changes.

ouppps forgot that too into client_main.fos
Code: [Select]
void critter_in( CritterCl& cr )
{
    if (cr.IsNpc())
        cr.NameOnHead = "";
}

CompareCritters() is wrong... you must rework dis yourself!
without using it I keep same perf than when I don't use the module at all, so it looks pointless to use CompareCritters() to me....
« Last Edit: July 18, 2016, 04:03:37 am by adumbperson »
The Death After Life.
About me. I hate people generally I still may have respectful talk and recognize the good persons. Careful to what you say, I'm not a kid. My experiences defines me.
[Awaxx] -2024/10/17-

Offline adumbperson

  • Turn around in orbit!
Re: Get critter info over mouse and onhead via client module
« Reply #2 on: July 22, 2016, 04:26:00 pm »
 ::)

Well I knew from beginning it wasn't the right way to proceed. Then shared some code here to talk about it...
While that time I reworked all of this with the Wipe's helps to end with it done a better way.

https://gist.github.com/anonymous/be154008845580219982adc33db9279a

 ;D
The Death After Life.
About me. I hate people generally I still may have respectful talk and recognize the good persons. Careful to what you say, I'm not a kid. My experiences defines me.
[Awaxx] -2024/10/17-

Offline adumbperson

  • Turn around in orbit!
Re: Get critter info over mouse and onhead via client module
« Reply #3 on: July 24, 2016, 02:13:46 am »
The Death After Life.
About me. I hate people generally I still may have respectful talk and recognize the good persons. Careful to what you say, I'm not a kid. My experiences defines me.
[Awaxx] -2024/10/17-

Offline adumbperson

  • Turn around in orbit!
Re: Get critter info over mouse and onhead via client module
« Reply #4 on: July 24, 2016, 10:12:14 pm »
This commit => "The Last Iteration."  8)

I'm finally happy with that. It works very well!
Let's talk a bit from the module :
- Show/hide Player name on heads
- Show/hide Npc name on heads.
- Show/hide player and npc health info in a way your opponents sees if you feel good or wounded... not your amount of HealthPoints....
- Automatic critter information over mouse cursor. Awarness let you see the weapon and armor (in futur I want this to Show bonuses from weapon & armor by coloring the output.)

https://gist.github.com/anonymous/fe2dbba76fc0e35f3ad63370a22c9c8b


The Death After Life.
About me. I hate people generally I still may have respectful talk and recognize the good persons. Careful to what you say, I'm not a kid. My experiences defines me.
[Awaxx] -2024/10/17-

Offline Slowhand

  • Go for the eyes, Boo! Go for the eyes!
Re: Get critter info over mouse and onhead via client module
« Reply #5 on: July 25, 2016, 02:32:01 am »
Hey, I checked repo, why did you name script files cpp extension? Aren't those .fos files?

Offline adumbperson

  • Turn around in orbit!
Re: Get critter info over mouse and onhead via client module
« Reply #6 on: September 10, 2016, 04:32:17 pm »
Hey, I checked repo, why did you name script files cpp extension? Aren't those .fos files?

Hey Slowhand, I did use cpp because github doesn't have AngelScript syntax color...
The Death After Life.
About me. I hate people generally I still may have respectful talk and recognize the good persons. Careful to what you say, I'm not a kid. My experiences defines me.
[Awaxx] -2024/10/17-