UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Hud Shader not working

HOT
broken avatar :(
Created 10 years ago
by Linoxet
0 Members and 1 Guest are viewing this topic.
11,697 views
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Okay, well since all other parts work I would assume that this one would work as well as far as the script is concerned. The script doesn't check if the image is undefined or anything like that though, so that could still be a thing to use to catch the issue.

This doesn't look like the entire script so I won't start fixing things, but one thing that can happen is If the kvp on whatever is self in this case, is not defined or the wrong kvp, you will still have an issue.

You can add this to your do_hud(shader) function to do some testing or look at the kvp in radiant:
Code Snippet
Plaintext
if(isdefined(shader)){
    iprintln(shader);
}else{
    iprintln("no shader was defined");
}

When the do_hud func is called the code prints "power_panel", the shader name.
What the hell am I missing? I've checked everything a lot of times :v

I can post the full code, if that helps.
Last Edit: February 19, 2016, 06:28:47 pm by Linoxet
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I think your gonna need an old priest and a young priest, cause I am out of ideas.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
Pretty sure this:

   hud.alignX = "middle";

should be:

   hud.alignX = "center";

For the x coord use "center" and for the y use "middle", at least that's how it is in treyarch scripts.. Not sure if it really make's a difference. And the same goes for "hud.horzAlign ", but it dosen't make sense why it would work with other shaders then.
Is this one Always the first part that is picked up?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
That is true ^, and I lied, I have one more idea, do his fix and try this:

Code Snippet
Plaintext
do_hud(shader)
{
        shader = "power_panel";
part_hud = [];

This should make them all default texture if the material/image is still not getting in. But if it works, then we know it is something else.

Edit, I am sure we asked this before, but the iwi is checked when you build your mod right? If you open your iwd and look into the images folder, it's there right?
Last Edit: February 19, 2016, 06:50:59 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Pretty sure this:

   hud.alignX = "middle";

should be:

   hud.alignX = "center";

For the x coord use "center" and for the y use "middle", at least that's how it is in treyarch scripts.. Not sure if it really make's a difference. And the same goes for "hud.horzAlign ", but it dosen't make sense why it would work with other shaders then.
Is this one Always the first part that is picked up?

Nope

That is true ^, and I lied, I have one more idea, do his fix and try this:

Code Snippet
Plaintext
do_hud(shader)
{
        shader = "power_panel";
part_hud = [];

This should make them all default texture if the material/image is still not getting in. But if it works, then we know it is something else.

Edit, I am sure we asked this before, but the iwi is checked when you build your mod right? If you open your iwd and look into the images folder, it's there right?

Will try that, and yes, it's there

Double Post Merge: February 19, 2016, 06:58:28 pm
Still missing image, even with the shader "really" defined :v
Edit: I'll try a pact with Satan or something like that and will come back to this later, really thanks for the help :P

Double Post Merge: February 19, 2016, 07:39:34 pm
Ok, I think I got something now.
I changed the kvp in radiant to a random shader just for testing, and probably there's something wrong with my script.
Now the "power_panel" works, but the "power_hand" not  :please:
Last Edit: February 19, 2016, 07:39:34 pm by Linoxet
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha

I changed the kvp in radiant to a random shader just for testing, and probably there's something wrong with my script.
Now the "power_panel" works, but the "power_hand" not  :please:

Crazy, you gonna post the script?
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
I'm new at this, there should be a lot of bad things...

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_anim;
#include maps\_hud_util;

main()
{
precacheShader("power_panel");
precacheShader("power_handle");
precacheShader("power_hand");

level.power_build = 0;

level thread triggers_start();

level thread build_power();

}

do_hud(shader)
{
if(isdefined(shader))
{
    iprintln(shader);
}
else
{
    iprintln("no shader was defined");
}

part_hud = [];

hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "middle";
hud.alignY = "bottom";
hud.horzAlign = "middle";
hud.vertAlign = "bottom";
hud.x = part_hud.size * 45;
hud.y = hud.y - 80;
hud.alpha = 1;
hud SetShader( shader, 40, 40 );
self.part_hud[ shader ] = hud;

self.hud_part = hud;

}

triggers_start()
{
flag_wait ("all_players_connected");

players = get_players();
for(i=0;i<players.size;i++)
{
players[i].part = "none";
//players[i].part_hud = [];
}

trigs = GetEntArray("buildable_pick_trig", "targetname");

for (i=0; i<trigs.size; i++)
{
trigs[i] thread triggers_think();
}
}

triggers_think() //do random spawn for parts?
{
part = GetEnt(self.target, "targetname");

self SetHintString( "Pressione ^3[&&1] ^7para Pegar Parte");
self SetCursorHint( "HINT_NOICON" );

while(1)
{
self waittill("trigger", player);

if (player.part != "none")
{
/# player iprintln("Ja possui uma Parte!"); #/
}
else
{
if( is_player_valid( player ))
{
player.part = self.script_noteworthy;
/# player iprintln("Pegou " + player.part); #/
self delete();
part delete();
player do_hud(player.part);
player play_sound_on_entity("part_pick");
break;
}
}
wait 0.3;
}
}

build_power()
{
trig = GetEnt("trigger_build_energy", "targetname");

power_trig = GetEnt("turn_on_power", "targetname");
power_trig disable_trigger();

panel = GetEnt("buildable_panel_build", "targetname");
panel hide();

handle = GetEnt("buildable_handle_build", "targetname");
handle hide();

hand = GetEnt("buildable_hand_build", "targetname");
hand hide();

trig SetHintString( "Pressione ^3[&&1] ^7para montar parte" );
trig SetCursorHint( "HINT_NOICON" );

while(1)
{
if (level.power_build == 3)
{
break;
}

trig waittill("trigger", player);

if (player.part == "none")
{
player iprintln("Requer Partes!");
}

if (player.part == "power_panel")
{
player thread build_part(panel, trig);
player.added = false;
wait 3.1;

if (level.power_build == 3)
{
player play_sound_on_entity("part_done");
level thread energy_ready();
trig delete();
break;
}
}

if (player.part == "power_handle")
{
player thread build_part(handle, trig);
player.added = false;
wait 3.1;

if (level.power_build == 3)
{
player play_sound_on_entity("part_done");
level thread energy_ready();
trig delete();
break;
}
}

if (player.part == "power_hand")
{
player thread build_part(hand, trig);
player.added = false;
wait 3.1;

if (level.power_build == 3)
{
player play_sound_on_entity("part_done");
level thread energy_ready();
trig delete();
break;
}
}
wait 0.5;
}
}

build_part(part, trigger)
{
self playsound("part_build");
self do_progress_bar(3, trigger, part);


/*self thread wait_until(part, trigger);

self waittill("part_added");
iprintln("waittill part_added gotcha");

part show();
//wait 0.1;
self.part = "none";

if (part.script_noteworthy == "power" && self.added == true)
{
self.added = false;
level.power_build++;
iprintln("power is " + level.power_build +"/3");
}*/
}

/*wait_until(parte)
{
self waittill("part_added");
iprintln("waittill part_added gotcha");

parte show();
//wait 0.1;
self.part = "none";

if (parte.script_noteworthy == "power" && self.added == true)
{
self.added = false;
level.power_build++;
iprintln("power is " + level.power_build +"/3");
}
}*/

part_is_added(model)
{
model show();
//wait 0.1;
self.part = "none";
self.hud_part destroy_hud();

if (model.script_noteworthy == "power" && self.added == true)
{
self.added = false;
level.power_build++;
/# iprintln("power is " + level.power_build +"/3"); #/
}
}

energy_ready()
{
handle = GetEnt("buildable_handle_build", "targetname");
hand = GetEnt("buildable_hand_build", "targetname");

power_trig = GetEnt("turn_on_power", "targetname");
power_trig enable_trigger();
power_trig SetHintString( "Pressione ^3[&&1] ^7para ligar a energia!" );
power_trig SetCursorHint( "HINT_NOICON" );
power_trig UseTriggerRequireLookAt();

power_trig waittill("trigger");

handle MoveZ (10.5, 0.8);
hand MoveZ (10.5, 0.8);
//playfx(level._effect["wire_sparks_oneshot"], handle.origin );

power_trig delete();

flag_set("electricity_on");

level notify("sleight_on");
level notify("juggernog_on");
level notify("Pack_A_Punch_on");
}

do_progress_bar(time, trig, parte) //thanks a lot MakeCents (https://ugx-mods.com/forum/index.php/topic,8139.msg87763.html#msg87763)
{
//self freezeControls(true);
self.stop = false;
self thread crack_knuckles();

self.PBar = self CreatePrimaryProgressBar();
self.PBar.color = ( .5, 1, 1 );
self.PBar UpdateBar( 0.01, 1/time ); //1/time

while( self UseButtonPressed() && distance(self.origin, trig.origin)<100 && self isOnGround() && !self maps\_laststand::player_is_in_laststand() && time >= 0)
{
wait(.1);
time = time - 0.1;

if (time == 0)
{
self.added = true;
self freezeControls(false);
self.PBar destroyElem();
self.PBar = undefined;
//self notify("part_added");
/# iprintln("i've added a part"); #/
self thread part_is_added(parte);
break;
}
}

self freezeControls(false);
self.PBar destroyElem();
self.PBar = undefined;
self.stop = true;
}

crack_knuckles()
{

self DisableOffhandWeapons();
self DisableWeaponCycling();

self AllowLean( false );
self AllowAds( false );
self AllowSprint( false );
self AllowProne( false );
self AllowMelee( false );

if ( self GetStance() == "prone" )
{
self SetStance( "crouch" );
}

gun = self GetCurrentWeapon();

weapon = "zombie_knuckle_crack";
self GiveWeapon( weapon );
self SwitchToWeapon( weapon );

while(1)
{
if (self.stop == true)
{
self EnableOffhandWeapons();
self EnableWeaponCycling();

self SwitchToWeapon( gun );

self AllowLean( true );
self AllowAds( true );
self AllowSprint( true );
self AllowProne( true );
self AllowMelee( true );
//return gun;
self.stop = false;
}
wait .05;
}

self waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
self EnableOffhandWeapons();
self EnableWeaponCycling();

self SwitchToWeapon( gun );

self AllowLean( true );
self AllowAds( true );
self AllowSprint( true );
self AllowProne( true );
self AllowMelee( true );
//return gun;

}

Edit: Instead of checking level.power_build  on each "if (part == "bla")" I realized I could just put it on the bottom, and use "else if (part == "bla")"... Lol, just noticed that now
Last Edit: February 19, 2016, 08:10:17 pm by Linoxet
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Don't know if this has anything to do, but...
Code Snippet
Plaintext
do_hud(shader)
{
part_hud = [];

hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "middle";
hud.alignY = "bottom";
hud.horzAlign = "middle";
hud.vertAlign = "bottom";
hud.x = part_hud.size * 45;
hud.y = hud.y - 80;
hud.alpha = 1;
hud SetShader( shader, 40, 40 );
self.part_hud[ shader ] = hud;

self.hud_part = hud;

}
... you're defining part_hud[] as a "normail" variable, not as property of the player (self). Then, you associate "hud" to an unexisting property of self. So part_hud.size will always be 0, because you define it every time you call the function.
I don't think this is going to fix anything at all, but it should be something like:
Code Snippet
Plaintext
do_hud(shader)
{
        if( !isDefined( self.part_hud ) // <- changes here
    self.part_hud = []; // <- changes here

hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "middle";
hud.alignY = "bottom";
hud.horzAlign = "middle";
hud.vertAlign = "bottom";
hud.x = self.part_hud.size * 45; // <- changes here
hud.y = hud.y - 80;
hud.alpha = 1;
hud SetShader( shader, 40, 40 );
self.part_hud[ shader ] = hud;

self.hud_part = hud;

}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
The hud part doesn't matter, cause he ends up just self.hud_part = hud;, but I do think that maybe something is happening and the default texture may be being put on top of the other textures maybe, possibly related to what soy said, where your not really using the array, and you seem to just keep putting them in the same place? What do you think soy?

Maybe if he gets it to spread out he will see he that the images are working but that he is threading more than he should? I don't know, it's tough to see a reason for it.
Last Edit: February 19, 2016, 08:50:04 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Don't know if this has anything to do, but...

... you're defining part_hud[] as a "normail" variable, not as property of the player (self). Then, you associate "hud" to an unexisting property of self. So part_hud.size will always be 0, because you define it every time you call the function.

I edited the script and forgot to put "self.part_hud" back, sorry

Edit: I just edited a bit this hud func from a tutorial script, I don't know much about hud.
Last Edit: February 19, 2016, 08:54:34 pm by Linoxet
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
The hud part doesn't matter, cause he ends up just self.hud_part = hud;, but I do think that maybe something is happening and the default texture may be being put on top of the other textures maybe, possibly related to what soy said, where your not really using the array, and you seem to just keep putting them in the same place? What do you think soy?

Maybe if he gets it to spread out he will see he that the images are working but that he is threading more than he should? I don't know, it's tough to see a reason for it.
Haven't read everything of the topic, but I understood he gets that squared default texture. But there's no relation between the place the images are put and having the default texture. It's likely that it appears on top of other images but not that it appears with that texture. :-\
No idea. :(
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Haven't read everything of the topic, but I understood he gets that squared default texture. But there's no relation between the place the images are put and having the default texture. It's likely that it appears on top of other images but not that it appears with that texture. :-\
No idea. :(

My idea was to destroy that image with this line self.hud_part destroy_hud(); when the part is added, and it actually works, the hud is destroyed or is just hidden and every image is being put on top of each other?

 
Loading ...