Author Topic: Script Triggers vs Dialog variables  (Read 2533 times)

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Script Triggers vs Dialog variables
« on: June 01, 2004, 07:27:18 PM »
Good evening!

Got another question for you all. Here goes.  The script of course has its GLOBAL/LOCALS variables to start the respective section in the J.D file.  If all script/variable conditions are true and I don't chose the valid response but try to reset the script variables to re-execute after its turned down -- is this possible?  I've tried this but I just get a loop though I think I've coded everything correctly - set the intial triggers in the script back to what they're supposed to check for.

ORIGINAL SCRIPT from the Sprite's BCS

IF
  Global("Silverinitbanter","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("Silverinitbanter","LOCALS",1)
    SetGlobalTimer("Siltalk","GLOBAL",TWO_DAYS)
END

IF
  Global("#Silveryy1","GLOBAL",0)
  GlobalTimerExpired("Siltalk","GLOBAL")
  IfValidForPartyDialogue("D#Silver")
  CombatCounter(0)
THEN
  RESPONSE #100
    SetGlobal("#Silveryy1","GLOBAL",1)
    Dialog(Player1)
END

Part of the Sprite's J.D File:

APPEND D#Silver

IF ~Global("#Silveryy1","GLOBAL",1)~ SYouth1
SAY @153
 ]IF ~~ REPLY @154 DO ~SetGlobal("#Silveryy1","GLOBAL",2)~ GOTO SYouth12 //Executes perfectly
  IF ~InParty("Jan")~ REPLY @155 GOTO SYouth2
  IF ~!InParty("Jan")~ REPLY @155 GOTO SYouth3
END

IF ~~ SYouth2
SAY @156
  IF ~~ GOTO SYouth3
END

IF ~~ SYouth3
SAY @157
  IF ~~ REPLY @158 DO ~SetGlobal("#Silveryy1","GLOBAL",0) SetGlobal("Silinitbanter","LOCALS",0)~ GOTO SYouth4 // This is where it's going wrong - script doesn't retrigger though I've tried to reset the script tests
IF ~~ REPLY @159 DO ~SetGlobal("#Silveryy1","GLOBAL",2)~ GOTO SYouth5
END

IF ~~ SYouth4
SAY @160
  IF ~~ EXIT
END

Why, oh why, doesn't this stuff reset after the sprite is turned down so the block retriggers after the two day timer so the sprite pesters player1 again?

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: Script Triggers vs Dialog variables
« Reply #1 on: June 01, 2004, 07:53:09 PM »
You might want to try using ActionOverride("MyNPC",SetGlobal("Silinitbanter","LOCALS",0)) to make sure it gets set on the proper NPC.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: Script Triggers vs Dialog variables
« Reply #2 on: June 02, 2004, 04:29:29 AM »
Thanks - "ActionOverride" is a keyword I've seen in modders' scripts but haven't yet used it myself.  Will take a look now and read what it does.  ;)

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: Script Triggers vs Dialog variables
« Reply #3 on: June 02, 2004, 07:44:47 AM »
It's used to tell an actor, other than the one running the script, to do something.  I use it in my dialogs to set LOCALS variables because in some places I had another NPC interjecting and the variable was being set on that NPC rather than on my NPC.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: Script Triggers vs Dialog variables
« Reply #4 on: June 02, 2004, 08:44:36 AM »
It was initially called from My NPC's script - but I guess the IF ~~ THEN REPLY for Player1 probably screws it up so it needs this ActionOveride.  I'll try it when I get home.  Thanks.

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: Script Triggers vs Dialog variables
« Reply #5 on: June 02, 2004, 05:51:58 PM »
Okay -- just tried it with the ActionOverride suggestion.  I'm still looping but since I'm now in the Copper Coronet I saw the constant pestering by Nalia and this gives me an idea....Nalia, if you turn down her request keeps coming back -- her files should give me an idea how to script and code this.

Thanks.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: