Jump to content

I'm having troubles trying to drop the player's weapons with scripting.


Recommended Posts

My script looks like this:

set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "drop" );

When I run it for the player, they drop a copy of their weapon and keep what they were holding in their inventory. Is there a way to make it so that the weapon is not still in their inventory when they drop it? (It works normally for NPCs.)

By the way, sorry if this is in the wrong format or anything, I'm new here.

Link to comment

Is this for singleplayer or multiplayer? Scripts are basically barely implemented in multiplayer.

I'd say it's very likely that you simply can't do that to the player. Scripts aren't meant to be used on the player, especially if this is for multiplayer.

I believe you can set the player's weapon to not draw on the screen in first person, although they can still fire it, if that's any help. It's been forever since I touched scripts, so I might be wrong.

Link to comment
  • 4 weeks later...
On 3/19/2021 at 4:39 PM, DA COOLIST OF DOODS said:

It's worth a try. I'll check it out.

Edit: I couldn't find anything useful in it.

and use SET_WEAPON NONE and the LOCK WEAPON command, so player is unabled to switch other weapons from weapon none? maybe also playing a sound of "dropping"

Link to comment
  • 4 months later...
On 4/11/2021 at 10:15 PM, DA COOLIST OF DOODS said:

That would be convincing but the weapon would still be in the inventory

Sorry for late of answer. i have a lot of personal troubles.

Craps you right, honestly i not know how the hell to fix that. :\

the unique solution should be to edit the code with a new SET_REMOVE_WEAPON @ WeaponName function. :C

 

I found the nar shaddaa script of lock weapons..

is the enter_bar.ibi of ns_street level.

that is the contain:

 

 

 

 

affect ( "kyle", FLUSH )
{
    set ( "SET_PLAYER_LOCKED", "true" );
    set ( "SET_WEAPON", "WP_NONE" );

    affect ( "bouncer_main1", FLUSH )
    {

        task ( "no_blasters" )
        {
            sound ( CHAN_VOICE, "sound/chars/rodian1/09ro1001.wav" );
        }

        set ( "SET_USE_SUBTITLES", "true" );
        set ( "SET_VIEWTARGET", "kyle" );
        set ( "SET_ANIM_BOTH", "BOTH_TALKGESTURE1" );
        do ( "no_blasters" );
        wait ( "no_blasters" );
        remove ( "bb_p" );
        wait ( 500.000 );

        affect ( "bouncer_main2", FLUSH )
        {

            task ( "speech1" )
            {
                sound ( CHAN_VOICE, "sound/chars/rodian2/09ro2001.mp3" );
            }

            set ( "SET_USE_SUBTITLES", "true" );
            set ( "SET_ANIM_BOTH", "BOTH_TALKGESTURE2" );
            set ( "SET_VIEWTARGET", "kyle" );
            do ( "speech1" );
            wait ( "speech1" );
            wait ( 1000.000 );

            affect ( "bouncer_main1", INSERT )
            {
                set ( "SET_WEAPON", "WP_BRYAR_PISTOL" );
                set ( "SET_ANIM_UPPER", "BOTH_STAND5" );
                set ( "SET_ANIM_HOLDTIME_UPPER", -1.000 );
            }


            affect ( "kyle", INSERT )
            {

                task ( "no_problem" )
                {
                    sound ( CHAN_VOICE, "sound/chars/kyle/09kyk014.wav" );
                }

                do ( "no_problem" );
                wait ( "no_problem" );
                wait ( 1000.000 );

                affect ( "bouncer_main2", FLUSH )
                {
                    set ( "SET_BEHAVIOR_STATE", "BS_DEFAULT" );
                    set ( "SET_WALKING", "true" );
                    set ( "SET_RUNNING", "false" );
                    set ( "SET_IGNOREALERTS", "true" );
                    set ( "SET_LOOK_FOR_ENEMIES", "false" );
                    set ( "SET_WATCHTARGET", "NULL" );

                    task ( "go_guard_bar1" )
                    {
                        set ( "SET_NAVGOAL", "gb1" );
                    }

                    do ( "go_guard_bar1" );
                    wait ( 1000.000 );

                    affect ( "bouncer_main1", FLUSH )
                    {
                        set ( "SET_BEHAVIOR_STATE", "BS_DEFAULT" );
                        set ( "SET_WALKING", "true" );
                        set ( "SET_RUNNING", "false" );
                        set ( "SET_IGNOREALERTS", "true" );
                        set ( "SET_LOOK_FOR_ENEMIES", "false" );
                        set ( "SET_WATCHTARGET", "NULL" );

                        task ( "go_ramp_bottom" )
                        {
                            set ( "SET_NAVGOAL", "rb" );
                        }


                        task ( "go_ramp_bottom2" )
                        {
                            set ( "SET_NAVGOAL", "rb2" );
                        }


                        task ( "go_ramp_top" )
                        {
                            set ( "SET_NAVGOAL", "rt" );
                        }


                        task ( "go_ramp_end" )
                        {
                            set ( "SET_NAVGOAL", "re" );
                        }

                        do ( "go_ramp_bottom" );
                        wait ( 1000.000 );

                        affect ( "kyle", FLUSH )
                        {
                            set ( "SET_PLAYER_LOCKED", "false" );
                        }

                        wait ( 1000.000 );
                        set ( "SET_ANIM_HOLDTIME_UPPER", 0.000 );
                        wait ( "go_ramp_bottom" );
                        wait ( 2000.000 );

                        affect ( "bouncer_ramp", FLUSH )
                        {

                            task ( "go_ramp_guard2" )
                            {
                                set ( "SET_NAVGOAL", "rg2" );
                            }


                            task ( "go_ramp_guard1" )
                            {
                                set ( "SET_NAVGOAL", "rg1" );
                            }

                            set ( "SET_LOCKYAW", "off" );
                            do ( "go_ramp_guard2" );
                            wait ( "go_ramp_guard2" );
                            set ( "SET_DYAW", 90.000 );

                            affect ( "bouncer_main1", FLUSH )
                            {
                                do ( "go_ramp_bottom2" );
                                wait ( "go_ramp_bottom2" );

                                affect ( "bouncer_ramp", FLUSH )
                                {
                                    do ( "go_ramp_guard1" );
                                    wait ( "go_ramp_guard1" );
                                    set ( "SET_ANGLES", < 0.000 90.000 0.000 > );
                                    set ( "SET_LOCKYAW", "90" );
                                }

                                do ( "go_ramp_top" );
                                wait ( "go_ramp_top" );
                                do ( "go_ramp_end" );
                                wait ( "go_ramp_end" );
                                remove ( "bouncer_main1" );
                            }

                        }

                    }

                    wait ( "go_guard_bar1" );
                    set ( "SET_DYAW", 90.000 );
                }

            }

        }

    }

}

