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 assign a certain number for a action?

HOT
broken avatar :(
Created 9 years ago
by Dust
0 Members and 1 Guest are viewing this topic.
4,898 views
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
How would I assign a specific action to a certain number that the players must hit?

For example, say they pick something up and it shows up in their HUD, and its something they can use. How would I script it so when they press that button it uses it? It is not a weapon btw so I cant set it up like a weapon
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community 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.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
dont think you can tbh. You can check for some buttons like meleebuttonpressed() and attackbuttonpressed() and then there's the action-slots you can assign, but since you said it's not a weapon that might not be usefull.
Other then that i think you can only check for a few controller-inputs ( seen PWN and Harry mention that in some post i think ), and buttons pressed by the host.

I've been looking at this a few time's b4, and couldn't find any other ways of doing this..

broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
dont think you can tbh. You can check for some buttons like meleebuttonpressed() and attackbuttonpressed() and then there's the action-slots you can assign, but since you said it's not a weapon that might not be usefull.
Other then that i think you can only check for a few controller-inputs ( seen PWN and Harry mention that in some post i think ), and buttons pressed by the host.

I've been looking at this a few time's b4, and couldn't find any other ways of doing this..

Dang that sucks, been making a script to "store" a powerup for future use but if I cant make it so the players can press a number to "use" it then i dont know how else to do it. :/

I know about the setactionslot but if you have to use a weapon for that then i cant use that

Last Edit: March 19, 2015, 06:19:15 pm by thezombiekilla6
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
guess you could make a weaponfile that represents the powerup, and when 'fired' you trigger the powerup. Should work, just a bit more scripting maybe, but dont we all love scripting  :) :)
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
guess you could make a weaponfile that represents the powerup, and when 'fired' you trigger the powerup. Should work, just a bit more scripting maybe, but dont we all love scripting  :) :)

I was also thinking doing what Quizz did in TMG castle with the skip break, but that only works when the host presses it so that wouldnt really be ideal.

If I was going to do what you suggested, how would I go about doing it?
Marked as best answer by thezombiekilla6 9 years ago
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
I was also thinking doing what Quizz did in TMG castle with the skip break, but that only works when the host presses it so that wouldnt really be ideal.

If I was going to do what you suggested, how would I go about doing it?

Kinda depends on how you stored the powerup to the player maybe. But something like this could work:
-make the weaponfile, and find / make some anims that dont look weird / go with your idea.
-assign it to a actionslot etc
- make a script that checks if the player is holding that weapon ( could just use getcurrentweapon in a loop prob )
-as soon as he does take it away and activate the stored powerup

so basicly you dont really use the weaponfile, just check for it in the script, and take it away ( if you do that quick enough you prob dont even need anims to go with it )

broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Kinda depends on how you stored the powerup to the player maybe. But something like this could work:
-make the weaponfile, and find / make some anims that dont look weird / go with your idea.
-assign it to a actionslot etc
- make a script that checks if the player is holding that weapon ( could just use getcurrentweapon in a loop prob )
-as soon as he does take it away and activate the stored powerup

so basicly you dont really use the weaponfile, just check for it in the script, and take it away ( if you do that quick enough you prob dont even need anims to go with it )

Thanks, will try that when I have time later!

Gave you best answer ;)
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
 :)   would even be better if someone came in and proved me wrong though. Would be nice if it is possible..

Anyways, lemme know if it worked out
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
So far I have
Code Snippet
Plaintext
    self setactionslot(3,"weapon","powerup_inventory");
players = get_players();
for (i = 0; i < players.size; i++)
{
        while( self GetCurrentWeapon() == "powerup_inventory")
{
wait .2;
                      //Rest of code
}
}

But it is not working. I have it threaded on the players whenever they pick up the powerup to run this code and wait for the weapon to be brought out, in this case powerup_inventory. But whenever I press 3 it does nothing. Am I doing something wrong?
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Try this, not really sure why you're checking all players? Can they all use it?
This example only checks the player that you gave the powerup-weapon:

Code Snippet
Plaintext
player_give_powerup()
{
self giveweapon("powerup_inventory");
self setactionslot(3,"weapon","powerup_inventory");
self setweaponammostock("powerup_inventory",1);

self thread powerup_equiped();
}

powerup_equiped()
{
self endon( "death" );
self endon( "disconnect" );

while(1)
{
self waittill( "weapon_change_complete" );
if( self getcurrentweapon() == "powerup_inventory" )
{
self thread player_use_stored_powerup();             //   your script from here on
break;
}
}
}
Last Edit: March 19, 2015, 11:03:33 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Try this, not really sure why you're checking all players? Can they all use it?
This example only checks the player that you gave the powerup-weapon:

Code Snippet
Plaintext
player_give_powerup()
{
self giveweapon("powerup_inventory");
self setactionslot(3,"weapon","powerup_inventory");
self setweaponammostock("powerup_inventory",1);

self thread powerup_equiped();
}

powerup_equiped()
{
self endon( "death" );
self endon( "disconnect" );

while(1)
{
self waittill( "weapon_change_complete" );
if( self getcurrentweapon() == "powerup_inventory" )
{
self thread player_use_stored_powerup();             //   your script from here on
break;
}
}
}

Tried it and still doesn't work. When I pick up the powerup it comes up at the bottom of the screen with a 4 in brackets which I am guessing is the button to press, which doesnt make much sense since its set to 3. Tried all the numbers and still doesnt do anything.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Think you need to set inventorytype to item in the weaponfile, forgot to mention that. srry

also make sure you load that weapon-file like any other, so in mod.csv / zombiemode_weapons and dlc3_code etc..
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Think you need to set inventorytype to item in the weaponfile, forgot to mention that. srry

also make sure you load that weapon-file like any other, so in mod.csv / zombiemode_weapons and dlc3_code etc..

Already had the inventorytype set to item and it is loaded in all 3 gscs but it still isnt working
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 7 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha

(offhandClass inventoryType main factors)
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Mine is set up the same exact way but it still isnt working.

Figured it out, apparently the weapon file didnt like that I used no model/anim file in the weapons file so I had to quickly add some anims for it for right now until I get time to make some. Right now, its using the max ammo model with the perkacola anims(looks funny seeing him try to drink the max ammo :lol:)

Anyway, one more quick problem and I should have this script mostly done. Is there a way to move the [5] over to the right hand side(where the shader is) and delete the checkerboard from showing up in game? Like in this picture.



Side note, why is it that I have to press 5 in game for it to work when in the script its set to actionslot 3?
Last Edit: March 20, 2015, 05:16:45 am by thezombiekilla6

 
Loading ...