Difference between revisions of "User talk:Dwarduk"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Cipscis
(→‎Form.HasKeyword: new section)
imported>Dwarduk
 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:


-- [[User:Cipscis|Cipscis]] 18:05, 7 February 2012 (EST)
-- [[User:Cipscis|Cipscis]] 18:05, 7 February 2012 (EST)
:Thank you very much for the prompt response!  So would it work if I did, for instance:
<source lang="papyrus">KeyWord property ArmorCuirassKeyword auto
;...
if (akBaseItem.HasKeyword(ArmorCuirassKeyword))
; do stuff
endif
</source>
:Well, trying that now.  Do I have to call the variable a specific name, as I'm trying to check a pre-existing keyword already on some items?  &mdash; [[User:Dwarduk|''<span style="font-family: 'Calibri', Sans-Serif;">dwarduk</span>'']] ([[User_talk:Dwarduk|T]]/[[Special:Contributions/Dwarduk|C]]) 18:09, 7 February 2012 (EST)
:: It shouldn't need a specific name, although I've heard that if you give it an editorID as a name its default value will be set to the form with that editorID, so if you're only planning on doing this with one keyword then that might be a good choice. Other than that, you can treat a property pretty similarly to a variable.
:: Remember that you'll need to assign the correct form as the value of the parameter in the dialogue window for whatever your script is attached to.
:: Also, it is possible to do this without using a property, provided that the Keyword being used is a parameter of an event or other function, like akBaseItem in your example.
:: -- [[User:Cipscis|Cipscis]] 18:14, 7 February 2012 (EST)
:::Ok, got it, I think.  I'll read through the tutorials tomorrow as it seems quite different to Oblivion scripting to me.  Thanks for all the help :)  &mdash; [[User:Dwarduk|''<span style="font-family: 'Calibri', Sans-Serif;">dwarduk</span>'']] ([[User_talk:Dwarduk|T]]/[[Special:Contributions/Dwarduk|C]]) 18:24, 7 February 2012 (EST)

Latest revision as of 18:24, 7 February 2012

Testing my signature — dwarduk (T/C) 17:40, 7 February 2012 (EST)

Form.HasKeyword[edit source]

In Papyrus, forms can no longer be referred to directly by editorID. Instead, you need to make a property, and assign the form as the value of that property. For example:

KeyWord property MyKeyWord auto

You can then use that property as a parameter of Form.HasKeyword

-- Cipscis 18:05, 7 February 2012 (EST)

Thank you very much for the prompt response! So would it work if I did, for instance:
KeyWord property ArmorCuirassKeyword auto
;...
if (akBaseItem.HasKeyword(ArmorCuirassKeyword))
; do stuff
endif
Well, trying that now. Do I have to call the variable a specific name, as I'm trying to check a pre-existing keyword already on some items? — dwarduk (T/C) 18:09, 7 February 2012 (EST)
It shouldn't need a specific name, although I've heard that if you give it an editorID as a name its default value will be set to the form with that editorID, so if you're only planning on doing this with one keyword then that might be a good choice. Other than that, you can treat a property pretty similarly to a variable.
Remember that you'll need to assign the correct form as the value of the parameter in the dialogue window for whatever your script is attached to.
Also, it is possible to do this without using a property, provided that the Keyword being used is a parameter of an event or other function, like akBaseItem in your example.
-- Cipscis 18:14, 7 February 2012 (EST)
Ok, got it, I think. I'll read through the tutorials tomorrow as it seems quite different to Oblivion scripting to me. Thanks for all the help :) — dwarduk (T/C) 18:24, 7 February 2012 (EST)