Author Topic: Quests only being done once?  (Read 2360 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quests only being done once?
« Reply #45 on: August 24, 2010, 10:22:32 am »


               Okay this is basically what I want to achieve with this:



1. I want to make it so that multiple players can do the quest (so player one can do the quest and player two can do it aswell)



2. I want to make it so that the quests stack onto the player so that they cannot redo the quest after they have done the quest or after a server reset



That is basically it so far I can remember
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Quests only being done once?
« Reply #46 on: August 24, 2010, 07:07:13 pm »


               Ok. Lets clarify the first part. It is all about the party. So when you say "player one can do the quest and player two can do the quest as well" are you saying that they need to be in the same party or does it matter? Lets say player 1 and player 2 are not in a party together. They can both still walk up and talk to the NPC and do the quest. And the way the scripts are set up currently, if player 1 and player 2 are in a party together they can both still do the quest, but they both need to talk to the NPC and individually accept the quest.
Now, if you want it so that player 1 and player 2 are in a party together and only one of the players needs to talk to the NPC, then player 1 and 2 both get the quest and once the quest is completed, again only one player talks to the NPC but both player 1 and 2 get the xp/reward, then we would need to alter the scripts posted.

When accepting quests and getting rewards for quests in a PW it basically comes in 2 flavors. The individual or the whole party of the individual who is doing the quest. You do run into some obstacles with the whole party method. But it can be scripted with certain conditions, if you want to go that route, to overcome some of those obstacles.

The second thing you want accomplished should already be happening with what I've posted for the persistence.

EDIT:

Who said that I wrote...

my module is as good as finished though only need to get the Subrace
engine I added recently to work like its supposed to and the quests need
to be multiplay-able.

I was reading this from the other thread. Do you already have all the quests finished and you are just trying to make them persistent (and im still not sure what you mean by multiplay-able since you also say you only want them to be done once)? If this is the case you will need to either alter almost every script associated with every quest to use persistence or you will need to replace all scripts with a different system (like what I've posted). Either way there's no easy fix.
               
               

               


                     Modifié par GhostOfGod, 24 août 2010 - 06:47 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quests only being done once?
« Reply #47 on: August 24, 2010, 08:35:00 pm »


               What I mean with that is basically that player one can get a reward for it ONCE, they can help others doing the quest though they will not get a reward for it.

I have not added all the quests yet, made some quests and then I stumbled on this problem.

I am trying to make the quests persistent and make it so that toon 1 can do the quest and so can toon 2.
But I do not want that a player kills the bandit king 100 times for the xp and all that

But about the first part, well how its set up now I am rather satisfied if it worked, It does not matter if they are in party or not. Each PC needs to talk to the NPC to gain their quest/reward
               
               

               


                     Modifié par Who said that I, 24 août 2010 - 07:37 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quests only being done once?
« Reply #48 on: September 13, 2010, 02:03:44 pm »


               I have been trying to work on the module for awhile now, and I am working my way down the list to try and get one of these to work. So far my luck has been bad with it.
               
               

               


                     Modifié par Who said that I, 13 septembre 2010 - 09:24 .
                     
                  


            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Quests only being done once?
« Reply #49 on: September 14, 2010, 04:44:39 am »


               Probably the easiest to use is Knats:
http://nwvault.ign.c....Detail&id=1166

It just uses the regular journal and queries it, so you can look at your various quests.
I do recommend though having a database object on each PC, it's useful for so many things.
One thing about Knat's is once you have done quest you can just pump them out like pop-corn, by just
following the template of the first quest you created.

The database objects in mine keep track of curses, contracts, mounted, contitional things on the PC, including reputation, and quest status.  So I could have ZombieQuest set to 1 and have no more xp awareded if that PC completes the quest with another player.  It's a simple variable check, which could also be used in other ways, friends of the zombie king might not like you for example.
               
               

               
            

Legacy_Arawan

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Quests only being done once?
« Reply #50 on: September 15, 2010, 11:04:10 pm »


               I followed the thread and like the idea for the tagbased scripts you have GoG. However I cant get your _pw_journal_inc to compile ( I have removed the bit you added to enter into OnClientEnter. The error is: _pw_journal_inc.nss: ERROR: NO FUNCTION MAIN() IN SCRIPT

Then I get the option to save as a conditional script instead, and doing that gives this error: _pw_journal_inc.nss: ERROR: NO FUNCTION STARTINGCONDITIONAL() IN SCRIPT



Can you see where I am going wrong?
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Quests only being done once?
« Reply #51 on: September 16, 2010, 12:05:14 am »


               "_pw_journal_inc" is an include script(and for the record it's not mine, it's a system I found on the vault and use). It's not supposed to have a "main()" in it if it is being used correctly. To use the functions in it, you put - #include "_pw_journal_inc" - at the top of your script and then use one of the functions from it. It shows an example at the bottom of the script on how to use those functions (the part you removed).

Hope that helps.
               
               

               
            

Legacy_Arawan

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Quests only being done once?
« Reply #52 on: September 16, 2010, 09:40:58 am »


               So its not supposed to be able to compile at all? I just save it?
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Quests only being done once?
« Reply #53 on: September 16, 2010, 09:54:41 am »


               Well technically it should still compile as long as the script is not placed in any script event. It should just exist in your list of scripts. It doesn't go in/on anything. And yes you would just save it.
               
               

               


                     Modifié par GhostOfGod, 16 septembre 2010 - 08:57 .
                     
                  


            

Legacy_Arawan

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Quests only being done once?
« Reply #54 on: September 16, 2010, 10:01:56 am »


               I have run onto a problem with this, whenever I add the lines to my OnClientEnter script, the module wont load the starting area. removing the lines from the script returns the module to normal behaviour. Could anyone tell me how I am supposed to merge the two?



My OnClientEnter, created by Guile:



/*////////////////////////////////////////////////////////

----------------------------------------------------------

Script Name: gen_client_enter

----------------------------------------------------------

Created By: Genisys(Guile)

Created On: 4/23/08

Updated On: 9/09/09

----------------------------------------------------------

This is my premier OnClientEnter Module Event script

It is set up for single & multiplayer mode!

----------------------------------------------------------

///////////////////////////////////////////////////////////



NOTE: You can remove bann from ALL players, by

destroying the database BANNED from your "database" folder,

also, note that the database is used across any module

you create using this module!



///////////////////////////////////////////////////////////



This script does multiple things, it checks to see if...

If the PC is immortal or level 40 (apply special effects)

If the character they have has been banned. (not a total bann)

If they logged out while dead, if so make them dead instantly!!! '<img'>

If the player is playing a legal character or not...read below..

And if the Player themself have been banned from the module or not..



////////color useage defined///////////



Colors Defined



1 = Red (Bright)    2 = Aqua Marine

3 = Magenta         4 = Purple

5 = Pink            6 = Olive

7 = Peach           8 = Light Grey

9 = Gold            10 = Cyan

11 = Orange          12 = Sky Blue

13 = Lavender        14 = Tan

15 = Light Green     16 = Icy Blue

17 = Deep Blue Sea   18 = Dark Cyan    19 = Pure White (Full Intensity)





Example of use in script..



string sMsg = SetColorMessage(19, "Blah blah..");



This would return:   Blah blah..   (*in pure white)





----------------------------------------------------------

/////////////////////////////////////////////////////////*/



//Redundant Variables Declared

effect eEffect;

int nInt;

object oItem;

object aTarget;

location bTarget;



//Required includes for this script (don't touch!)

#include "x3_inc_horse"

#include "_inc_gen_color_"

#include "nw_i0_plot"



//PROTOTYPE DECLARED (don't touch!)

void SendMessageToAllPC(string sMessage);

void GiveDMItems(object oDM);

void GivePCItems(object oDM);



///////////////////////////////////////////////////////////////////////////



//Main Script

void main()

{



//Declare ALL Major Variables..

object oPC;

oPC = GetEnteringObject();

object oTarget;

oTarget = oPC;

object oPlayer = oPC;

object oPP = oPC;

string sCDKey = GetPCPublicCDKey(oPC, FALSE);

object oToken = GetItemPossessedBy(oPC, "idtoken");

string sName = GetName(oToken);

int nHP = GetLocalInt(oToken, "CURRENT_HP");

int nNHP, nCHP, nHHP, nDHP;

effect eEffect;

int nXP = GetLocalInt(oToken, "CURRENT_XP");

int nCXP = GetXP(oPC);

string sXP;

int y = nCXP - nXP;

int MULTI = GetLocalInt(GetModule(), "multi");

object oP = GetItemPossessedBy(oPC, "_pc_pouch");





////////////////////////////////////////////////////////////////

/*   STILL TESTING THIS...



if(nCXP!=nXP)

{

if(y>=4801) //More than 6 kills at level 40 in 15 seconds TOUGH!

{           //Warn DMs that something fishy is going on!



 sXP = GetName(oPC);

 sXP += " had - ";

 sXP += IntToString(nXP);

 sXP += " XP, but logged in with - ";

 sXP += IntToString(nCXP);

 sXP += " XP - Investigate.";

 SendMessageToAllDMs(sXP);

}

}

*/



//If it's a DM entering...

if(GetIsDM(oPC))

{

AddJournalQuestEntry("dmrules", 1, oPC, FALSE, FALSE);

GiveDMItems(oPC); //Give the DM items..

return;// Stop here!

}



////////////////////////////////////////////////////////////////





////////////////////////////////////////////////////////////////

//Remove plot or immortal from PC if they have it..

SetPlotFlag(oPC, FALSE);

SetImmortal(oPC, FALSE); //Accidents happen '<img'>



////////////////////////////////////////////////////////////////

//Handle PC Items here..





////////////////////////////////////////////////////////////////

//Higher Ground's Legendary leveler



//If in fact it's a multiplayer game...

int MULTI_PLAYER = GetLocalInt(GetModule(), "multi");

if(MULTI_PLAYER)

{

string Script = GetLocalString(oPC, "LetoScript");



   if( Script != "" )

   {

       SetLocalString(oPC, "LetoScript", "");

   }

}

///////////////////////////////////////////////////////////////////////

//Entering Message to All PCs..



//Please leave the credits to the module within the message.



/*



1 = Red (Bright)    2 = Aqua Marine

3 = Magenta         4 = Purple

5 = Pink            6 = Olive

7 = Peach           8 = Light Grey

9 = Gold            10 = Cyan

11 = Orange          12 = Sky Blue

13 = Lavender        14 = Tan

15 = Light Green     16 = Icy Blue

17 = Deep Blue Sea   18 = Dark Cyan      19 = PURE White (FUll Intensity!)



Example sMessage =  SetColorMessage(3, "whatever");

*/



//Colorful Server Message sent to all PCs when they enter the module..

string sMessage;

sMessage =  SetColorMessage(7, "Welcome to a ");

sMessage += SetColorMessage(10, "~ 1.69 / CEP 2.2 Persistant Starter Module ~ \\n");

sMessage += SetColorMessage(7, "For Single Player ");

sMessage += SetColorMessage(7, "or Multi-Player / Online Server Modules \\n");

sMessage += SetColorMessage(12, "Created By ");

sMessage += SetColorMessage(10, "Genisys (Guile) ");

sMessage += SetColorMessage(12, "From 4/22/08 - 7/31/10 !");





//Tell the new visitor..

string sNewb;

string sNewb2;



sNewb = SetColorMessage(12, "If you'd like to ask some questions, contact me at: ");

sNewb += SetColorMessage(10, "galefer003@hotmail.com");



sNewb2 = SetColorMessage(18, "Thanks for using the module & as always, ENJOY!");



string sEnter = GetName(oPC) + " / " + GetPCPlayerName(oPC) + " / " + GetPCPublicCDKey(oPC) + " / " + GetPCIPAddress(oPC) + " Entered." ;

SendMessageToAllDMs(sEnter);

WriteTimestampedLogEntry(sEnter);



string sEnter2 = GetRGB(15,1,1) + GetName(oPC) + " / " + GetPCPlayerName(oPC) + " / " + GetPCPublicCDKey(oPC) + " / " + GetPCIPAddress(oPC) + " Has Entered. </c>" ;

SendMessageToAllPC(sEnter2);



//Float welcome message by..

DelayCommand(12.3, FloatingTextStringOnCreature(sMessage, oPC, FALSE));



if(GetHitDice(oPC)<=6)

{

DelayCommand(14.3, FloatingTextStringOnCreature(sNewb, oPC, FALSE));

DelayCommand(24.3, FloatingTextStringOnCreature(sNewb2, oPC, FALSE));

}



if(oToken !=OBJECT_INVALID && MULTI_PLAYER) //It's a multiplayermodule..

{

if(GetLocalInt(GetModule(), sName))

{

 DelayCommand(7.0,

 FloatingTextStringOnCreature("Welcome back!", oPC, FALSE));

}

//Otherwise set that they have visited the module recently since restart!

else

{

 SetLocalInt(GetModule(), sName, TRUE);

 sNewb = SetColorMessage(9, "Greetings Everyone!");

 if(MULTI_PLAYER)

 {

  AssignCommand(oPC, ActionSpeakString(sNewb, TALKVOLUME_SHOUT));

 }

}

}

else

{

sNewb = SetColorMessage(9, "Greetings Everyone!");

 if(MULTI_PLAYER)

 {

  AssignCommand(oPC, ActionSpeakString(sNewb, TALKVOLUME_SHOUT));

 }

}

//////////////////////////////////////////////////////////////////



object oTag;

location lTag;





//This part is about verifying the Player's name..

//A player must have at least a 2 character name or they are going to

//return with an error!  If they have spaces in their name it will return

//with an error as well, including alt code!

string sPCNM = GetName(oPP);

string sPCNMR = GetStringRight(sPCNM, 2);

string sNC1; string sNC2; string sRNC1; string sRNC2;

int nBad;



//Find the second character of the players name..

sNC1 = GetSubString(sPCNM, 0, 1);

//Find the second character of the players name..

sNC2 = GetSubString(sPCNM, 0, 2);

//Find the last letter in the player's name.

sRNC1 = GetSubString(sPCNMR, 0, 1);

//Find the next to the last letter in the player's name.

sRNC2 = GetSubString(sPCNMR, 0, 2);



/////////////////////////IMPORTANT//////////////////////////////////

//You must make all the "" below into " " to check for legal names

//I turned it off because a lot of my characters have bad names!

//Simply put the cursor between "" and hit the space bar for "" to " "

if(sNC1 ==" ")

{ nBad =1; }

else if(sNC2 ==" ")

{ nBad =1; }

else if(sRNC1 ==" ")

{ nBad =1; }

else if(sRNC2 ==" ")

{ nBad =1; }

else { nBad = 0; }



//See below to activate this system..

////////////////////////////////////////////////////////////////////////////



//Stop here if it's a DM entering...

if(GetIsDM(oPC))return;



////////////////////////////////////////////////////////////////////////////



//The Token System...

if(oToken == OBJECT_INVALID)

{

//This MUST be delayed!

DelayCommand(8.0, ExecuteScript("give_token", oPC));

}



//Give them their starting bag...

if(oP == OBJECT_INVALID)

{

 CreateItemOnObject("_pc_pouch", oPC, 1);

 GivePCItems(oPC);

 //Let's get their starting Information..

 DelayCommand(12.5, ExecuteScript("starting_stats", oPC));

}

else

{

 //Always ensure the PC Has ALL of their PC items...

 GivePCItems(oPC);

}





/////////////////////////////////////////////////////////////////////////////



//Check For Cheating, if it's a Multiplayer Game ONLY!

if(MULTI_PLAYER)

{

DelayCommand(8.0, ExecuteScript("cheat_check", oTarget));

}



//////////////////////////////////////////////////////////////////////

//These function add journal entries by the tag names below

//If you wish to create more, just copy / paste and change

//The tagname which is in "here", and the entry # remains 1 only!

if(MULTI_PLAYER)

{

//AddJournalQuestEntry("rules", 1, oPC, FALSE, FALSE);

//AddJournalQuestEntry("enchantinggems", 1, oPC, FALSE, FALSE);

//AddJournalQuestEntry("spells", 1, oPC, FALSE, FALSE);

//AddJournalQuestEntry("crafting", 1, oPC, FALSE, FALSE);

//AddJournalQuestEntry("server", 1, oPC, FALSE, FALSE);

}



//////////////////////////////////////////////////////////////////////////////

if(MULTI_PLAYER)

{

//For DM Players...

if(GetItemPossessedBy(oPC, "guildpass")!=OBJECT_INVALID)

      {

       //Lets make them concealed 50%

       eEffect = EffectConcealment(50);

       eEffect = SupernaturalEffect(eEffect);

       ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);



       eEffect = EffectHaste();

       eEffect = SupernaturalEffect(eEffect);

       ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oPC);

      }

}



//////////////////////////////////////////////////////////////////////////////

//If a player has been found with an illegal character they will have this item.

//It will prevent them from logging onto your server with that character.

//Note this will only work if you have activated the Anti-Cheat option above!

if(MULTI_PLAYER)

{

   if (GetItemPossessedBy(oPC, "banned")!= OBJECT_INVALID ||

   GetItemPossessedBy(oPC, "char_bann")!= OBJECT_INVALID ||

   GetCampaignInt("BANNED", "ADMIN_BANN", oPC)==2)

  {

  AssignCommand(oPC, ClearAllActions());



  SetCutsceneMode(oPC, TRUE);



  SetCameraMode(oPC, CAMERA_MODE_CHASE_CAMERA);



  DelayCommand(4.0, FloatingTextStringOnCreature("You have an illegal character which is not allowed on this server.", oPC));



  DelayCommand(5.0, SetCutsceneMode(oPC, FALSE));



  DelayCommand(6.0, BootPC(oPC));



  }

}

// */

////////////////////////////////////////////////////////////////////////////



if(MULTI_PLAYER)

{

//Since the player was dead when they logged, kill them!

if (GetLocalInt(oToken, "DEATH_STATE")==TRUE)

  {

   eEffect = EffectDeath();

   eEffect = SupernaturalEffect(eEffect);

   ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

   SendMessageToPC(oPC, "You died because you were dead when you logged out.");

  }



else

{

nCHP = GetCurrentHitPoints(oPC);

//If the player logged out while damaged...

if(nHP != nCHP  && nHP != 0)

{

  if(nHP>=1)

  {

     nNHP = nCHP - nHP;



     eEffect = EffectDamage(nNHP, DAMAGE_TYPE_POSITIVE, DAMAGE_POWER_ENERGY);

     DelayCommand(5.8, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC));

  }

  //Otherwise they must have had less than 1 hit points

  else

  {

    eEffect = EffectDeath();

    eEffect = SupernaturalEffect(eEffect);

    ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

    SendMessageToPC(oPC, "You died because you were dead when you logged out.");

  }



 }

}

}



///////////////////////////////////////////////////////////////////

//Bioware Scripting For Handing Horses (DECATIVATED!!)



/*

   ExecuteScript("x3_mod_pre_enter",OBJECT_SELF); // Override for other skin systems



   if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC))

   { // add horse menu

       HorseAddHorseMenu(oPC);

       if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB"))

       { // restore PC horse status from database

           DelayCommand(2.0,HorseReloadFromDatabase(oPC,X3_HORSE_DATABASE));

       } // restore PC horse status from database

   } // add horse menu

   if (GetIsPC(oPC))

   { // more details

       // restore appearance in case you export your character in mounted form, etc.

       if (!GetSkinInt(oPC,"bX3_IS_MOUNTED")) HorseIfNotDefaultAppearanceChange(oPC);

       // pre-cache horse animations for player as attaching a tail to the model

       HorsePreloadAnimations(oPC);

       DelayCommand(3.0,HorseRestoreHenchmenLocations(oPC));

   } // more details



// DON'T TOUCH THIS LINE!! */





//////////////////////////////////////////////////////

///////////////////////////////

}            //Main Script End

