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 would I go about making an M1216 weapon file?

HOT
broken avatar :(
Created 11 years ago
by lilrifa
0 Members and 1 Guest are viewing this topic.
14,731 views
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 3 years ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linkslilrifaskypeuser724lilrifa
Okay, I got it to work the way I was saying. The one time it didn't work was when I forgot to include the second weapon file in my mod.csv, lol, doh!

It still plays the pullout anim after finishing.
https://www.youtube.com/watch?v=thpflOvOF4I&feature=youtu.be
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
It still plays the pullout anim after finishing.
http://www.youtube.com/watch?v=thpflOvOF4I&feature=youtu.be

Yeah, that's the one anim you will have to tweak so it starts closer to where the spin anim ends, or not use that raise anim. Sorry, my way is fairly simple, but it has that one drawback.

So if that is the anim you will use, pulling from up above, just raise the gun to spin the barrels, and then when the raise anim plays it will bring it back down. If the raise anim you will use comes from the bottom, then pull the gun down and in as you spin the barrel, and then it will raise it back up and out, you see? I don't know another way.
Last Edit: June 20, 2015, 03:49:54 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 3 years ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linkslilrifaskypeuser724lilrifa
Ahh. Well, thanks for that. Could you explain BluntStuffy's way? I didn't quite understand it?
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
Ahh. Well, thanks for that. Could you explain BluntStuffy's way? I didn't quite understand it?

I think he is saying to only have one bullet in the clip at all times. While it is not time to rechamber, after the first 3 shots, give the ammo back to the player before they reload/rechamber. When it is, allow the rechamber to happen? I'm not sure how that works, as I am no animator, but he is. Probably going to have to ask him to explain that a bit more. Cause I am not sure how the rechamber works vs the reload...

I think then in menu, get a client dvar that you set in gsc to not show the ammo hud when they have that gun, but to maybe make your own.
Last Edit: June 20, 2015, 03:56:04 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 3 years ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linkslilrifaskypeuser724lilrifa
i remember from the one-in-the-chamber thing i did in xmas-warehouse that when i used the ballista in the one-in-the-chamber challenge, it wouldn't use the rechamber anim.
Could you show me what you mean? O.o ???
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
I've been messing with it for a bit again, and the more i try with it the more i realise this is prob far from perfect either. The fire-mechanics kinda work ok, but not sure how it will work out with full-auto at high fire rate. There's a small wait in the script related to the fire-time of the weapon, and that might be rlly hard to get right/working if the weapon is full auto..

Also the issue with the ammo-hud ( is fixable, but require some menu-scripting with client-dvars ), the character throwing low-ammo quote's and the player not being able to reload half-way through the clip.. You will also need to tick \CancelAutoHolsterWhenEmpty\ in the weapo-file to make this work and you would need to add script for max-ammo powerups, and maybe buying ammo from the wall. Basicly everything that changes the ammo-count..

A vid of how it works on the ballista:
! No longer available


This is the script i'm using for it. Threaded it from my mapname.gsc under the:

   /*--------------------
    FUNCTION CALLS - POST _Load
   ----------------------*/
with:

Code Snippet
Plaintext
	level thread m1216_rechamber();


Then add this somewhere in the script:

Code Snippet
Plaintext
// adjust LowAmmoWarningTreshold and CancelAutoHolsterWhenEmpty in the weaponfile for this to work!
m1216_rechamber()
{
flag_wait( "all_players_connected" );
player = get_players();
array_thread(player,::m1216_init);
}

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

// The start values, also need one for the upgraded if that has different ammo-count
self.m1216_equiped = false;
self.m1216_clip = 16;
self.m1216_stock = 80;

while(1)
{
gun = self getcurrentweapon();

if( gun != "zombie_m1216" && gun != "zombie_m1216_upgraded" && self.m1216_equiped ) // CHANGE NAME OF THE WEAPON_FILE HERE!!
{
self.m1216_equiped = false;
self notify( "end_m1216_watch" );
}

else if( gun != "zombie_m1216" && gun != "zombie_m1216_upgraded" ) // CHANGE NAME OF THE WEAPON_FILE HERE!!
{
wait 0.3;
continue;
}

else if( !self.m1216_equiped )
{
self.m1216_equiped = true;
self thread watch_for_m1216_fire();
}

wait 0.1;
}
}

