Author Topic: A complete beginner with eyes bigger than belly  (Read 1302 times)

Legacy_Ribouldingue

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #30 on: February 11, 2013, 09:56:07 pm »


               Thanks it worked just fine.

Sorry for the delay... have been off for eleven, if I'm reading well, days... that's quiite a big few!
               
               

               
            

Legacy_Ribouldingue

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #31 on: February 20, 2013, 06:01:53 pm »


               Yes, I know, I should be done with this for long... But well it's happily not given to everyone to be slow...

Little question so: Where is the local variable recorded in the following script part? I wrote it thinking it was on the spawned placeable but now I've got bugs with another script calling this variable and I wonder if it's not in fact stored in the waypoint or anywhere else?

Rope script parts:

// Moving the lift down.
   oTarget = GetWaypointByTag("WP_DTC_L_3801s");
   oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_01", GetLocation(oTarget));
   oTarget = GetWaypointByTag("WP_DTC_L_3802s");
   oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_02", GetLocation(oTarget));
   oTarget = GetWaypointByTag("WP_DTC_L_3803s");
   oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_03", GetLocation(oTarget));

// Adjusts lift height.
   nValue = GetLocalInt(oSpawn, "LV_DTC_Southernliftheight") - 1;
   SetLocalInt(oSpawn, "LV_DTC_Southernliftheight", nValue);
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #32 on: February 21, 2013, 02:13:42 am »


               it would be on the dtc_southlift_03 placeable.

Hmmm,  Keep in mind that you have just created that object.  So the:

GetLocalInt(oSpawn, "LV_DTC_Southernliftheight")

will always return 0  since that placable has never had the var set on it.   You then subtract 1 so;

SetLocalInt(oSpawn, "LV_DTC_Southernliftheight", nValue);

is always setting the var to -1
               
               

               


                     Modifié par Lightfoot8, 21 février 2013 - 02:30 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #33 on: February 21, 2013, 02:30:45 am »


               updated above post.
               
               

               
            

Legacy_Ribouldingue

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #34 on: February 21, 2013, 07:53:59 pm »


               Heck, I thought the variable was remaining on the placeable when it was spawned from place to place... will have to reconsider it all then... anyway thanks a lot for pointing it out and making it clear to me... *puts a scaphander on and dives*
               
               

               
            

Legacy_Ribouldingue

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #35 on: February 21, 2013, 09:12:11 pm »


               Is this a problem in the long term to multiply scripts?

And something else, where should I put my nose first to prevent flying objects not following the lift moves?

Here's the descending script:

void main()
{
    int nValue;
    object oTarget;
    object oSpawn;
    object oAll;

    // Get the creature who triggered this event.
    object oPC = GetLastUsedBy();

    // Have the PC perform a sequence of actions.
    AssignCommand(oPC, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)));
    AssignCommand(oPC, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_LEFTHAND)));
    AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 2.0));

    // Activating pulleys.
    oTarget = GetWaypointByTag("WP_DTC_P_5001s");
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southpull_02", GetLocation(oTarget));
    oTarget = GetWaypointByTag("WP_DTC_P_5002s");
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southpull_22", GetLocation(oTarget));

    // Find the location to which to teleport.
    oTarget = GetWaypointByTag("WP_DTC_LP_3911s_down");

    // Moving the lift down.
    oTarget = GetWaypointByTag("WP_DTC_L_3911s");
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_01", GetLocation(oTarget));
    oTarget = GetWaypointByTag("WP_DTC_L_3912s");
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_02", GetLocation(oTarget));
    oTarget = GetWaypointByTag("WP_DTC_L_3913s");
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_03", GetLocation(oTarget));

    // Adjusts lift height.
    SetLocalInt(oSpawn, "LV_DTC_Southernliftheight", 1);

    // Get everything/one who is on the lift
    object oTrigger=GetNearestObjectByTag("Trigger_DTC_LP_a");
    object oInTrigger=GetFirstInPersistentObject(oTrigger, OBJECT_TYPE_CREATURE | OBJECT_TYPE_ITEM);
    // Confirms PC is on the lift.
    SetLocalInt(oInTrigger, "LV_DTC_isonsouthernlift", 1);
    while (GetIsObjectValid(oInTrigger))

    {
    // Teleport everything/one
    DelayCommand (2.0, AssignCommand(oInTrigger, ClearAllActions()));
    DelayCommand (2.5, AssignCommand(oInTrigger, JumpToObject(oTarget)));
    oInTrigger=GetNextInPersistentObject(oTrigger, OBJECT_TYPE_CREATURE | OBJECT_TYPE_ITEM);
    }

    // Stops pulleys (not fully effective until this script ends).
    DelayCommand (5.0, DestroyObject(GetObjectByTag("DTC_Southernpulley_02")));
    DelayCommand (5.0, DestroyObject(GetObjectByTag("DTC_Southernpulley_22")));

    // Destroy the lift up.
    DelayCommand (2.0, DestroyObject(GetNearestObjectByTag("DTC_Southernlift_01")));
    DelayCommand (2.0, DestroyObject(GetNearestObjectByTag("DTC_Southernlift_02")));
    DelayCommand (2.0, DestroyObject(GetNearestObjectByTag("DTC_Southernlift_03")));

}
               
               

               


                     Modifié par Ribouldingue, 21 février 2013 - 09:49 .
                     
                  


            

Legacy_Morbane

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #36 on: February 24, 2013, 05:08:19 am »


               is there a nwn1 "move-to-location" function?

is there was, a trigger around the pit could call that function and move the creature away from the pit...
               
               

               
            

Legacy_Ribouldingue

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #37 on: February 25, 2013, 09:22:46 pm »


               Yep I think it's doable Morbane thanks, Highv Priest talked about it in the previous page, but for now I'm working on the item lifting to avoid to get flying-above-pit-stuff and frankly I've abandonned the idea of creatures avoiding the pit... seems very hard for me obviously... I think I'll pass on creatures too... no creatures at all.... hehehe... thanks anyway!
               
               

               


                     Modifié par Ribouldingue, 25 février 2013 - 09:23 .
                     
                  


            

Legacy_Ribouldingue

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
A complete beginner with eyes bigger than belly
« Reply #38 on: May 20, 2013, 09:52:13 pm »


               I do confirm: this beginner had way too big eyes for his belly size!

Hello folks, sorry for giving it up, but well even if the lift works, thanks to your help, scripting is really too hair pulling for me. I'll stick anyway around NWN1 and will try to think about a smaller thing one day.

I'll be glad to send you the lift if you want hahaha...

Thanks again for the welcome and the help, see you around someday!