///////////////////////////////

/////////////////////////////////////////////////////





//////////////////////////////////////////////////////////////////////////

//##################### ALL PROTOTYPES  DEFINED ########################//

//////////////////////////////////////////////////////////////////////////





//PROTOTYPE DEFINED

void SendMessageToAllPC(string sMessage)

{

  object oPC = GetFirstPC();

  while(GetIsObjectValid(oPC))

  {

     FloatingTextStringOnCreature(sMessage, oPC);

     oPC = GetNextPC();

  }

}



////////////////////////////////////////////////

//PROTOTYPE DEFINED

void GiveDMItems(object oDM)

{

object oWay = GetWaypointByTag("ref_point");

object oBarrel = GetNearestObjectByTag("gen_dm_items", oWay);

object oCopy = GetFirstItemInInventory(oBarrel);

string sTag;

while(GetIsObjectValid(oCopy))

{

 sTag = GetTag(oCopy);

 if(!HasItem(oDM, sTag))

 {

  CopyItem(oCopy, oDM, TRUE);

 }

 oCopy = GetNextItemInInventory(oBarrel);

}



}



///////////////////////////////////////////////////////

//PROTOTYPE DEFINED



void GivePCItems(object oDM)

{

 object oWay = GetWaypointByTag("ref_point");

object oBarrel = GetNearestObjectByTag("gen_start_items", oWay);

object oCopy = GetFirstItemInInventory(oBarrel);

string sTag;

while(GetIsObjectValid(oCopy))

{

 sTag = GetTag(oCopy);

 if(!HasItem(oDM, sTag))

 {

  CopyItem(oCopy, oDM, TRUE);

 }

 oCopy = GetNextItemInInventory(oBarrel);

}

DelayCommand(3.0, ExecuteScript("pc_item_sort", oDM));

}



               
               

               
            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