watch_for_m1216_fire()
{
self endon( "death" );
self endon( "disconect" );
self endon( "end_m1216_watch" );

while(1)
{
gun = self getcurrentweapon();

// First figure out what we should set the clip-size to so the rechamber is correct
// AFTER every third shot we want the clipsize to be 2, otherwise it should be 1
// We dont want any bullets in stock, to prevent starting the reload

if( self.m1216_clip == 16 )
{
// we dont need to set 12, 8, and 4 because we put in two bullets before those..
self setweaponammoclip( gun, 1 );
self setweaponammostock( gun, 0 );
}
else if( self.m1216_clip == 13 || self.m1216_clip == 9 || self.m1216_clip == 5 )
{
self setweaponammoclip( gun, 2 );
self setweaponammostock( gun, 0 );
}
else if( self.m1216_clip != 12 && self.m1216_clip != 8 && self.m1216_clip != 4 )
{
self setweaponammoclip( gun, 1 );
self setweaponammostock( gun, 0 );
}
else if( self.m1216_clip == 12 || self.m1216_clip == 8 || self.m1216_clip == 4 )
{
self setweaponammostock( gun, 0 );
}

self iprintln( "Player m1216 clip count: ^1"+self.m1216_clip );
self iprintln( "Player m1216 ammo stock: ^2"+self.m1216_stock );

self waittill( "weapon_fired", weap_name );
self.m1216_clip--;

wait 0.15;                                                    // this wait has to be a bit bigger then the weapons fire-time

if( self.m1216_clip == 0 && self.m1216_stock > 0 )
{
// let the game reload
self setweaponammostock( gun, 16 );

if( self.m1216_stock <= 16 )
{
self.m1216_clip = self.m1216_stock;
self.m1216_stock = 0;
}

else
{
self.m1216_clip+=16;
self.m1216_stock-=16;
}
self waittill( "reload" );
}

else if( self.m1216_clip == 0 && self.m1216_stock == 0 )
{
// Force switching to another weapon if we have one, since we disabled that in the weapon-file
weapList = self GetWeaponsListPrimaries();
if( weaplist.size > 1 )
{
for( i=0 ; i< weaplist.size ; i++ )
{
if( weaplist[i] != gun )
{
self switchtoweapon( weaplist[i] );
break;
}
}
}
}

}
}

Double Post Merge: June 20, 2015, 11:27:18 am
How about this one?

! No longer available


This is actually pretty easy to setup, and no hassle with the hud etc. Have only tested a little bit though.
Only thing i changed in the weapon file is make the trenchgun full-auto, this make's it skip the rechamber anims but only when you hold down the trigger. So if you only fire twice it will still rechamber.. That's the only flaw on this method.

This script is making it force rechamber every 4th shot, you may be able to come up with something better then disableweapons() though, and the script itself is purely to get it working could use some extra checks here and there..

But if you could make it somehow skip the 'extra rechamber' when releasing the trigger this is pretty much a m1216..

the script:
Code Snippet
Plaintext
m1216_rechamber()
{
flag_wait( "all_players_connected" );
player = get_players();
array_thread(player,::m1216_init);
}

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

rechambered = false;


