Difference between revisions of "Exists"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Geckbot
m (Robot: Automated text replacement (-\[\[Category:(.*?)Functions\]\] +Category:\1Functions\nCategory:\1Functions (GECK 1.0)))
imported>Ez0n3
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
=='''Description'''==
{{Function
In Combat Dialogue, the target of the conversation is a group member nearby the speaking actor. If no group members are nearby, the target of the conversation is the speaker himself. Because of this, there is a new condition function called the Exists condition function.
|origin = GECK1
|summary = In Combat Dialogue, the target of the conversation is a group member nearby the speaking actor. If no group members are nearby, the target of the conversation is the speaker himself. Because of this, there is a new condition function called the Exists condition function.


[[Exists]] returns 1 if the Self and Target references for the conditions are different, and 0 if not. This allows the dialogue system to tell whether there is a distinct second person to carry on the conversation.  
[[Exists]] returns 1 if the Self and Target references for the conditions are different, and 0 if not. This allows the dialogue system to tell whether there is a distinct second person to carry on the conversation.  
|name = Exists
|returnType = int
|returnVal = 0, 1
|referenceType = [ActorRefID]
|arguments =
  {{FunctionArgument
  |Name = [TARGET]
  }}
|example =
}}


=='''Syntax'''==
==Notes==
[''ActorREF''].Exists [TARGET]
 
=='''Notes'''==
*When using the Exists condition function, you should NOT change the function parameter, it should be left as [TARGET].
*When using the Exists condition function, you should NOT change the function parameter, it should be left as [TARGET].
=='''Examples'''==


===Death dialogue===
===Death dialogue===
Line 44: Line 50:


[[Category:Functions]]
[[Category:Functions]]
[[Category:Functions (GECK 1.0)]]
[[Category:Functions (GECK 1.1)]]
[[Category:Condition Functions]]
[[Category:Condition Functions]]
[[Category:Condition Functions (GECK 1.0)]]
[[Category:Condition Functions (GECK 1.1)]]

Latest revision as of 08:13, 15 January 2011

< [[::Category:Functions|Category:Functions]]

A function included in the GECK version 1.1.0.36.

Description

In Combat Dialogue, the target of the conversation is a group member nearby the speaking actor. If no group members are nearby, the target of the conversation is the speaker himself. Because of this, there is a new condition function called the Exists condition function.

Exists returns 1 if the Self and Target references for the conditions are different, and 0 if not. This allows the dialogue system to tell whether there is a distinct second person to carry on the conversation.

Syntax

[help]
(0, 1:int) [ActorRefID].Exists [TARGET]


Notes

  • When using the Exists condition function, you should NOT change the function parameter, it should be left as [TARGET].

Death dialogue

An example of death dialogue is having the dying actor scream and a nearby group member commenting on their death. Here's how to set up a simple case of that:

  1. Create a new topic that will be used for the response
  2. In the Death topic, add a topic info for the scream and have a Link To the new response topic you created
  3. In the new response topic, add a topic info for the comment( i.e. "Man down!", "Oh my God they killed him!", etc. ).
    • Set the Link From on the new topic info to be the Death topic
    • Add a condition to the topic info that calls the Exists condition function and checks if the return value is 1. This condition item should be set up to run on self, NOT on the target.

The total effect of these changes is that the dying NPC will say a scream, then look for a response in the new topic. It will find the new topic info for the comment and check the Exists condition function. If there is a group member available to comment, Exists will return 1 and the comment will be made. If there is no group member available, Exists will return 0 and the comment will not be said.

By setting it up in this fashion, the scream will be said both when there is and when there isn't another group member around.

Giving commands

Setting up actors to give commands is similar to setting up the Death Dialogue. For example, the FireExplosive topic is used before an NPC fires an explosive weapon. This can be used to say things like "Fire in the hole!" before throwing a grenade. The same topic can be used to have another NPC say "Throw your grenade soldier!". Here's how to set up both cases:

  1. Create a new topic that will be used for the response
  2. In the FireExplosive topic, add a topic info with no text and no sound. In the future, we may add a checkbox that explicitly says that it is a blank topic info.
    • Set the Link To on the blank topic info to be the response topic
    • Add a condition to the blank topic that runs on the target and calls the Exist condition function and checks if it is 1.
  3. In the FireExplosive topic, add another topic info lower on the stack and set the text to "Fire in the hole!"
  4. In the response topic you created before, add a new topic info for the response.
    • Set the text on the response topic info to be "Throw your grenade soldier!"
    • Set the Link From to the FireExplosive topic

The total effect of these changes is that when an NPC goes to throw a grenade, the FireExplosive topic will be triggered. If there is another group member nearby, the Exists condition function will return true and the blank topic info will be chosen to start the conversation. The "Throw your grenade soldier!" topic info will be chosen as the response to that, so in game it will appear that the nearby group member is giving an order to the NPC that started the conversation.

If there is not another group member nearby, the Exists condition function will return 0 so the blank topic will not be chosen. The next topic info in the stack is the "Fire in the hole!" topic info, so that is what will be said.