Aller au contenu

Photo

Quests only being done once?


  • Veuillez vous connecter pour répondre
70 réponses à ce sujet

#51
Arawan

Arawan
  • Members
  • 24 messages
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?

#52
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
"_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.

#53
Arawan

Arawan
  • Members
  • 24 messages
So its not supposed to be able to compile at all? I just save it?

#54
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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 .


#55
Arawan

Arawan
  • Members
  • 24 messages
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!!! ;)

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 :)



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

//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));

}




#56
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
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.

#57
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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 .


#58
Who said that I

Who said that I
  • Members
  • 492 messages
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

#59
ffbj

ffbj
  • Members
  • 593 messages
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.

#60
Who said that I

Who said that I
  • Members
  • 492 messages
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

#61
ffbj

ffbj
  • Members
  • 593 messages
Sure, that was just an example anyways. You could always check out some of the pre-packaged PW stuff on the vault. Base persistent world Like Vuldrick's or a few others. These worlds already contain many of the base systems you might want to use. Pretty hard to start fooling with some stuff when you really have limited scripting abilities. I know that can be a long, painful, but utlitmately fun and fruitfull process.

Good Luck!

#62
Arawan

Arawan
  • Members
  • 24 messages
Hi GoG,

Thank you for your help, I compiled my OnClientEnter correctly now with your aid.

However my module still freeze whenever I try to log in a player in, and I am almost convinced its the _pw_journal_inc script that is misfiring or at least not working correctly, as it all works when I do not include it. Is there any chance you could look over the one you posted and see if any error has been added by the forum? I did a clean copyy+paste, and cannot get it to compile as either a normal script or the other kind.

Error code 1 from script compiling (When trying to save as normal script (F7)):
19-09-2010 17:03:07: Error. '_pw_journal_inc' did not compile.

_pw_journal_inc.nss: ERROR: NO FUNCTION MAIN() IN SCRIPT


Error code 2 from script compiling (When original attempt fails, and the generator prompts you to try and save as a conditional script instead): 
19-09-2010 17:02:13: Error. '_pw_journal_inc' did not compile.
_pw_journal_inc.nss: ERROR: NO FUNCTION STARTINGCONDITIONAL() IN SCRIPT



Sorry for the late reply, spent the weekend in Paris with the missus.


P.S. Thanks for the link Knightmare, I am reading them right now.

Modifié par Arawan, 19 septembre 2010 - 03:05 .


#63
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Putting too much stuff in the OnClientEnter can cause problems. There are often a lot of timing issues with whether or not the player is fully logged in. Then you need to start putting in delays for stuff and it can get a bit messy.

Really it is best to put a trigger around your modules starting area and use it's OnEnter event for all of your OnClientEnter needs. This way you know the player is fully logged and in an area before anything happens.
Only thing about doing it this way is that you need to add an extra little bit to make sure, that if the player re-enters the trigger for some reason, the script doesn't fire again. You can do this by adding a variable to the player at the end of the script and put a check for the variable at the top of the script. If player has variable...return.

Try that out and see if it works out for you.

Modifié par GhostOfGod, 20 septembre 2010 - 02:21 .


#64
Arawan

Arawan
  • Members
  • 24 messages
Heh it worked! Thx loads GoG.. :)



Now my only problem is figuring out how to create the variable test, lilacs dosent seem to help me here :(


#65
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
@Arawan. Something like this:

void main()
{
object oPC = GetEnteringObject();

int iEnterCheck = GetLocalInt(oPC, "ENTERED_START_LOC");
if (iEnterCheck == TRUE) return;

//all the other stuff here

SetLocalInt(oPC, "ENTERED_START_LOC", TRUE);
}

Modifié par GhostOfGod, 21 septembre 2010 - 11:34 .


#66
Arawan

Arawan
  • Members
  • 24 messages
Thank you GoG.. works like a charm :)

#67
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
I have read this and am trying to use your scripts GOG. Im having trouble with the "ic1" script.If I put it in the text appaers box ,the yes response will not show even if they have the item.."WOLF_PELT".





NPC: Have you found a wolf pelt?



PC: Yes <-------this doesnt show<<<

#68
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
AAH  I figure it out .   the "ic1" script have one small flaw...


int StartingConditional()
{
object oPC = GetPCSpeaker();
if (GetItemPossessedBy(oPC, "WOLF_PELT") != OBJECT_INVALID) return FALSE;
return TRUE;
}


chang it to this

int StartingConditional()
{
object oPC = GetPCSpeaker();

if (GetItemPossessedBy(oPC, "WOLF_PELT") == OBJECT_INVALID) return FALSE;

return TRUE;
}

woot it work ...

#69
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
To save myself from reading back through this and finding the script you are talking about after 4 months, You can use this. 

#include "nw_i0_plot"
int StartingConditional()
{
  return HasItem(GetPCSpeaker(),"TagOfWolf_Pelt");
}


#70
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Lol Lightfoot8...thnx. I was working on other things thats why it has taken me so long to get back to trying quests. I work on something then if I get stuck move and come back when I haved gained more knowledge or information....usually information comes first lol.



Question for COG or anyone else who can answer .



Can I have mutiple quests on one NPC with COG's scripts???

#71
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
An actual separate quest/journal node, no. But you can keep the same node going and sort of fake it.

Modifié par GhostOfGod, 12 janvier 2011 - 12:21 .