[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
IceBlinkEngine.com • View topic - Getting a result back from a script

Getting a result back from a script

Discuss the IceBlink Toolset

Getting a result back from a script

Postby sidermaniac » Tue Jan 07, 2014 3:16 am

Hello:
In the conversation editor, I want to check the alignment of the conversing PC and condition the script accordingly. I add a condition to the node and use the script gcCheckAlignment (I am going by memory for the script name, I am not at my IB computer) with the proper parameters to search for a particular alignment. However I don't know how to retrieve the result from the script. In other words I know how to initiate the check for alignment, but I don't know how to determine the result of that check.
Do I create a variable and if so how do I assign it the result of the checking script?
Also on a related note, I am a little confused as to variables. Could someone please define what is a global variable, and what is a local variable? I am familiar with what variables in general are, so just enlighten me on the defined scope of the two different kinds in IB.

Thanks
User avatar
sidermaniac
 
Posts: 41
Joined: Sun Dec 22, 2013 6:05 am

Re: Getting a result back from a script

Postby youngneil1 » Tue Jan 07, 2014 7:40 am

User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Getting a result back from a script

Postby sidermaniac » Tue Jan 07, 2014 8:26 am

Thanks, you cleared up some things.
I was misunderstanding the parameters description at the top of the script. When you said the script returns only true or false, it came clear.
In order to check if the pc is 'good' param. 1 = -1, param. 2 = 0, param. 3 = 1. Used as a condition to the node, the node only executes if the pc is 'good'.
I noticed that in Red Carnival, you use a lot of variables in conversation nodes. What is a typical use for a global variable?
User avatar
sidermaniac
 
Posts: 41
Joined: Sun Dec 22, 2013 6:05 am

Re: Getting a result back from a script

Postby youngneil1 » Tue Jan 07, 2014 10:33 am

You're welcome :) In RedCarnival I use these globals to track the state of a conversation and direct the flow if it. Checks for such globals block off conversation parts that I place higher in the tree (closer to root node). This way the conversation parser skips those conversation nodes, kicking in much deeper in the tree. Later on, upon returning to that conversation and once the globals are set to the right values, the conversation parser will then stop at these higher nodes and play those lines. Basically it's a system of switches controlling when to show which nodes. Soem of these globals are influenced by answers in the same or other conversations, some might be influenced by IBs trigger sytsem (e.g. upon entering a certain loacation). It's a very flexible system :) .
User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Getting a result back from a script

Postby slowdive » Tue Jan 07, 2014 12:25 pm

Karl pretty much hit it on the nail. One other thing to mention is that if the "gc" check is made on a NPC node and fails, the next NPC node directly down will then be checked until one of the NPC nodes either passes a "gc" check or has no conditional "gc" check. If the "gc" check is made on a PC node, the PC node will only be displayed if the "gc" check returns true otherwise that PC node will be hidden and not available as a response option. The IB conversation system concept was mostly "borrowed" from my experience with NWN2 :P and works almost identically to it.
User avatar
slowdive
Site Admin
Site Admin
 
Posts: 3174
Joined: Wed Nov 21, 2012 11:58 pm


Return to General Toolset Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron