Raised This Month: $51 Target: $400
 12% 

VSH VSH, old thread (v1.42) - Information/etc.


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Wliu
Veteran Member
Join Date: Apr 2013
Old 03-01-2014 , 18:09   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4191

^My first post here-you should also check to see if Monoculus/etc. is spawned, and if so, give the healthbar to them.
__________________
~Wliu
Wliu is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 03-01-2014 , 18:57   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4192

Quote:
Originally Posted by Wliu View Post
^My first post here-you should also check to see if Monoculus/etc. is spawned, and if so, give the healthbar to them.
the tutorial is for saxton only servers, or whatever.
__________________
nergal is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 03-01-2014 , 19:15   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4193

Quote:
Originally Posted by nergal View Post
the tutorial is for saxton only servers, or whatever.
Doesn't mean you can't spawn Monoculus on VSH servers (unless there's a specific check for that?).
__________________
~Wliu

Last edited by Wliu; 03-01-2014 at 19:15.
Wliu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-02-2014 , 05:26   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4194

For the Horsemann Healthbar...

Unlike FF2, VSH should have all the necessary natives to write this as a separate plugin. The major problem with FF2 was that it supports multiple bosses at once, but there's no way to fetch the max health for each boss.

This is completely untested, but I adapted the Horsemann Healthbar 1.4 code and attached it. (Actually, why isn't 1.4 posted to the Horsemann Healthbar thread?)

Incidentally, you don't have to cede control to the real Halloween bosses. If you've ever used the Monoculus or Merasmus spawner plugins, you know that Valve just blindly updates the monster_resource bars and the healthbar reflects whichever one was the last one to take damage.
Attached Files
File Type: sp Get Plugin or Get Source (vsh_healthbar.sp - 132 views - 2.7 KB)
File Type: smx vsh_healthbar.smx (4.9 KB, 140 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-02-2014 at 05:26.
Powerlord is offline
darkboy245
Senior Member
Join Date: Feb 2014
Old 03-02-2014 , 08:49   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4195

Quote:
Originally Posted by Powerlord View Post
For the Horsemann Healthbar...

Unlike FF2, VSH should have all the necessary natives to write this as a separate plugin. The major problem with FF2 was that it supports multiple bosses at once, but there's no way to fetch the max health for each boss.

This is completely untested, but I adapted the Horsemann Healthbar 1.4 code and attached it. (Actually, why isn't 1.4 posted to the Horsemann Healthbar thread?)

Incidentally, you don't have to cede control to the real Halloween bosses. If you've ever used the Monoculus or Merasmus spawner plugins, you know that Valve just blindly updates the monster_resource bars and the healthbar reflects whichever one was the last one to take damage.
Your plugin doesn't work. it does show the health bar but when u hit the hale at the first time the bar just goes right down like the hale has 1HP but he actually doesn't have 1 HP

Last edited by darkboy245; 03-02-2014 at 11:20.
darkboy245 is offline
darkboy245
Senior Member
Join Date: Feb 2014
Old 03-02-2014 , 09:14   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4196

Quote:
Originally Posted by nergal View Post
Here's your tutorial!

How to add FF2-style Monoculus Healthbar (props to Powerlord since this is ripped from his plugin)

In the function OnMapStart() add this piece of code anywhere inside the function

PHP Code:
    FindHealthBar(); 
after that, add this global variable+function anywhere in the plugin as long as it doesn't interfere with other functions

PHP Code:
new g_healthBar = -1;
FindHealthBar() 

    
g_healthBar FindEntityByClassname2(-1"monster_resource"); 
     
    if (
g_healthBar == -1
    { 
        
g_healthBar CreateEntityByName("monster_resource"); 
        if (
g_healthBar != -1
        { 
            
DispatchSpawn(g_healthBar); 
        } 
    } 

the code above simply adds the healthbar, now we gotta make it work.

add this function anywhere in the plugin, as long as it doesn't interfere with other functions

PHP Code:
public UpdateBossHealth(client

    new 
halebar
    if (
IsValidClient(client)) 
    { 
        if (
HaleHealthMax <= 0
        { 
            
halebar 0
        } 
        else 
        { 
            
halebar RoundToCeil(float(HaleHealth) / HaleHealthMax 255); 
        } 
    } 
    else 
    { 
        
halebar 0
    } 
    
SetEntProp(g_healthBarProp_Send"m_iBossHealthPercentageByte"halebar); 

That should get the healthbar to work Now there's two choices to make. Do you want the health bar to dynamically update by itself? OR Have the health bar update only when checking Hale/Boss health?

IF you want the health bar to update itself. Simply put this code inside the function
PHP Code:
public Action:HaleTimer(Handle:hTimer
When you've located that function, this is code in it. Remember to put it somewhere that doesn't interfere with the rest of the code.
PHP Code:
    UpdateBossHealth(Hale); 
OR

If you want the health bar to update only from Health Checking, then find the following function
PHP Code:
public Action:Command_GetHP(client
After you've located it, put the UpdateBossHealth(Hale); code twice inside the function. For best results, place it the 1st one under client == Hale and switch Special
like this
OLD
PHP Code:
    if (client == Hale)
    {
        switch (
Special)

        { 
NEW
PHP Code:
if (client == Hale)
    {
        
UpdateBossHealth(Hale);
        switch (
Special)
        { 
After you've done that, place the second function check under
PHP Code:
    if (GetGameTime() >= HPTime
for example, like this!
PHP Code:
    if (GetGameTime() >= HPTime)
    {
        
UpdateBossHealth(Hale);
        
healthcheckused++;
        switch (
Special)
        { 
end tutorial!
Seems like I did everything right. the problem is when first round starts, there is no health bar.
second round there is an health bar, but it gives the hales hp from the last round.
example: first round hale had 1 hp, i slayed him, second round we see the health bar with 1 HP in it.
third round we don't see nothing.
darkboy245 is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 03-02-2014 , 10:38   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4197

Quote:
Originally Posted by darkboy245 View Post
Seems like I did everything right. the problem is when first round starts, there is no health bar.
second round there is an health bar, but it gives the hales hp from the last round.
example: first round hale had 1 hp, i slayed him, second round we see the health bar with 1 HP in it.
third round we don't see nothing.
if that's happening, you didn't do everything right :\
__________________
nergal is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-02-2014 , 11:55   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4198

Quote:
Originally Posted by darkboy245 View Post
Your plugin doesn't work. it does show the health bar but when u hit the hale at the first time the bar just goes right down like the hale has 1HP but he actually doesn't have 1 HP
Hmm... honestly, I'm not sure what it's doing wrong. I'm not running a VSH server so I can't easily debug this.

Could be a logic bug in my code or it could be that VSH isn't returning the proper numbers for its VSH_GetSaxtonHaleHealthMax() and VSH_GetSaxtonHaleHealth() natives.

Edit: Actually, here... try this debug version, which prints what the current numbers are whenever damage happens to Hale.
Attached Files
File Type: sp Get Plugin or Get Source (vsh_healthbar.sp - 93 views - 2.8 KB)
File Type: smx vsh_healthbar.smx (5.2 KB, 95 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-02-2014 at 11:57.
Powerlord is offline
darkboy245
Senior Member
Join Date: Feb 2014
Old 03-02-2014 , 13:06   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4199

Quote:
Originally Posted by Powerlord View Post
Hmm... honestly, I'm not sure what it's doing wrong. I'm not running a VSH server so I can't easily debug this.

Could be a logic bug in my code or it could be that VSH isn't returning the proper numbers for its VSH_GetSaxtonHaleHealthMax() and VSH_GetSaxtonHaleHealth() natives.

Edit: Actually, here... try this debug version, which prints what the current numbers are whenever damage happens to Hale.
The debug is fine, the health bar still isn't. it just starts with 1HP, I looked at the code but didn't see anything strange
darkboy245 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-02-2014 , 22:07   Re: VS Saxton Hale Mode, main thread (current v1.42)
#4200

Quote:
Originally Posted by darkboy245 View Post
The debug is fine, the health bar still isn't. it just starts with 1HP, I looked at the code but didn't see anything strange
Turns out that percents work a lot better when I pass them consistently instead of sometimes passing 100.0 as 100% and sometimes 1.0 as 100%...

This new version should work, although I still haven't added code for late loading to it (so it won't take effect until round change).
Attached Files
File Type: smx vsh_healthbar.smx (4.9 KB, 1045 views)
File Type: sp Get Plugin or Get Source (vsh_healthbar.sp - 617 views - 2.8 KB)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-02-2014 at 22:08.
Powerlord is offline
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode