Please help, cant switch weapon to other hand.

A secret forum for people who preorder Overgrowth!
Post Reply
TheEldritchShark
Posts: 3
Joined: Thu Sep 19, 2013 12:13 am

Please help, cant switch weapon to other hand.

Post by TheEldritchShark » Thu Sep 19, 2013 7:40 am

Everytime i try to switch weapons with the B key my charsctor does a cool little spin instead of switching my weapon to the other hand, does anyone know how to fix this?

User avatar
EPR89
Posts: 1845
Joined: Mon Oct 15, 2012 8:57 am
Location: Germany

Re: Please help, cant switch weapon to other hand.

Post by EPR89 » Thu Sep 19, 2013 7:52 am

TheEldritchShark wrote:Everytime i try to switch weapons with the B key my charsctor does a cool little spin instead of switching my weapon to the other hand, does anyone know how to fix this?
Download the a200 scripts, copy the section that defines what happens when you press B in the aschar.as file and paste it into the corresponding section of this version's aschar.as.

They have changed the command in this version, probably to test something out. The old script command still works, though.

I'll post the section you have to copy and paste in a jiffy. Just have to find it.
So hang tight!

Here is the section in a201's aschar.as file that teels your character to spin once you hit B. It starts in line 1265:

Code: Select all

        if(GetInputPressed(this_mo.controller_id, "b")){
            int8 flags = _ANM_FROM_START;
            if(mirrored_stance){
                flags = flags | _ANM_MIRRORED;
            }
            flags = flags | _ANM_MOBILE;
            //mirrored_stance = !mirrored_stance;
            this_mo.SetAnimation("Data/Animations/r_hitspinright.anm",20.0f,flags);
            this_mo.rigged_object().anim_client().SetAnimatedItemID(0, weapon_slots[primary_weapon_slot]);
            in_animation = true;
            //throw_anim = true;
            this_mo.rigged_object().anim_client().SetAnimationCallback("void EndAnim()");
            //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifethrowlayer.anm",8.0f,0);
            //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_painflinch.anm",8.0f,0);
            /*if(sheathed_weapon == -1 && held_weapon != -1) {
                //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifesheathe.anm",8.0f,0);
                this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_swordsheathe.anm",8.0f,0);
            } else if(sheathed_weapon != -1 && held_weapon == -1) {
                this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifeunsheathe.anm",8.0f,0);
            }*/
            /*int8 flags = _ANM_FROM_START;
            if(weapon_slots[primary_weapon_slot] != -1) {
                this_mo.SetAnimation("Data/Animations/r_swordsheathe.anm",20.0f,flags);
                this_mo.rigged_object().anim_client().SetAnimatedItemID(1, weapon_slots[_sheathed_right]);
            } else if(weapon_slots[primary_weapon_slot] == -1) {
                this_mo.SetAnimation("Data/Animations/r_swordunsheathe.anm",20.0f,flags);
                this_mo.rigged_object().anim_client().SetAnimatedItemID(1, weapon_slots[_sheathed_right_sheathe]);
            }
            in_animation = true;
            this_mo.rigged_object().anim_client().SetAnimationCallback("void EndAnim()");*/
            //
            //SwapWeaponHands();
            
            //CheckPossibleAttacks();
        }
And here is what you have to replace it with:

Code: Select all

        if(GetInputPressed(this_mo.controller_id, "b")){
            /*int8 flags = _ANM_FROM_START;
            if(mirrored_stance){
                flags = flags | _ANM_MIRRORED;
            }


            this_mo.SetAnimation("Data/Animations/w_combatidlewild.anm",20.0f,flags);

            in_animation = true;

            this_mo.rigged_object().anim_client().SetAnimationCallback("void EndAnim()");*/
            //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifethrowlayer.anm",8.0f,0);
            //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_painflinch.anm",8.0f,0);
            /*if(sheathed_weapon == -1 && held_weapon != -1) {
                //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifesheathe.anm",8.0f,0);
                this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_swordsheathe.anm",8.0f,0);
            } else if(sheathed_weapon != -1 && held_weapon == -1) {
                this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifeunsheathe.anm",8.0f,0);
            }*/
            /*int8 flags = _ANM_FROM_START;
            if(weapon_slots[primary_weapon_slot] != -1) {
                this_mo.SetAnimation("Data/Animations/r_swordsheathe.anm",20.0f,flags);
                this_mo.rigged_object().anim_client().SetAnimatedItemID(1, weapon_slots[_sheathed_right]);
            } else if(weapon_slots[primary_weapon_slot] == -1) {
                this_mo.SetAnimation("Data/Animations/r_swordunsheathe.anm",20.0f,flags);
                this_mo.rigged_object().anim_client().SetAnimatedItemID(1, weapon_slots[_sheathed_right_sheathe]);
            }
            in_animation = true;
            this_mo.rigged_object().anim_client().SetAnimationCallback("void EndAnim()");*/
            

            SwapWeaponHands();
            
            //CheckPossibleAttacks();
        }
