Aller au contenu

Photo

a question about variables and the script generator


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

#1
archer4217

archer4217
  • Members
  • 105 messages
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. :)

#2
Ryuhi2000

Ryuhi2000
  • Members
  • 97 messages
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;
}

#3
archer4217

archer4217
  • Members
  • 105 messages
Thanks sweetie :)

#4
Bubba McThudd

Bubba McThudd
  • Members
  • 147 messages
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.

#5
Ryuhi2000

Ryuhi2000
  • Members
  • 97 messages
no problem

archer4217 wrote...

Thanks sweetie :)