while(1)
{
self waittill( "weapon_fired" );

gun = self getcurrentweapon();

if( gun != "zombie_shotgun" && gun != "zombie_shotgun_upgraded" )
{
wait 0.3;
continue;
}

clip = self getweaponammoclip( gun );
if( ( clip == 12 || clip == 8 || clip == 4 ) && !rechambered )
{
iprintln( "2Rechamber" );
rechambered = true;
self disableweapons();
wait 0.3;
self enableweapons();
}

if( ( clip < 12 || clip < 8 || clip < 4 ) && rechambered )
{
rechambered = false;
}

wait 0.1;
}
}
Last Edit: June 20, 2015, 11:29:13 am by BluntStuffy
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years 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.
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
Blunt you kill the function on death but you don't recall it on spawn again :(
It's the same mistake I found with @Ege115 's code a lot  :please:
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
×
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
Blunt you kill the function on death but you don't recall it on spawn again :(
It's the same mistake I found with @Ege115 's code a lot  :please:

Thanks for the heads up, i would normally use a on_player_spawned function in a loop. Dunno why i did it like this above, but i mentioned in the post the script wasn't ready for use and purely for testing the mechanics.
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
blunt, the only other thing I was thinking, which I know nothing about yet, but I know you do, is using the alt weapon. Do you know how to switch to it using the altraise anim instead, via script? Cause you could then do that with the spin, like my 2 weapon file way, but not have issues when switching back with the raise anim. I just don't know how to switch to alt weapon via script.
Last Edit: June 20, 2015, 08:50:25 pm by MakeCents
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
×
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
blunt, the only other thing I was thinking, which I know nothing about yet, but I know you do, is using the alt weapon. Do you know how to switch to it using the altraise anim instead, via script? Cause you could then do that with the spin, like my 2 weapon file way, but not have issues when switching back with the raise anim. I just don't know how to switch to alt weapon via script.

guess you could just use switchtoweapon() as long as they are set up as alt-weapon and primary weapon in the weapon-files then they will use the alt-raise alt-drop anims
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
guess you could just use switchtoweapon() as long as they are set up as alt-weapon and primary weapon in the weapon-files then they will use the alt-raise alt-drop anims

Well hell then. That fixes it completely. Other than it takes two weapon files.

Code Snippet
Plaintext
//thread ithaca();//put this up in function threads, you know
ithaca(){
flag_wait("all_players_connected");
players = get_players();
for(i=0;i<players.size;i++){
players[i] thread ithaca_check();
players[i] thread watch_ithaca();
players[i] thread HandleClientDvar();
}
}
ithaca_check() {
self endon("disconnect");
self.ithaca_fires = 0;
for(;;) {
self waittill("weapon_fired");
weapon = self GetCurrentWeapon();
if(issubstr(weapon, "ithica")) {//this will check for upgraded then too, but follow next note
if(self.ithica_fires >= 3) {
clip = self GetWeaponAmmoClip(weapon);
if(clip>0){
self switchtoweapon(weapon+"_alt");//change alt weapon name to same name with _alt
self DisableWeaponCycling();
wait(.4);// = alt raise time minus a little
self EnableWeaponCycling();
self switchtoweapon(weapon);
}
self.m1216_fires = 0;
}
else {
self.ithaca_fires++;
self IPrintLnBold("Ithaca Shot " + self.ithaca_fires + " Times");
}
}
}
}
watch_ithaca(){
self endon("disconnect");
while(1){
self waittill("reload");
weapon = self GetCurrentWeapon();
if(weapon=="ithaca_zm") self.ithaca_fires = 0;
}
}
HandleClientDvar(){//this part is for the menu script
self endon("disconnect");
self setclientdvar("hidealt",false);
while(1){
self waittill("weapon_change_complete" );
hidealt = false;
weapons = self GetWeaponsListPrimaries();
for(i=0;i<weapons.size;i++){
if(issubstr(weapons[i], "ithica")){
hidealt = true;
break;
}

}
self setclientdvar("hidealt", hidealt);
}
}

Make the ithaca_check_zm and the ithaca_zm altweapons, and make the altraise time match the spin time and make it the altraise anim. Don't forget to remove the alt drop time for alt weapon and alt raise for primary. Adjust the script as needed for timing

! No longer available

