MadRabbitX Posted December 17, 2016 Share Posted December 17, 2016 (edited) Is there is a Papyrus syntax guide? Having one of those is always handy. I wasn't scripting for 3 moths, and already forgot syntax for "for" and "when" cycles. But, to be honest i'm looking syntax for a specific thing, which i don't even know an English name, so what i'm looking for, is some kind of a complite syntax guide, with every litle thing discribed in it. For example i'm looking for a Papyrus version of #Define from C++, which is supper helpful thing, when you write a big script.Thank you in advance! Edited December 17, 2016 by MadRabbitX Link to comment Share on other sites More sharing options...
deadbeeftffn Posted December 17, 2016 Share Posted December 17, 2016 Do you know this? http://www.creationkit.com/fallout4/index.php?title=Category:PapyrusUnfortunately, papyrus is far away from a complete programing language :-\ Link to comment Share on other sites More sharing options...
Deleted15964729User Posted December 19, 2016 Share Posted December 19, 2016 Try this, but yeah like most things when it comes to modding these games there aren't much offical information or guides: http://stuyk.com/forum/viewtopic.php?f=7&t=7 EDIT: Check this also: https://community.bethesda.net/thread/8917 Link to comment Share on other sites More sharing options...
Lisselli Posted December 19, 2016 Share Posted December 19, 2016 Do you know this? http://www.creationkit.com/fallout4/index.php?title=Category:PapyrusUnfortunately, papyrus is far away from a complete programing language :-\That's because it's not a programming language. It's a scripting language. There is a difference. It borrows syntax styles from C++ and various other programming languages like Python though. Link to comment Share on other sites More sharing options...
MadRabbitX Posted December 19, 2016 Author Share Posted December 19, 2016 Do you know this? http://www.creationkit.com/fallout4/index.php?title=Category:PapyrusUnfortunately, papyrus is far away from a complete programing language :-\Of curse i'm using it, it is preaty handy. But thank you anyways. Try this, but yeah like most things when it comes to modding these games there aren't much offical information or guides: http://stuyk.com/forum/viewtopic.php?f=7&t=7 EDIT: Check this also: https://community.bethesda.net/thread/8917Thanks for that. There is something that i didn't manage to find myself on the CK wiki. I was hoping for like a complite guide for every single small thing, but this will do too. Thanks. Now i know for the fact that i++, =+, and some other operators is not a thing in the Papyrus. Link to comment Share on other sites More sharing options...
Lisselli Posted December 20, 2016 Share Posted December 20, 2016 Pay special attention to the info about the || operator(OR), as that was misunderstood by a lot of folks in the beginning, including myself. Link to comment Share on other sites More sharing options...
Reneer Posted December 21, 2016 Share Posted December 21, 2016 (edited) Do you know this? http://www.creationkit.com/fallout4/index.php?title=Category:PapyrusUnfortunately, papyrus is far away from a complete programing language :-\That's because it's not a programming language. It's a scripting language. There is a difference. It borrows syntax styles from C++ and various other programming languages like Python though.This is, technically, wrong. Papyrus is a programming language, not a scripting language, because Papyrus PSC files must be compiled to PEX before the game can use them. The PSC files aren't interpreted on the fly as is done in a scripting language. See http://www.creationkit.com/fallout4/index.php?title=Papyrus_Compiler_Reference for more info. And, yes, the CK Wiki likes to call Papyrus a scripting language, but that is disregarding what the differences between a scripted language and a programming language are. Thanks for that. There is something that i didn't manage to find myself on the CK wiki. I was hoping for like a complite guide for every single small thing, but this will do too. Thanks. Now i know for the fact that i++, =+, and some otherÃÃÂ operators is not a thing in the Papyrus. This is incorrect. Papyrus supports assignment operators just fine. See http://www.creationkit.com/fallout4/index.php?title=Operator_Reference#Assignment_Operators for more info. Edited December 21, 2016 by Reneer Link to comment Share on other sites More sharing options...
MadRabbitX Posted December 21, 2016 Author Share Posted December 21, 2016 Thanks for that. There is something that i didn't manage to find myself on the CK wiki. I was hoping for like a complite guide for every single small thing, but this will do too. Thanks. Now i know for the fact that i++, =+, and some otherÃÃÂ operators is not a thing in the Papyrus.This is incorrect. Papyrus supports assignment operators just fine. See http://www.creationkit.com/fallout4/index.php?title=Operator_Reference#Assignment_Operators for more info. You are wrong about that. There is nothing about me being wrong in this link, and i even tested it all. I think you just misunderstood me. ++ -- =+ (not +=, this is working) are not a thing in Papyrus. However, fun fact, while game refuses to comple WeaponSlotBack =+ 1, it does compile with WeaponSlotBack =- 1. I even tested them all separately, nothing is working besidse WeaponSlotBack =- 1. Code: int WeaponSlotBack = 0 Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)WeaponSlotBack++WeaponSlotBack--++WeaponSlotBack --WeaponSlotBackWeaponSlotBack =+ 1WeaponSlotBack =- 1 EndEvent I even made a screenshot. Because i have nothing better to do with my life. :)http://i.imgur.com/qHpp6F5.jpg Link to comment Share on other sites More sharing options...
Reneer Posted December 21, 2016 Share Posted December 21, 2016 You are wrong about that. There is nothing about me being wrong in this link, and i even tested it all. I think you just misunderstood me. ++ -- =+ (not +=, this is working) are not a thing in Papyrus. However, fun fact, while game refuses to comple WeaponSlotBack =+ 1, it does compile with WeaponSlotBack =- 1.  I even tested them all separately, nothing is working besidse WeaponSlotBack =- 1. Code: int WeaponSlotBack = 0 Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)WeaponSlotBack++WeaponSlotBack--++WeaponSlotBack --WeaponSlotBackWeaponSlotBack =+ 1WeaponSlotBack =- 1  EndEvent I even made a screenshot. Because i have nothing better to do with my life. :)http://i.imgur.com/qHpp6F5.jpg You're correct, Papyrus doesn't support those particular operators (though I've never heard of =+, what does it do?), but it functionally supports everything you are trying to do. Link to comment Share on other sites More sharing options...
scrivener07 Posted December 28, 2016 Share Posted December 28, 2016 Incrementors(+=) and decrementors (-=) do exist in Papyrus but they are written the other way around than your used to. You will find the language reference useful, look up the operators.http://www.creationkit.com/fallout4/index.php?title=Category:Papyrus_Language_Reference Heres two samples of equivalent code. Function Sample() int iValue = 1 ; the value starts at 1 iValue += 1 ; the value is 2 iValue += 1 ; the value is 3 iValue += 1 ; the value is 4 iValue += 2 ; the value is 6 iValue += 2 ; the value is 8 iValue += 2 ; the value is 10 iValue -= 2 ; the value is 8 iValue -= 2 ; the value is 6 iValue -= 2 ; the value is 4 iValue -= 1 ; the value is 3 iValue -= 1 ; the value is 2 iValue -= 1 ; the value is 1 EndFunction Function SampleEquivalent() int iValue = 1 ; the value starts at 1 iValue = iValue + 1 ; the value is 2 iValue = iValue + 1 ; the value is 3 iValue = iValue + 1 ; the value is 4 iValue = iValue + 2 ; the value is 6 iValue = iValue + 2 ; the value is 8 iValue = iValue + 2 ; the value is 10 iValue = iValue - 2 ; the value is 8 iValue = iValue - 2 ; the value is 6 iValue = iValue - 2 ; the value is 4 iValue = iValue - 1 ; the value is 3 iValue = iValue - 1 ; the value is 2 iValue = iValue - 1 ; the value is 1 EndFunction Papyrus is a scripting language that is s object oriented in nature. Link to comment Share on other sites More sharing options...
Recommended Posts