Link to comment

Mmm, i'm playing jedi outcast these days and i see the problem.

 

well, the fact is that is NOT possible, without code hacking, to remove weapons from player with scripting, *sigh*,

the level of nar shaddaa started with kyles with no weapons (he lost all weapons into the first duel with desann and into jedi academy is without weapon until he get the lightsaber)

so the "drop weapon" dialogue of rodian bodyguards ... is a fake drop weapon dialogue.

kyle can't attack into nar shaddaa until bartender cinematic, at all.

force powers and saber are re enalbed after dialogue, and other weapons need to be re obtained killing the smugglers.

:\

the unique way for player to lost his weapon is to be force pulled by someone. that's not much good.

This really need to be fixed with coding :C

 

 

Link to comment
2 hours ago, DA COOLIST OF DOODS said:

Thank you very much for the descriptive answer. It's a shame that it'd have to involve editing the code, but oh well.

You need also to edit some files of icarus for add also on Behaved the new SET_REMOVEWEAPON parm (with a list of weapon, exactly like SET_WEAPON as option)

i got you an hint: into openjk solution the icarus script system should be into q3_interface.h and q3_interface.cpp

you can use "find all reference" on SET_WEAPON into the code for find all the code chunks when is called and see how it is coded.

obvious, the remove weapon should work into the opposite way respect of SET_WEAPON. at moment i am not coding so i can't help, but i think should be interesting if you check the force push \ pull code, cause on level 2-3 force pull remove weapons from inventory of NPC player pulled.

that's should be the way. (but obvious, without the dropping of the item :P)

 

 

Void ForceThrow on wp_saber.cpp is related to force push \pull, is a boolean, so is a true\false. pull\ push code use the same function for work, so is a little complicated to find the exact chunk of code of drop weapons of pull level 2-3

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...