Author Topic: help wit a helper script please  (Read 348 times)

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
help wit a helper script please
« on: May 26, 2014, 04:35:03 am »


               

so i'm trying to make a script that i can use in multiple areas to help players that run solo on my server. basically a helper script is to use where your supposed to have 2-3 players in your group and need to stand on a switch or something. so here's what i got... done on lilac souls thingy.. any help would be appreciated.


 


 

here's the first script:

 

//Put this script OnEnter

void main()

{

 

object oPC = GetEnteringObject();

 

if (!GetIsPC(oPC)) return;

 

//-----------Need to check for party size here (if 1, if 2, or more------------------------------------------------------ 

 

if ((GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC)>0)||

    (GetLevelByClass(CLASS_TYPE_FIGHTER, oPC)>0)||

    (GetLevelByClass(CLASS_TYPE_MONK, oPC)>0)||

    (GetLevelByClass(CLASS_TYPE_ROGUE, oPC)>0))

   {

 

//-----------this is supposed to be 1 or 2 rocks or whatever is needed (preferably interchangeable)-----------

 

   oTarget = GetWaypointByTag("WP_helper_rock_1");

 

   lTarget = GetLocation(oTarget);

 

   oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "plot_helper_rock", lTarget);

 

   oTarget = oSpawn;

 

   nInt = GetObjectType(oTarget);

 

//----------------VFX isn't nessisary--------------------------------------------------------------------------------------------

 

   if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), oTarget));

   else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oTarget)));


 

//------------------------------------------------------------------------------------------------------------------------------------

 


   if ((GetLevelByClass(CLASS_TYPE_BARD, oPC)>0)||

       (GetLevelByClass(CLASS_TYPE_CLERIC, oPC)>0)||

       (GetLevelByClass(CLASS_TYPE_PALADIN, oPC)>0)||

 

//------------i'm thinking there should be a check here to see if only 1 summon can be called------------------------ 

//------------and accommodate as needed.----------------------------------------------------------------------------------

 

       (GetLevelByClass(CLASS_TYPE_DRUID, oPC)>0)||

       (GetLevelByClass(CLASS_TYPE_RANGER, oPC)>0)||

       (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)>0)||

       (GetLevelByClass(CLASS_TYPE_WIZARD, oPC)>0))

      {

      ActionStartConversation(oPC, "q_azner_in");

 

//--------------------i have the convesation made----------------------------------------------------------------------------------

 

      }

   }

}

 

 

here's the secon script:

 

 


void main()

{

object oPC = GetPCSpeaker();

}


 

yeah... i have no idea how to make summons move to set locations from a script.

 

thanks in advance.


               
               

               
            

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
help wit a helper script please
« Reply #1 on: May 28, 2014, 09:46:35 am »


               

was really hoping to have this script available for players by the beginning of June.


 


anyone?


 


a little help please.



               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
help wit a helper script please
« Reply #2 on: May 28, 2014, 04:10:23 pm »


               

You need a process that allows for both multi-party groups to open a door or for parties as well as instances where the party size is lower than the number of switches/triggers required.


 


