Aller au contenu

Photo

Can you fire a trigger based on a journal node value


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

#1
JonnieR

JonnieR
  • Members
  • 98 messages
I want to trigger a confrontation for the PCs based upon value of the one of the journal nodes. I thought I could construct a trigger that only fired if the node was a certain value. I probably don't enough about how triggers work to do this correctly. But the logicx would be:

If the quest node is  =  200, then trigger custom encounter else do nothing..

If the PCs are victorious in the encounter and obtain a certain object change the quest node value to 210 or some other higher number.

I am use to using gc_journal_node in converstaions, but I quess I would have to actually write a script for this one and I not sure exactly how. Any help would be appreciated.

#2
Guest_ElfinMad_*

Guest_ElfinMad_*
  • Guests
The best thing to do would be to check out a scripting tutorial. _Knightmare_ did one that is on the vault and I think Jassper's website, noobs corner, explains the concepts well.

To start you off, your script would be something like this. Note that this is incomplete and text preceded by "//" are comments.

void main()
{
//get the object that enters the trigger
object oPC = GetEnteringObject();

//if the object is not the player then script should not run
if(!GetIsPC(oPC)) return;

//check the journal entry and do stuff if journal entry is correct
//assuming correct value is 200
if(GetJournalEntry("JOURNAL_TAG", oPC) == 200)
{
//Code that does stuff goes here
}
}

#3
Morbane

Morbane
  • Members
  • 1 883 messages
Also - check out this thread: Ways to learn scripting

#4
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 592 messages
Changing a journal entry does not fire an event. Whatever event sets the journal node to 200 would have to also fire your event.



If you want the event to occur sometime after the urinal node was set to 200 then you probably need to decide when you want it to occur and then use an on enter script or heartbeat script to check for the journal entry value and fire the event.



Regards

#5
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 592 messages
Sorry, urinal should be journal. I'd edit it, but editing doesn't work on iDevices.



Didn't mean to have a potty mouth.



Regards

#6
JonnieR

JonnieR
  • Members
  • 98 messages
Thanks for all the help. I basically took Elfinmad's script example and modified it and it works great.