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

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Quests only being done once?
« Reply #60 on: September 18, 2010, 02:48:18 am »


               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!
               
               

               
            

Legacy_Arawan

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Quests only being done once?
« Reply #61 on: September 19, 2010, 03:58:58 pm »


               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 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Quests only being done once?
« Reply #62 on: September 20, 2010, 03:16:13 am »


               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 .
                     
                  


            

Legacy_Arawan

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Quests only being done once?
« Reply #63 on: September 20, 2010, 10:30:50 am »


               Heh it worked! Thx loads GoG.. '<img'>



Now my only problem is figuring out how to create the variable test, lilacs dosent seem to help me here '<img'>  

               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Quests only being done once?
« Reply #64 on: September 22, 2010, 12:08:20 am »


               @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 .
                     
                  


            

Legacy_Arawan

  • Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Quests only being done once?
« Reply #65 on: September 22, 2010, 04:24:55 pm »


               Thank you GoG.. works like a charm '<img'>
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Quests only being done once?
« Reply #66 on: January 11, 2011, 03:01:28 am »


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

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Quests only being done once?
« Reply #67 on: January 11, 2011, 04:04:11 am »


               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 ...
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Quests only being done once?
« Reply #68 on: January 11, 2011, 04:10:39 am »


               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");
}

               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Quests only being done once?
« Reply #69 on: January 11, 2011, 11:45:07 pm »


               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???
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Quests only being done once?
« Reply #70 on: January 12, 2011, 12:20:04 am »


               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 .