Difference between revisions of "Bendu and S M Nodes"
→The Trigger
imported>Lmstearn m (→Introduction) |
imported>Lmstearn |
||
Line 117: | Line 117: | ||
{{InDepth|The long line of code beginning with ''QF_GSQ01_01000D62'' looks scary. | {{InDepth|The long line of code beginning with ''QF_GSQ01_01000D62'' looks scary. | ||
Here we | Here we replace the (empty) reference of ''tempGSQ01'' with the reference we ''got'' from ''GetGSQ01'', | ||
a reference which is, in fact, directed toward our quest object, ''GSQ01''. | a reference which is, in fact, directed toward our quest object, ''GSQ01''. | ||
Consider ''QF_GSQ01_01000D62'' as a "type". It's type is that of '''script | Consider ''QF_GSQ01_01000D62'' as a "type". It's type is that of '''script'''.}} | ||
For a better picture of how script objects are organized in the CK, check out [http://www.creationkit.com/Category:Script_Objects this]. | If the line in ''Send_Story()'' were just | ||
<source lang="papyrus"> | |||
QF_GSQ01_01000D62 tempGSQ01 = GetGSQ01 | |||
</source> | |||
That would be the same as: | |||
<source lang="papyrus"> | |||
QF_GSQ01_01000D62 tempGSQ01 = GetGSQ01 as Quest | |||
</source> | |||
The "as" operator is called a '''cast''' and the following statement looks for something in GSQ01 to "match" the '''script''' object ''QF_GSQ01_01000D62'': | |||
<source lang="papyrus"> | |||
QF_GSQ01_01000D62 tempGSQ01 = GetGSQ01 | |||
</source> | |||
Unfortunately Quest doesn't match and it won't compile because there is no implicit casting of ''GetGSQ01'' to ''QF_GSQ01_01000D62'' | |||
It's also worth noting that code with such methods of casting only operate within '''Function'''s. | |||
{{ProTip|For a better picture of how script objects are organized in the CK, check out [http://www.creationkit.com/Category:Script_Objects this].}} | |||