Difference between revisions of "Enable"

From GECK

m
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Link to TES4 Construction Set Wiki: [http://cs.elderscrolls.com/constwiki/index.php/Enable Enable].
+
{{Function
 
+
|CSWikiPage = Enable
'''Syntax:'''
+
|origin = GECK1
  Enable ''[FadeIn]''(1 by default)
+
|summary = Enables the calling reference if it was previously disabled. Enabled references are rendered, and enabled actors will process their AI.
 
+
|name = Enable
Enables the calling object if it was previously disabled with [[Disable]].
+
|arguments = {{FunctionArgument
Objects are enabled by default, which means they are rendered in the game, and if they are actors, will process their AI.
+
  |Name = FadeIn
 +
  |Type = Int
 +
  |Optional = y
 +
  |Value = Default = 1
 +
  }}
 +
|example = TerminalRef.Enable
 +
TerminalRef, if previously disabled, will be enabled.  Because the ''[FadeIn]'' parameter was not set, TerminalRef will fade in by default.
 +
}}
 +
TerminalRef.Enable 0
 +
With the parameter set as '0', the object will not fade in.
  
 
==Notes==
 
==Notes==
*When applied to an enable parent the ''[FadeIn]'' will not get passed to the children.  The "Enable" command will just get called on them, which fades in by default (''[FadeIn]'' set to 1).
+
*If multiple references should share an enable state, [[Reference#Enable_Parent|Enable Parenting]] should be used so that [[Enable]] only needs to be called once in order to affect the enable state of all appropriate references.
**In order for the children to Pop In (Instead of fade in which is the default for the Enable command) you must go to each child and, under the enable parent tab, check the "Pop In" checkbox.
+
*If [[Enable]] is called on a reference with an [[Reference#Enable_Parent|Enable Parent]], it will have no effect.
*If "Enable" is called on a reference with an "Enable Parent", it will have no effect.
+
*When applied to an enable parent the ''[FadeIn]'' parameter will not be passed to the children.  [[Enable]] will be called on them, which fades in by default (''[FadeIn]'' set to 1).
 +
**In order for the children to Pop In (Instead of fade in which is the default for [[Enable]]) you must go to each child and, under the enable parent tab, check the "Pop In" checkbox.
  
=='''See Also'''==
+
==See Also==
[[Disable]]<br>
+
*[[Disable]]
[[GetDisabled]]
+
*[[GetDisabled]]
 +
*[[Reference#Enable_Parent|Enable Parent]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Functions (GECK 1.1)]]
 
[[Category:Miscellaneous Functions]]
 
[[Category:Miscellaneous Functions]]
 
+
[[Category:Miscellaneous Functions (GECK 1.1)]]
The above page didn't really help me, I had a lot of trial-and-error creating objects that appear only when you do a specific action. For instance: A trophy getting added to your Megaton Home when you get acquire and achievement, so I'm going to write a tutorial for that:
+
1. You're going to want to make an xmarker, these can be found in World Objects -> Static, '''tick the "Initially Disabled" box'''
+
2. Change the "Reference ID" on the xmarker by double-clicking the XMarker you placed.
+
3. Create the object you want to enable when you do a specific action (in this case, getting an achievement)
+
4. Double click the object you just placed and scroll over to "Enable Parent"
+
5. Click "Select Reference in Render Window and select your xmarker, if you want you can do the same for other objects, those objects will also get enabled once your first prop does.
+
6. Go to ActorData and select the quests and select the "Achievement Quests", if you look a little below the questID box you'll see a "..." button next to the script name, click it.
+
6,5. I personally just make another script and copy/paste the Achievement's script into it to avoid conflicts with other mods. If you want to do that you have to create another quest, tick the "Start Game Enabled" box and select the script from the drop-down menu.
+
7. In your new (or old) script find the achievement you want so that when you earn it you enable your prop, if you don't know what achievement does what you can check [http://www.xbox360achievements.org/game/fallout-3/achievements/] for a full list, note that you won't find any quest-achievements here, I'll get on that subject later in this tutorial.
+
8. I'm going to use the "Slayer of Beasts" achievement here, where you have to kill 300 beasts, this is the OLD script:
+
;Slayer of Beasts
+
If CreaturesKilled == 0
+
If GetPCMiscStat "Creatures Killed" > 299
+
AddAchievement 42
+
Set CreaturesKilled to 1
+
endif
+
endif
+
 
+
This is the new script:
+
;Slayer of Beasts
+
If CreaturesKilled == 0
+
If GetPCMiscStat "Creatures Killed" > 299
+
AddAchievement 42
+
Set CreaturesKilled to 1
+
                '''[YOUR XMARKER'S REFERENCE ID HERE].enable'''
+
endif
+
endif
+
Don't use the "[ ]" in your script.
+
 
+
9. Okay, let's say you want something to enable once you complete ANY quest, can be official or your own, or even someone else's with his permission, repeat stages 1 through 5 here,
+
10. Go to ActorData -> Quests and find the quest ID you're looking for, if you know the in-game name of the quest but not the ID scroll a little to the right untill you come to the "Name", find your quest here, be sure not to click the "Dialogue, Fin etc." versions of the quest.
+
11. Go the the "Quest Stages" tab of that quest and click the final stage of the quest, these are generally near the bottom, if the quest has the "Complete Quest" box ticked, that's the final stage, some multiple-choice quests have 2 stages with the complete quest box ticked, go over to the "Result Script" box and click "Edit"
+
12. Find the "addachievement XX" line and put your "[xmarker reference ID here].enable" right under that.
+
 
+
And you're done, I hope this helped in any way!
+
-Alexander Sigurdsson
+

Latest revision as of 07:31, 15 January 2011

Link to TES4 Construction Set Wiki: Enable.

A function included in the GECK version 1.1.0.36.

Description

Enables the calling reference if it was previously disabled. Enabled references are rendered, and enabled actors will process their AI.

Syntax

Enable FadeIn:Int{Default = 1}

Example

TerminalRef.Enable

TerminalRef, if previously disabled, will be enabled. Because the [FadeIn] parameter was not set, TerminalRef will fade in by default.

TerminalRef.Enable 0

With the parameter set as '0', the object will not fade in.

Notes

  • If multiple references should share an enable state, Enable Parenting should be used so that Enable only needs to be called once in order to affect the enable state of all appropriate references.
  • If Enable is called on a reference with an Enable Parent, it will have no effect.
  • When applied to an enable parent the [FadeIn] parameter will not be passed to the children. Enable will be called on them, which fades in by default ([FadeIn] set to 1).
    • In order for the children to Pop In (Instead of fade in which is the default for Enable) you must go to each child and, under the enable parent tab, check the "Pop In" checkbox.

See Also

Personal tools