Just copy this code and replace the one above with it.

TheEldritchShark
Posts: 3
Joined: Thu Sep 19, 2013 12:13 am

Re: Please help, cant switch weapon to other hand.

Post by TheEldritchShark » Fri Sep 20, 2013 9:13 am

Thank you for the help :3

Waffle Waffleton
Posts: 2
Joined: Sat Sep 28, 2013 11:38 am

Re: Please help, cant switch weapon to other hand.

Post by Waffle Waffleton » Sun Nov 10, 2013 9:13 pm

How do you open on mac?

DemonicTortoise
Posts: 3
Joined: Sat Dec 21, 2013 6:14 am

Re: Please help, cant switch weapon to other hand.

Post by DemonicTortoise » Tue Dec 24, 2013 12:42 am

It doesn't seem to work on 204, or maybe im just doing something wrong.
I replaced it the top with the bottom and on loading of a map it came up with 2 errors and crashed :x
Know any other ways to swap hand?

User avatar
Endoperez
Posts: 5668
Joined: Sun Jan 11, 2009 7:41 am
Location: cold and dark and lovely Finland

Re: Please help, cant switch weapon to other hand.

Post by Endoperez » Tue Dec 24, 2013 2:58 am

The only way to change control stuff is by changing the scripts. The problem is, scripts tend to change for every alpha. You copy-pasted something that was made for an older alpha, and that's why it didn't work. I don't have a computer with Overgrowth in it, at the moment, so I can't help you with fixing that bit of script for the newest alpha.

Were you able to fix it yet, or is your game still crashing?

DemonicTortoise
Posts: 3
Joined: Sat Dec 21, 2013 6:14 am

Re: Please help, cant switch weapon to other hand.

Post by DemonicTortoise » Tue Dec 24, 2013 3:01 am

Endoperez wrote:The only way to change control stuff is by changing the scripts. The problem is, scripts tend to change for every alpha. You copy-pasted something that was made for an older alpha, and that's why it didn't work. I don't have a computer with Overgrowth in it, at the moment, so I can't help you with fixing that bit of script for the newest alpha.

Were you able to fix it yet, or is your game still crashing?
I made a copy of the default scripts, its not crashing anymore, but i still can't use swap hands.

User avatar
last
Posts: 2154
Joined: Fri Jan 07, 2011 7:02 am
Location: Estonia

Re: Please help, cant switch weapon to other hand.

Post by last » Tue Dec 24, 2013 3:38 am

DemonicTortoise wrote:
Endoperez wrote:The only way to change control stuff is by changing the scripts. The problem is, scripts tend to change for every alpha. You copy-pasted something that was made for an older alpha, and that's why it didn't work. I don't have a computer with Overgrowth in it, at the moment, so I can't help you with fixing that bit of script for the newest alpha.

Were you able to fix it yet, or is your game still crashing?
I made a copy of the default scripts, its not crashing anymore, but i still can't use swap hands.
Actually there are only few lines that are important for switching weapon hand.

So you need to replace

Code: Select all

