Author Topic: a question about variables and the script generator  (Read 475 times)

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
a question about variables and the script generator
« on: March 30, 2011, 07:19:17 am »


               Hi all,

If anyone here has any experience using LilacSoul's script generator, I'd like to ask some questions concerning variables.

Let me set this up so you understand what I want to do.

A PC goes to NPC1 and has a conversation. NPC1 tells the PC to go see NPC2 to get a quest.

NPC2's convo will have 3 nodes. The first 2 will be ordinary yackety-yack. The third node will have a conditional which won't appear unless the PC has a variable that says they already spoke to NPC1.

So, when using the script generator I get 3 choices.
1. Set the local string
2. Set the local integer
3. Set the local float

I'm gonna guess that what I want is an integer?

If so, I'd check that option, put a 0 in the first box and where it says 'to' I make that a 1...which would get set when the PC speaks to NCP1?

Then on NPC2 I'd have a script to check that the PC has a 1 from speaking to NPC1?

Any advice is greatly appreciated. '<img'>
               
               

               
            

Legacy_Ryuhi2000

  • Full Member
  • ***
  • Posts: 159
  • Karma: +0/-0
a question about variables and the script generator
« Reply #1 on: March 30, 2011, 04:58:47 pm »


               you would want to have number 1 on action taken of any node on your first npc just change it from "variable" to the name of your variable and number 2 on the text appears when for the 3rd node of the 2nd npc just change it from "variable" to the name of your variable


1:

void main()
{

object oPC = GetPCSpeaker();

SetLocalInt(oPC, "variable", 1);

}

2:

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

if (GetLocalInt(oPC, "variable") != 1) return FALSE;

return TRUE;
}
               
               

               
            

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
a question about variables and the script generator
« Reply #2 on: March 30, 2011, 09:34:14 pm »


               Thanks sweetie '<img'>
               
               

               
            

Legacy_Bubba McThudd

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +0/-0
a question about variables and the script generator
« Reply #3 on: March 30, 2011, 09:43:30 pm »


               You can also use journal entries to trigger conversation nodes. This has the added advantage that if the player has to leave the game for a week after speaking to NPC1, when he gets back his journal will have a reminder that NPC1 told him to visit NPC2.
               
               

               
            

Legacy_Ryuhi2000

  • Full Member
  • ***
  • Posts: 159
  • Karma: +0/-0
a question about variables and the script generator
« Reply #4 on: March 30, 2011, 10:09:10 pm »


               no problem

archer4217 wrote...

Thanks sweetie '<img'>