Difference between revisions of "Category talk:Conditions"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Falconerd
imported>Falconerd
Line 82: Line 82:


Any help would be appreciated, cheers.
Any help would be appreciated, cheers.
: I have found what I think is the solution. ('''''A''''' OR '''''B''''') AND ('''''A''''' OR '''''C''''') AND ('''''!A''''' OR '''''!B''''' OR '''''!C'''''). I'm going to test this and see if it works. --[[User:Falconerd|Falconerd]] ([[User talk:Falconerd|talk]]) 2015-02-10T22:04:51 (EST)

Revision as of 23:04, 10 February 2015

Passing Conditions to Papyrus

I've found a way to use Conditions in Papyrus.
These are the functions that you find in Conditions interfaces in the CK.

Basically, you get them across to Papyrus via Abilities:

(It is unusual that we can ForceFirstPerson () and ForceThirdPerson () with Papyrus, but we can't determine which camera mode is active.)
In this example, I'll Debug the value of the Condition, IsPC1stPerson:

  1. I create a Scripted Magic Effect for each condition you wish to trigger.
  2. I attach this Script below to it.
  3. I create an Ability and attach that Scripted Magic Effect.
  4. I Conditionalise that Magic Effect on the Ability with IsPC1stPerson.

This is the Script for the Magic Effect:

Event OnEffectStart(Actor akTarget, Actor akCaster)
     Debug.Notification ("IsPC1stPerson = True")
     Debug.Trace ("IsPC1stPerson = True")
 EndEvent
 Event OnEffectFinish(Actor akTarget, Actor akCaster)
     Debug.Notification ("IsPC1stPerson = False")
     Debug.Trace ("IsPC1stPerson = False")
 EndEvent

In the game, everytime the camera mode changes between 1st and 3rd person, I see the appropriate Debug.Notification ().

I've also tested this with IsPCSleeping.
Because Events still execute on Scripts of deactivated mods (re: http://www.creationkit.com/Talk:Save_File_Notes_%28Papyrus%29), I'll be using this method to trigger sleep start and sleep stop events.

You'll need only one Ability.
But you'll need a Scripted Magic Effect for each Condition you wish to keep track.

Also, I can imagine that not ALL conditions would work.
But I can also guess that a lot of them would.

You'll need to give this Ability to the Player, by the way.
And to do this the safest way is to create a Quest, add the Player as an Alias, and add the Ablity as an Alias Spell.
-- Kuertee 07:49, 1 March 2012 (EST)

It would be great if you created a page with this information to go in the Solutions category. I imagine it's a problem a lot of modders run into but few know how to solve.
Oh, and you can use this markup to add syntax highlighting to Papyrus:
<source lang="papyrus">Code goes here</source>
-- Cipscis 15:56, 1 March 2012 (EST)
Done. This is now in the Solutions category.
-- Kuertee 06:23, 2 March 2012 (EST)
I've removed this page from the Solutions category as the non-talk page version has now been added
-- Cipscis (talk) 20:16, 3 September 2012 (EDT)

Comp

In the "Comp" tab in conditions what does "!=" mean? GetTheJojDone (talk) 11:37, 18 January 2013 (EST)

The != operator, for conditions and Papyrus, means 'Not Equal To'. See Operator Reference.
- JustinOther (talk)

Ah right, thanks! GetTheJojDone (talk) 11:52, 18 January 2013 (EST)

Magic Effects and Casters

I'm fairly certain that the information on this page about magic effects is wrong. I have found that the "target" of the effect is the caster, and the subject is the target of the spell. There is no need to check the swap subject and target box. For example, I have a magic effect in a spell that only works if the caster has the right perk. I run the condition function on the target, without checking the box. You can verify this by looking at any Master of the Mind spell effects. Lofgren (talk) 2014-03-12T23:00:14 (EDT)

I have changed the page to reflect this. Lofgren (talk) 2014-03-15T10:41:44 (EDT)

Swap subject and target

I'm slightly confused on the use of this particular option. Can somebody provide an example? What would be the difference between having a condition run on target, and the same condition run on subject but with this option enabled? --Darkitow (talk) 2015-01-17T23:01:52 (EST)

Several conditions that have both a subject and a target (for example, GetLineofSight, IsHostile) have an option in their target drop-down for [Target] but no option to run them on the subject. That means that without this box you would have no way to test if the target has line of sight to the subject, only if the subject has line of sight to the object.Lofgren (talk) 2015-01-17T23:10:21 (EST)

Purple Conditions

Had anyone ever figured out why some conditions turn purple sometimes? Right now I got an GetInFaction condition that is purple in one form and black in another. It's been bugging me to know what this means for forever. --Darkconsole (talk) 2015-02-08T23:33:57 (EST)

Odd number of Conditions

I noticed that all the examples are of an even number of conditions. I am unfortunately having a problem visualising this stuff so I though I'd ask. Essentially, I want to check for this: (A) OR (B AND C). However, as OR is always grouped, I'd get (A OR B) AND C

I know I could make a 4th condition that always returns true and then use the method shown in the examples. However, that ends up being a total of 8 conditions. I hope I'm just missing something very obvious.

Any help would be appreciated, cheers.

I have found what I think is the solution. (A OR B) AND (A OR C) AND (!A OR !B OR !C). I'm going to test this and see if it works. --Falconerd (talk) 2015-02-10T22:04:51 (EST)