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
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..
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
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
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?
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 )
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 )
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?
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.
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 )
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