Quests only being done once?
« Reply #55 on: September 16, 2010, 01:31:12 pm »


               Haven't looked through the script you posted (and we'd probably need your original script you are trying to add to as well), but my tutorial linked in sig below has a section on both combining scripts together and the use of custom functions/include scripts. Maybe it can shed some light for you.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Quests only being done once?
« Reply #56 on: September 16, 2010, 08:42:25 pm »


               First of all make sure, in the "_pw_journal_inc" script,  that you put in the correct tag and res ref of the item that you want to use to store the quest variables on(this would be the same item that the other posted scripts declare). If the player does not already have the item it will be created on them.

As far as merging the scripts gos, in your script where it has all the includes:

//Required includes for this script (don't touch!)
#include "x3_inc_horse"
#include "_inc_gen_color_"
#include "nw_i0_plot"

Just add one more to the bottom like so:

//Required includes for this script (don't touch!)
#include "x3_inc_horse"
#include "_inc_gen_color_"
#include "nw_i0_plot"
#include "_pw_journal_inc"

Now your script already has the entering object declared and called oPC. So somewhere in your script, I always recommend just above the very last closing curly bracket "}", add the line:
EDIT: Just saw you had other functions at the bottom of your OnClientEnter so it looks like you will want to add the following line just below this line "// DON'T TOUCH THIS LINE!! */":