int8 flags = _ANM_FROM_START;
            if(mirrored_stance){
                flags = flags | _ANM_MIRRORED;
            }
            flags = flags | _ANM_MOBILE;
            //mirrored_stance = !mirrored_stance;
            this_mo.SetAnimation("Data/Animations/r_hitspinright.anm",20.0f,flags);
            this_mo.rigged_object().anim_client().SetAnimatedItemID(0, weapon_slots[primary_weapon_slot]);
            in_animation = true;
            //throw_anim = true;
            this_mo.rigged_object().anim_client().SetAnimationCallback("void EndAnim()");
            //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifethrowlayer.anm",8.0f,0);
            //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_painflinch.anm",8.0f,0);
            /*if(sheathed_weapon == -1 && held_weapon != -1) {
                //this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifesheathe.anm",8.0f,0);
                this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_swordsheathe.anm",8.0f,0);
            } else if(sheathed_weapon != -1 && held_weapon == -1) {
                this_mo.rigged_object().anim_client().AddLayer("Data/Animations/r_knifeunsheathe.anm",8.0f,0);
            }*/
            /*int8 flags = _ANM_FROM_START;
            if(weapon_slots[primary_weapon_slot] != -1) {
                this_mo.SetAnimation("Data/Animations/r_swordsheathe.anm",20.0f,flags);
                this_mo.rigged_object().anim_client().SetAnimatedItemID(1, weapon_slots[_sheathed_right]);
            } else if(weapon_slots[primary_weapon_slot] == -1) {
                this_mo.SetAnimation("Data/Animations/r_swordunsheathe.anm",20.0f,flags);
                this_mo.rigged_object().anim_client().SetAnimatedItemID(1, weapon_slots[_sheathed_right_sheathe]);
            }
            in_animation = true;
            this_mo.rigged_object().anim_client().SetAnimationCallback("void EndAnim()");*/
            //
            //SwapWeaponHands();
            
            //CheckPossibleAttacks();
With

Code: Select all

SwapWeaponHands();
and it works.
So here is the whole function using b key to switch hands.

Code: Select all

        if(GetInputPressed(this_mo.controller_id, "b")){
			SwapWeaponHands();
        }

DemonicTortoise
Posts: 3
Joined: Sat Dec 21, 2013 6:14 am

Re: Please help, cant switch weapon to other hand.

Post by DemonicTortoise » Tue Dec 24, 2013 5:48 am

It worked.
Thank you :D

commersrus
Posts: 1
Joined: Sat Aug 31, 2013 12:22 pm

Re: Please help, cant switch weapon to other hand.

Post by commersrus » Sat Dec 28, 2013 8:50 am

If anyone reading this is unsure make sure to check out this video:
http://www.youtube.com/watch?v=WccZYk1f ... e=youtu.be

Greymor
Posts: 1
Joined: Sun Jan 05, 2014 2:01 pm

Re: Please help, cant switch weapon to other hand.

Post by Greymor » Mon Jan 06, 2014 5:38 pm

I'm not sure if it was because I changed the script to do this, but I now cant seem to be able to sheathe, switch or drop weapons. Is anyone else also having this problem?

User avatar
samjb1992
Posts: 607
Joined: Thu Jan 26, 2012 10:05 am

Re: Please help, cant switch weapon to other hand.

Post by samjb1992 » Thu Jan 16, 2014 11:59 pm

Waffle Waffleton wrote:How do you open on mac?
use text edit

AbeRavenclaw
Posts: 6
Joined: Mon Jan 27, 2014 8:55 am

Re: Please help, cant switch weapon to other hand.

Post by AbeRavenclaw » Sat Feb 08, 2014 8:42 pm

DemonicTortoise wrote:It doesn't seem to work on 204, or maybe im just doing something wrong.
I replaced it the top with the bottom and on loading of a map it came up with 2 errors and crashed :x
Know any other ways to swap hand?
I always do this. If there are two weapons I pick one up then sheathe it then pick the other one up and then if I sheathe that one I can pull that one out then drop it then pull out the first one and its still in the right hand (I don't know if that helps or not)

RPilcrow
Posts: 2
Joined: Tue Sep 30, 2014 10:34 am

Re: Please help, cant switch weapon to other hand.

Post by RPilcrow » Wed May 20, 2015 10:03 am

in the latest version if you want to swap hands without your character automatically switching back the frame afterwards, you'll also want to ctrl+f SwapWeaponHands(); to find this piece of code in the aschar.as;

Code: Select all

if(weapon_slots[primary_weapon_slot] == -1 && weapon_slots[secondary_weapon_slot] != -1){
SwapWeaponHands();
}
which can easily be commented out by putting a /* before the first 'if' and a */ after the last curly brace, OR by putting a pair of slashes in front of each one of those lines (ie, //).

otherwise, you'll only be able to swap hands if you're holding an item in each hand - which makes it impossible to unsheathe more than one weapon or unsheathe anything with something already in your main hand.

items in the offhand don't seem to have any effect though, which is probably why handswapping was commented out in the first place.

User avatar
rodeje25
Posts: 1036
Joined: Wed Mar 12, 2014 1:17 am
Location: Cold and Rainy Netherlands

Re: Please help, cant switch weapon to other hand.

Post by rodeje25 » Wed May 20, 2015 12:20 pm

i love the spin and i totally loved it when you pressed b multiple times and it start dancing and stuff

Post Reply