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

how to make a custom powerup?

broken avatar :(
Created 11 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
1,826 views
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
I would like to make a custom powerup that only affects the player who picks it up. All the tutorials i have seen affect everyone not just one person
Marked as best answer by Deleted User 10 years ago
broken avatar :(
×
broken avatar :(
Location: 00
Date Registered: 14 March 2012
Last active: 4 years ago
Posts
170
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
zNiiC's Groups
zNiiC's Contact & Social LinkszNiiCRAiiDz
Im guessing those tutorials have some sort of for loop like

for(int k = 0; k++)
{
 players[k] = give powerup;
}

Instead, i think you have to define players as undefined and whoever picks up the powerup, you set them to player and give to self
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
How?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
In the powerup_grab() function, where you call your powerup's code (similar to that):
Code Snippet
Plaintext
case "mypowerup":
    level thread my_powerup_code(self);
    break;
Here you can give the player that collected the drop as the second argument:
Code Snippet
Plaintext
case "mypowerup":
    level thread my_powerup_code(self, players[i]);
    break;
And your powerup function will look like that:
Code Snippet
Plaintext
my_powerup_code(powerup, player)
{
    // Do something with player
    player iPrintLnBold("Lol, nothing happened");
}

- Phil.
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: al
Date Registered: 21 August 2011
Last active: 10 days ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social Links
maybe this can help you a little: http://ugx-mods.com/forum/index.php?topic=296.0

if you got a problem please tell me

 
Loading ...