RestorePersistentJournal(oPC);

That's it. basically all you need to do is add those 2 lines and your OnClientEnter should work as it did before.

P.S. And if your not familiar with how include scripts work then I definitely recommend taking a look at Knightmares tutorials. Posted above. Good stuff.
               
               

               


                     Modifié par GhostOfGod, 16 septembre 2010 - 07:53 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quests only being done once?
« Reply #57 on: September 17, 2010, 10:42:45 am »


               Okay I have been out of it for a lil bit due to my pc was totally crashed.



So I have seen the link of ffbj and I wonder what you mean by that with pumping them out like popcorn?



Ooohhh and that darabase object thingie you have going on sounds very neat, would like to have a check like that but since I am a rather novice scripter I dunno howto XD
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Quests only being done once?
« Reply #58 on: September 17, 2010, 03:47:20 pm »


               I considered that that reference, (pumping them out like popcorn) might be a bit confusing.

It refers to when you go to the theatre and they have that popcorn machine that pumps out the popcorn out of the kettle and into the bin.  So it meant pumping out quests as easily as the popcorn machine pumps out popcorn.



Well the database object is just a permanent undroppable object that the PC gets once usually on client enter.  The script checks to see if the PC has one, if not give them one.  Then you can just use to to store various variables on the PC that you want retained over server resets.



