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

Easier way to auto adjust shaders for powerups.

broken avatar :(
Created 10 years ago
by ProGamerzFTW
0 Members and 1 Guest are viewing this topic.
1,335 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
In the stock scripts, they have an if/else if statement for every possible combination for powerups, how would I make it so it detects how many powerup shaders are active, and adjust accordingly?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 5 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
This code in the function "powerup_hud_overlay" handles the posititioning of the hud:
Code Snippet
Plaintext
for(i = 0; i < 2; i++)
{
level.powerup_hud[i] = create_simple_hud();
level.powerup_hud[i].foreground = true;
level.powerup_hud[i].sort = 2;
level.powerup_hud[i].hidewheninmenu = false;
level.powerup_hud[i].alignX = "center";
level.powerup_hud[i].alignY = "bottom";
level.powerup_hud[i].horzAlign = "center";
level.powerup_hud[i].vertAlign = "bottom";
level.powerup_hud[i].x = -32 + (i * 15);  // Figure 1
level.powerup_hud[i].y = level.powerup_hud[i].y - 35;
level.powerup_hud[i].alpha = 0.8;
//hud SetShader( shader_inst, 24, 24 );
}

Figure 1: This line handling width already handles having multiple shaders by multiplying i by 15. When adding a custom powerup you need to increase the amount in the for loop. Ex:
Code Snippet
Plaintext
for(i = 0; i < 3; i++)
This will add a new index for your new shader with the width already properly adjusted.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Spoiler: click to open...
Hmm I know that but, what I'm trying to do is make the shaders in the middle of my screen automatically move depending on how many powerup shaders are active.

The method you said just gives each powerup its own location on the screen and no matter how many powerups are active, the shader will always be in that spot (and it causes some overlapping issues).

Sure I accomplished this method before, but what I'm willing to do is make the shaders adjust depending on how many powerups are active, sort of the way the UGX mod does it for arcade mode (except it doesnt need the transition slide effect like UGX does when you get a second powerup) , where it knows how many powerups are active, and adjust accordingly while still staying towards the center of the screen (I have a total of 6 powerups with shaders).

If i wanted to do this the way WaW does it, there will be ALOT of else if statements that will take a long time to make for every possible powerup combination.

Edit. Solved.
Last Edit: April 01, 2014, 01:26:02 am by ProGamerzFTW

 
Loading ...