LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   Holowan Laboratories (http://www.lucasforums.com/forumdisplay.php?f=324)
-   -   Theoretical Scripting Question (Puppets) (http://www.lucasforums.com/showthread.php?t=212584)

harIII 07-24-2013 08:57 PM

Theoretical Scripting Question (Puppets)
 
For the last few years now I've been under the influence that only party members are permitted to have puppets. Can anyone actually provide me with a little insight as to why that is? I'm just wonder if there is a weird and kinky way of getting around it because I've managed to be able to do some bizarre things by editing the nwscript file. What is actually preventing the pc from having a puppet?

VarsityPuppet 07-24-2013 09:07 PM

I'm not positive, but I believe it is the simple fact that your party members are the puppets... basically.

Malxados 07-24-2013 10:41 PM

I believe I heard that oldflash did this in his/her Final Touch mod, and from what I've looked at (though there are a lot of files to look through, and I'm not sure what all is going on with these scripts for sure), it seems that it spawns via an armband that runs this script:
Code:

// pc_remote.nss

void main()
{
        object oPC = GetFirstPC();
        vector vPos = GetPosition(oPC);
        float fPCFace = GetFacing(oPC);
        location lLoc = Location(vPos + AngleToVector(fPCFace) * 1.5f, fPCFace);
        object oCurHide = GetItemInSlot( INVENTORY_SLOT_CARMOUR, oPC );
        if ( !GetIsObjectValid( oCurHide ) && !GetIsObjectValid(GetObjectByTag("pc_remote"))) {
                object oRemote = CreateObject(OBJECT_TYPE_CREATURE, "pc_remote", lLoc);
                SetNPCAIStyle(oRemote, 13);
                object oNewHide = CreateItemOnObject( "p_rem_chk", oPC, 1, TRUE );
                DelayCommand(0.1,ActionEquipItem( oNewHide, INVENTORY_SLOT_CARMOUR ));}
        else { if (GetIsObjectValid(GetObjectByTag("pc_remote"))) {
                        DestroyObject(GetObjectByTag("pc_remote"), 0.0, TRUE);
                                if ( GetIsObjectValid( GetObjectByTag("p_rem_chk"))) {
                                DelayCommand( 0.01, ActionUnequipItem( oCurHide ) );
                                SetItemStackSize(GetObjectByTag("p_rem_chk"), 1);
                                DelayCommand( 0.15, DestroyObject( GetObjectByTag("p_rem_chk"), 0.0f, FALSE, 0.0f, TRUE));} } }
}

And this is the heartbeat script used for "pc_remote.utc" (though that may not be the only one you'd want to look at):
Code:

// pc_remote.nss

void main()
{
        object oPC = GetFirstPC();
        vector vPos = GetPosition(oPC);
        float fPCFace = GetFacing(oPC);
        location lLoc = Location(vPos + AngleToVector(fPCFace) * 1.5f, fPCFace);
        object oCurHide = GetItemInSlot( INVENTORY_SLOT_CARMOUR, oPC );
        if ( !GetIsObjectValid( oCurHide ) && !GetIsObjectValid(GetObjectByTag("pc_remote"))) {
                object oRemote = CreateObject(OBJECT_TYPE_CREATURE, "pc_remote", lLoc);
                SetNPCAIStyle(oRemote, 13);
                object oNewHide = CreateItemOnObject( "p_rem_chk", oPC, 1, TRUE );
                DelayCommand(0.1,ActionEquipItem( oNewHide, INVENTORY_SLOT_CARMOUR ));}
        else { if (GetIsObjectValid(GetObjectByTag("pc_remote"))) {
                        DestroyObject(GetObjectByTag("pc_remote"), 0.0, TRUE);
                                if ( GetIsObjectValid( GetObjectByTag("p_rem_chk"))) {
                                DelayCommand( 0.01, ActionUnequipItem( oCurHide ) );
                                SetItemStackSize(GetObjectByTag("p_rem_chk"), 1);
                                DelayCommand( 0.15, DestroyObject( GetObjectByTag("p_rem_chk"), 0.0f, FALSE, 0.0f, TRUE));} } }
}


Fair Strides 2 07-24-2013 11:03 PM

Quote:

Originally Posted by harIII (Post 2835807)
I'm just wonder if there is a weird and kinky way of getting around it because I've managed to be able to do some bizarre things by editing the nwscript file.

Like what, might I ask?

supreme kotor 07-24-2013 11:05 PM

Yes it is true old flash made a "puppet" for the PC but it was really just an ally set to follow you around that you also had to spawn in each new module. From the experimenting I've done it appears the the PC can't have a puppet simply because there is no spot for the PC on the puppet table which is hard coded.

While they're is workarounds to this it would require duplicating everysingle module as you would have to put a follower into the onenter script. Sorry to be the one to kill this.

-Supreme Kotor

Canderis 07-24-2013 11:18 PM

Quote:

Originally Posted by supreme kotor (Post 2835815)

While they're is workarounds to this it would require duplicating everysingle module as you would have to put a follower into the onenter script. Sorry to be the one to kill this.

Right there works. And, HarIII, you are making a total conversion so it wouldn't be too out of the question to do that.

JCarter426 07-25-2013 12:06 AM

My guess is it's the NPC integer. The player's is -1, while the party members' are 0 through 11. If the AssignPUP function was not set up to accept -1, then you wouldn't be able to give the PC a puppet. And I'd say not allowing for negative numbers is pretty much the default attitude. I doubt it was anything more than simple oversight.

harIII 07-25-2013 08:42 AM

Well the reason I ask this is because I want to make a pet for the player. I'm debating having an option where it will be a companion you can have in your party or a puppet that follows you or someone else. I just wanted to see what exactly we know about this puppet system issue with the pc before I made any decisions.

Malxados 07-30-2013 12:50 AM

Quote:

Originally Posted by JCarter426 (Post 2835822)
My guess is it's the NPC integer. The player's is -1, while the party members' are 0 through 11. If the AssignPUP function was not set up to accept -1, then you wouldn't be able to give the PC a puppet. And I'd say not allowing for negative numbers is pretty much the default attitude. I doubt it was anything more than simple oversight.

Looks like that might not be the only reason:


Quote:

Originally Posted by stoffe (Post 2647822)
If you make a party member with a puppet the main character the puppet will disappear while they are. Maybe one of the reasons you're never offered the choice of making Bao-Dur the leader of the Dxun away team in TSL. :)


JCarter426 07-30-2013 09:03 AM

It only gets unassigned. You just have to assign it again and it's fine.

oldflash 09-01-2013 04:40 PM

I didn't assign the puppet to PC. The drone is running a script in heartbeat and test the presence of an item in hidden slot, presence of pc and presence of drone (as should not be more than one drone in map).
object oCurHide = GetItemInSlot( INVENTORY_SLOT_CARMOUR, oPC );
Code:

if ( !GetIsObjectValid( oCurHide ) && !GetIsObjectValid(GetObjectByTag("pc_remote")))
As for the armband, it only test if the hidden item is equipped or not and change the state.


All times are GMT -4. The time now is 05:02 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.