Taking a step back, the script/system could look something like this (this assumes you're opening a door with 3 different areas that need to be occupied):


 


  • A plot door locked by default, with a specific key required to unlock.  On the FailToOpen event, the script checks each trigger for the "Occupied" variable.  If it is found on each trigger, then unlock the door.  If not, do nothing.  OnOpen, run a delay to delete the ints on each trigger, destroy the boulders (if the int ==2, see below), and close/relock the door.  The delay needs to be long enough for multi-PC parties to get everyone through the door before it closes again.

  • 3 separate triggers at the locations you want the players to stand to unlock the door. The OnEnter event of the trigger sets a "Occupied" int on the trigger (Value = 1).  The OnExit event of the trigger deletes the "Occupied" int on the trigger.  This allows multi-PC parties to stand on the trigger without the boulder.

  • 1 waypoint in the center of each trigger.  This is just the place that the boulder will be spawned.

  • 1 switch near each trigger, but outside of it and such a distance away that a PC would not be able to stand in the trigger area and pull the switch.   OnUsed toggles the "Occupied" variable and the boulder/vfx.  If the "Occupied" int is not set on the trigger, it sets the variable (Value = 2) and creates the vfx of creating the boulder.   if the "Occupied" int is already set, it deletes the int and destroys the boulder.  By setting "Occupied" as a different vaule from the OnEnter event, we can tell if the trigger is set by a PC or by a boulder.  This could affect the delay timer (more time allowed if any triggers have an "Occupied" variable ==1).  Or, if a switch is pulled for a trigger that already has an "Occupied" variable of 1 (PC set), then you could find that player and inflict massive damage upon him as a result of dropping a huge boulder on him/her.

I'm not sure what role the conversation is intended to play, but the above does not require one.



               
               

               
            

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
help wit a helper script please
« Reply #3 on: May 28, 2014, 10:25:54 pm »


               

my apologies, i tend to leave bits out. as i see what you mean above, i tend to play as druids or rangers a lot and having the extra conversation and interaction for my summons ads more fun and depth to the game. this is why i would like to keep it in the scripting if possible.


 


so the entire purpose of this script and the conversation script is to help out solo players use switch plates, levers, ect. 


 


the breakdown:


 


first check is to see the party size.


 


1 player run the full script, check class and summon availability, drop rocks as needed


 


2 players run a class check to check for summons availability, drop rocks as needed


 


3+ players end helper script


 


the second is to see if the pc is a class with no summons


   If no summons drop 2 rocks where needed.


 


the third is to see if the pc can only create 1 summon.


   if one summon can be made, drop a rock and open a conversation


 


the 4th is to check if the pc can make 2 summons


   if two can be summoned, open a conversation.


 


the conversation script is to send the summons to the plates


 


hey pet


   yes master


go stand over there


   as you wish master (pet(s) moves to switch)


 


i don't even know if this can be done honestly... i looked through many scripts on the vault for this with no luck.


 


i believe i got everything explained here.


               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
help wit a helper script please
« Reply #4 on: May 29, 2014, 03:01:47 am »


               

It can be done, though It's a bit more complicated doing it via conversation, as you have to chunk the process up.


 


One of the main things you need to clarify is, what is a party?   All members of the PCs Party?  What if they're all 10 maps away?  The PCs on the Map?  The PCs in a radius?  Each of those has a different way to count the size of the party.


 


Below is an approach you might be able to try.  Since this represents a number of different scripts tied to a conversation, it's hard to do much more than point you in the right (hopefully) direction.


 


Generally, the conversation should flow as follows:


1.  Determine party size and class ability.  Set the following ints on the door:


  • PartySize

  • SummonsAvailable (the number of summons that the PCs in the party can summon

  • BouldersNeeded:  3-PartySize - SummonsAvailable

  • SummonsNeeded = 3 - PartySize -BouldersNeeded

2.  if BouldersNeeded<=0 && SummonsNeeded <=0, end the conversation.


 


Branch the next section of the conversation:


3.  If SummonsNeeded >1, use a Starting Conditional to return TRUE.  


4.  Else, then create the number of BouldersNeeded at a waypoint in the trigger and set an "occupied" int on the trigger.  Open the door and end the conversation.


 


5.  As answer response to part 3 above - one answer starting conditional to return TRUE if all the SummonsNeeded associates are in the party.  If TRUE, send associates to each waypoint and set the "occupied" int on the trigger.  If FALSE , the answer is "I will try again when my minions are summoned".  


 


6.  As  part of a TRUE to #5 above, check to see if BouldersNeeded.  If so, create them and set the "occupied" int.  Unlock the door, open it,


 


Once the door is opened, you'll need to put in a delay to close it again, lock it, delete the ints on the door and on the triggers.


 


Hope that helps.