For instance my onclient enter:



#include "_prr_main"

#include "pqj_inc"

#include "x3_inc_horse"



void main()

{

  RebuildJournalQuestEntries(GetEnteringObject());

  object oPC = GetEnteringObject();

  effect eDeath =EffectDeath(TRUE, TRUE);

  object oDatabase = GetItemPossessedBy(oPC, "database");

   object oTorch = GetItemPossessedBy(oPC, "Torch");

   object oHorse = HorseGetHorse(oPC,1);

    object oSpawnPoint1 = GetWaypointByTag ("WP_JailCFB");

   int iHD = GetHitDice(oPC);



 // object oSkin = SKIN_SupportGetSkin();

    HorsePreloadAnimations(oPC);

       if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC))

      { // add horse menu

       HorseAddHorseMenu(oPC);

      }

   if (!GetIsObjectValid(oDatabase))

    {

      // Now create the database on the PC

      CreateItemOnObject("database", oPC, 1);

      CreateItemOnObject("teverglow", oPC, 1);

    }

   HorseIfNotDefaultAppearanceChange(oPC);

  if (GetCreatureTailType(oPC) == 0)

   {

   SetCreatureTailType(14, oPC);

   }

      if (GetLocalInt(oDatabase, "MountI") > 0)

         {

       HorseDismount(TRUE, TRUE);

       HorseRemoveOwner(oHorse);

       DeleteLocalInt(oDatabase,"MountI");

        //delete and dismount

       DestroyObject(oHorse, 1.0f);

        }



 if (GetLocalInt(oDatabase, "Expired") == 1)

         {

     DelayCommand (12.0,(ApplyEffectToObject (DURATION_TYPE_INSTANT, eDeath, oPC, 1.0f)));

     DelayCommand (14.0,SendMessageToPC(oPC, " STILL DEAD! "));

     DelayCommand (100.0, SetLocalInt (oDatabase, "Expired", 0));

         }



   if (GetLocalInt(oDatabase,"NaggingWound") > 10)

       {

    DelayCommand(25.0 + (iHD * 4),  ExecuteScript("naggingwound",oPC));

       }