Edit hud.menu:
Change:
Code Snippet
Plaintext
		itemDef // Left
        {
            name "slot3"
            rect (-DPAD_ICON_SPACING - DPAD_BASE_SIZE) DPAD_ICON_Y DPAD_BASE_SIZE DPAD_BASE_SIZE
ownerdraw CG_PLAYER_ACTIONSLOT_3
forecolor 1 1 1 HUD_ALPHA
visible 1
decoration
textstyle ITEM_TEXTSTYLE_SHADOWED
textalign ITEM_ALIGN_LEFT
textscale TEXTSIZE_SMALL
textfont UI_FONT_DEFAULT
        }
itemDef
{
rect (-DPAD_ICON_SPACING - DPAD_BASE_SIZE_HALF) DPAD_LABEL_Y 1 1
exp text ( "[" + KeyBinding( "+actionslot 3" ) + "]" );
forecolor 1 1 1 0
exp forecolor A ( HUD_ALPHA * HudFade( "dpad" ) )
textfont UI_FONT_OBJECTIVE
textscale 0.25
textalign ITEM_ALIGN_CENTER
textstyle ITEM_TEXTSTYLE_SHADOWED
visible when( ActionSlotUsable( 3 ) )
decoration
}
To:
Code Snippet
Plaintext
		itemDef // Left
        {
            name "slot3"
            rect (-DPAD_ICON_SPACING - DPAD_BASE_SIZE) DPAD_ICON_Y DPAD_BASE_SIZE DPAD_BASE_SIZE
ownerdraw CG_PLAYER_ACTIONSLOT_3
forecolor 1 1 1 HUD_ALPHA
visible 1
decoration
textstyle ITEM_TEXTSTYLE_SHADOWED
textalign ITEM_ALIGN_LEFT
textscale TEXTSIZE_SMALL
textfont UI_FONT_DEFAULT
visible when( ActionSlotUsable( 3 ) && !dvarBool( hidealt ))
        }
itemDef
{
rect (-DPAD_ICON_SPACING - DPAD_BASE_SIZE_HALF) DPAD_LABEL_Y 1 1
exp text ( "[" + KeyBinding( "+actionslot 3" ) + "]" );
forecolor 1 1 1 0
exp forecolor A ( HUD_ALPHA * HudFade( "dpad" ) )
textfont UI_FONT_OBJECTIVE
textscale 0.25
textalign ITEM_ALIGN_CENTER
textstyle ITEM_TEXTSTYLE_SHADOWED
visible when( ActionSlotUsable( 3 ) && !dvarString( hidealt ))
decoration
}
Last Edit: June 22, 2015, 04:34:00 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 3 years ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linkslilrifaskypeuser724lilrifa
Well hell then. That fixes it completely. Other than it takes two weapon files.

Make the ithaca_check_zm and the ithaca_zm altweapons, and make the altraise time match the spin time and make it the altraise anim. Don't forget to remove the alt drop time for alt weapon and alt raise for primary. Adjust the script as needed for timing

Thanks, Guys. This is really gonna help me out. Now how would i go about hiding the altweapon on the 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
Thanks, Guys. This is really gonna help me out. Now how would i go about hiding the altweapon on the hud?

Have you tried it yet. I didn't get an alt weapon icon to hide, but to hide it you would add a visible when to the itemdef, instead of the visible 1, and the when would be when the players weapon  wasn't the ithica, which you would set in a script per player. All in your hud.menu file in the weaponinfo section.
Last Edit: June 20, 2015, 10:12:21 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 3 years ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linkslilrifaskypeuser724lilrifa
Have you tried it yet. I didn't get an alt weapon icon to hide, but to hide it you would add a visible when to the itemdef, instead of the visible 1, and the when would be when the players weapon  wasn't the ithica, which you would set in a script per player.

Well, I tried it in BO and there was a checkerboard icon, but I can try it again
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
Well, I tried it in BO and there was a checkerboard icon, but I can try it again

Oh, okay, I'm not the expert on that. Dukip would know more about that then.

 
Loading ...