if (GetLocalInt(oDatabase, "Jailed") == 1)

  {

   DelayCommand(2.2, AssignCommand(oPC, JumpToLocation(GetLocation(oSpawnPoint1))));

   DelayCommand(4.0, FloatingTextStringOnCreature("Incarcerated", oPC, FALSE));

  }



if (GetLocalInt(oDatabase, "Stoned") == 1)

  {

  effect eEffect = EffectSlow();

  effect eEffect1 = EffectParalyze();

  effect eEffect2 =  EffectVisualEffect(VFX_IMP_BREACH);

  effect eEffect3 = EffectPetrify();



  ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 25.0);

  DelayCommand (25.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect1, oPC));

  DelayCommand (50. + (iHD * 5),  ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect2, oPC));

  DelayCommand (100. + (iHD * 10),  ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect3, oPC));

  DelayCommand (100.0, SetLocalInt (oDatabase, "Stoned", 0));

   }





 if (GetLevelByclass(class_TYPE_SHADOWDANCER,oPC) == 0)

   {

 SetLocalInt(oPC, "X1_AllowSD",1);

   }





   PRR_OnClientEnter();

   DelayCommand (10.0, SetLocalInt(oPC,"Safe",1));

   DelayCommand (12.0, DeleteLocalInt(oDatabase,"HovelO"));

   DelayCommand (15.0, DeleteLocalInt(oDatabase,"Pipes"));

   DelayCommand (30.0, DeleteLocalInt(oPC,"Safe"));



}





So you can see that the database object is given to the PC if they don't have one.  Also you can see the script checks for a few variables like Jailed and Stoned on the database object the PC has and various things happen as a result of those variables.  For example if the PC had the Jailed int set 1 they get put back in Jail, or if Stoned curse is on them, i.e. Stoned int set to 1 they start turning to stone.  Just a few examples of how to use a db object.
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Quests only being done once?
« Reply #59 on: September 17, 2010, 08:26:55 pm »


               already have a script like that, GhostofGod gave me a script for that though the rest didn't really worked that well for me unfortunately