Jump to content

scrivener07

Premium Member
  • Posts

    1416
  • Joined

  • Last visited

Everything posted by scrivener07

  1. Thanks ianpatt and xSE team :0 These new features make me very happy :)
  2. Help yourself to a "hello world!" tutorial. http://www.creationkit.com/fallout4/index.php?title=Bethesda_Tutorial_Papyrus_Hello_World and be prepared with actual papyrus questions when your done. The wiki should be your papyrus bible http://www.creationkit.com/fallout4/index.php?title=Category:Papyrus
  3. I dont have enough details about what exactly your trying to even do. Why did you make a new stage that runs at the start? What are these log entries intended for and what are the conditions? Lay out the big picture for me.
  4. Try it on a Quest form with start game enabled. If you create a new quest in the creation kit, it will be setup the way you need without changing anything. Keep in mind too that Sounds have their own conditions in the creation kit. Scriptname Hardcore:HC_VitalEffect_SoundScript extends Quest Actor Player int SoundTimer = 1 const int SoundInstance int Male = 0 const int Female = 1 const Event OnInit() Player = Game.GetPlayer() EndEvent Event OnQuestInit() StartTimer(SoundInterval) EndEvent Event OnQuestShutdown() CancelTimer(SoundTimer) Sound.StopInstance(SoundInstance) EndEvent Event OnTimer(int aiTimerID) Sound.StopInstance(SoundInstance) SoundInstance = SFX.Play(Player) StartTimer(SoundInterval, SoundTimer) EndEvent Group Data Sound Property FemaleSound const auto mandatory {sound to be played for female player} Sound Property MaleSound const auto mandatory {sound to be played for male player} float Property SoundInterval const auto mandatory {how often sound will play} EndGroup Group Sound Sound Property SFX Hidden {returns the sound for the players gender} Sound Function Get() If (IsFemale) return FemaleSound Else return MaleSound EndIf EndFunction EndProperty bool Property IsFemale Hidden {returns true if the player is female} bool Function Get() int iGender = (Player.GetBaseObject() as ActorBase).GetSex() If (iGender == Female) return true Else return false EndIf EndFunction EndProperty EndGroup Sorry for being lazy, I dont know if it compiles.
  5. 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.
  6. I dont know. Maybe your script is an incompatible type. That means if for example your trying to attach a script to a Quest the papyrus manager will only show you scripts that extend "Quest" directly though and script within the Quest script inheritance is valid such as scripts that extend ScriptObject directly. There may also be something about the search string. IIRC the script must already be able to be compiled before you can attach it to stuff.
  7. You put the psc file in Data/Scripts/Source/User/ or if its a vanilla script the source is already provided and there is no need to decompile it.
  8. This, you need permission from the original author. At least to put up a download. You can do what you like for your own use. From TES3 to FNV the plugin format, archive format, scripting language(TES Script), user interface (xml based), and almost everything is completely different to what FO4 uses. After FNV, bethesda did a major revision of their game engine which they named the Creation Engine, also of note they created a new scripting language called Papyrus. Your going to have to create an imitation of that mod from scratch with the FO4 tools. It will definitely not just be a three click port and play. Maybe you can tweak the weapon meshes/textures with some work but I dont know enough about that 3D stuff. The plugin data needs to be remade in the FO4 CK but it should be very similar to the FNV version. But to restate my first point, you need permission from the original author to put up a download. You can do what you like for your own use.
  9. Keywords dont do anything, they are used by things. In the CK right click and select "Use Info". This will show a pop up of everywhere the keyword is used. Some keywords are exposed to the game itself in the DefaultObject category. DefaultObjects pointed to keywords have a description there but for most you will have to figure out how and where they are used.
  10. I think each statement needs to be on its own line. Scriptname Enclavequest001 extends ObjectReference Const Quest Property Enclave001 Auto Const Mandatory Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if (Game.GetPlayer() == akNewContainer) Enclave001.SetStage(20) endIf endEvent
  11. Try creating a project file and batch script to compile your mod. Create a batch script Parameter 1 is the PapyrusCompiler that ships with the CreationKitParameter 2 is the file path to your Papyrus Project File "D:\Games\Steam\SteamApps\common\Fallout 4\Papyrus compiler\PapyrusCompiler.exe" "D:\Games\Steam\SteamApps\common\Fallout 4\Data\YourPapyrusProject.ppj" Create a papyrus project for example YourPapyrusProject.ppj <PapyrusProject> are general compiler settings<Imports> are dependencies yours scripts require to compile themselves. Most scripts require the Base papyrus import. <Scripts> are the individual namespace and scripts to compile for output. These also need there import defiend which is "...\Fallout 4\Data\Scripts\Source\User" for most people. <?xml version='1.0'?> <!-- http://www.creationkit.com/fallout4/index.php?title=Papyrus_Projects --> <PapyrusProject xmlns="PapyrusProject.xsd" Flags="Institute_Papyrus_Flags.flg" Output="D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts" Asm="Discard" Optimize="false" Release="false" Final="false" > <Imports> <Import>D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\User</Import> <Import>D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base</Import> </Imports> <Scripts> <Script>MyScriptName01</Script> <Script>MyScriptName02</Script> <Script>MyScriptName03</Script> </Scripts> </PapyrusProject> Now point all the paths to where you have fallout 4 installed, the project location, your scripts, etc. Double click the batch file to run the thing. If you are trying to configure a build system for a popular text editor then there are some ready made solutions. http://www.creationkit.com/fallout4/index.php?title=Category:Text_Editors
  12. Its says "Failed on -f=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\scripts\Source\Base\Institute_Papyrus_Flags.flg" because your passing your flags parameter as the papyrus script parameter.
  13. You can also papyrus project files with a custom batch script. Here is the compiler build system I use for one of my projects. The first file is the papyrus project (ppj). I keep mine in a sub folder of "...\Steam\SteamApps\common\Fallout 4\" but it can be located anywhere. The other file is the batch script which passes the PPJ file to the papyrus compiler as an argument. This can also be located anywhere. Read more about creating build systems from the wiki. -http://www.creationkit.com/fallout4/index.php?title=Papyrus_Compiler_Reference -http://www.creationkit.com/fallout4/index.php?title=Papyrus_Projects The Papyrus Project D:\Games\Steam\SteamApps\common\Fallout 4\Mods\UserWasteland\Character\Character.ppj <?xml version='1.0'?> <!-- http://www.creationkit.com/fallout4/index.php?title=Papyrus_Projects --> <PapyrusProject xmlns="PapyrusProject.xsd" Flags="Institute_Papyrus_Flags.flg" Output="D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts" Asm="Discard" Optimize="false" Release="false" Final="false" > <Imports> <Import>D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\UserWasteland</Import> <Import>D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\F4SE</Import> <Import>D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\Base</Import> </Imports> <Scripts> <Script>Wasteland\Character\Modification</Script> <Script>Wasteland\Character\Skills\Client</Script> <Script>Wasteland\Character\Skills\Data\Barter</Script> <Script>Wasteland\Character\Skills\Data\Blade</Script> <Script>Wasteland\Character\Skills\Data\Blunt</Script> <Script>Wasteland\Character\Skills\Data\Dummy</Script> <Script>Wasteland\Character\Skills\Data\Exploration</Script> <Script>Wasteland\Character\Skills\Data\Leadership</Script> <Script>Wasteland\Character\Skills\Data\Unarmed</Script> <Script>Wasteland\Character\Skills\Display\SkillProgram</Script> <Script>Wasteland\Character\Skills\System</Script> <Script>Wasteland\Library\Common</Script> <Script>Wasteland\Library\Log</Script> <Script>Wasteland\Testing\Lilac</Script> <Script>Wasteland\Testing\lilac_test</Script> <Script>Wasteland\Testing\mockLilac</Script> </Scripts> </PapyrusProject> Here the import "...\Data\Scripts\Source\UserWasteland" would be "...\Data\Scripts\Source\User" for most people. The Batch D:\Games\Steam\SteamApps\common\Fallout 4\Mods\UserWasteland\Character\Command_Papyrus.bat @ECHO off ECHO Setting batch variables.. REM User REM =========================================================== SET falloutDirectory=D:\Games\Steam\SteamApps\common\Fallout 4\ REM Location Paths REM =========================================================== SET ppj01=Mods\UserWasteland\Character\Character.ppj SET compilePPJ="%falloutDirectory%%ppj01%" REM Start the papyrus compiler REM =========================================================== ECHO Compiling papyrus with %compilePPJ% "%falloutDirectory%Papyrus compiler\PapyrusCompiler.exe" %compilePPJ%
  14. I continued to work on this script for a while and it turned out to be difficult. When the player enters power armor the players base RACE changes to the power armor race. This change makes animation events registered on the Player "HumanRace" invalid. You have to register for animations when the race changes. I found "Event Actor.OnRaceSwitchComplete(Actor akSender)" but I cannot get it to work as expected.
  15. http://www.creationkit.com/fallout4/index.php?title=Enable_Debug_Logging
  16. I havent tested the function or anything but the array reference says setting arrays and passing arrays are passed and assigned by reference.
  17. You can create a property for your script instance directly in the calling script. ScriptName MyTerminal FaultysMenuComponentsScript Property FaultysMenuComponents Auto Const Mandatory Function Foo() FaultysMenuComponents.AddComponents() EndFunction TummaSuklaa advice also works if the script instance you need access to just so happens to be attached to a Quest. ScriptName MyTerminal Quest Property FaultysMenuComponentsQuest Auto Const Mandatory Function Foo() (FaultysMenuComponentsQuest as FaultysMenuComponentsScript).AddComponents() EndFunction
  18. Heres my untested guess. I did not use any recursive pattern. I used a loop pattern involving the current index and length of the array. For each element in "fromArray" I add it to the "toArray". I am not checking for duplicates or none elements. Function CopyTo(var[] fromArray, var[] toArray) Global If (fromArray && toArray) ; does not equal none int idx = -1 While(idx < fromArray.Length) idx += 1 toArray.Add(fromArray[idx]) EndWhile EndIf EndFunction
  19. Ive got to run to work now but maybe you could try adding smoe debug tracing to see if the functions/events are being called. Ive assumed the animation event names are correct but since I havent tested it myself it could be any numbers of mistakes I missed. Hopefully someone else can jump in and help too.
  20. Hows this work for you? Scriptname WeaponFirePenalty extends Weapon string WeaponFireAnimation = "weaponFire" Const int ValueCost = 5 Const ; Maybe a GlobalVariable for customizability? ActorValue Property ValueType Auto Const Mandatory ; you must "fill" this in the CK Event OnInit() Actor kActor = Game.GetPlayer() RegisterForRemoteEvent(kActor, "OnEquipped") RegisterForRemoteEvent(kActor, "OnUnequipped") EndEvent Event ObjectReference.OnEquipped(ObjectReference akSender, Actor akActor) self.RegisterForAnimationEvent(akSender, WeaponFireAnimation) EndEvent Event ObjectReference.OnUnequipped(ObjectReference akSender, Actor akActor) self.UnregisterForAnimationEvent(akSender, WeaponFireAnimation) EndEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) Actor kSubject = akSource as Actor If (kSubject) If !(kSubject.IsInPowerArmor()) ; not in power armor kSubject.DamageValue(ValueType, ValueCost) EndIf EndIf EndEvent its generic enough where you can specify the ActorValue type such as stamina or Health or whatever on the properties window in the CK.
  21. Well not totally paywalled. There is this reference on the autodesk site http://help.autodesk.com/view/SCLFRM/ENU/
  22. I have made a mistake when I said using a condition function would be a good use for custom events, at least in the way I tried to do it. I attempted to use an ActiveMagicEffect on the player with some condition functions to determine if the player is moving backwards (I see no way to test if the player is looking backwards) and then send the event in OnEffectStart. Because of the fact you need an instance of the script to register events on using an ActiveMagicEffect was a bad idea. Sorry to mislead you into thinking I could make an example OnPlayerLookBack. I got confused with SendModEvent from Skyrim which only requires you know the unique string name to register for custom events. I do agree there needs to be better examples of custom events in FO4 but Im at a loss for one that would be easy to explain without an extended tutorial.
  23. That is a pretty good example to implement. I dont know off the top of my head how to get the players camera rotation but I have a hunch it can be done with condition functions. One thing about events though is that you should not be able to ever call on them. Only one script should be able to dispatch them and other scripts should register, listen, and then handle the events. I will double post back when I finish the example (if its possible) :)
  24. Because "akObjectToRemove.HasKeyword(<KeywordNameHere>)" is not valid papyrus code. You dont put statements in double quotes and you cannot use angle brackets in variable names. Compiler errors are the most rookie of problems. If you knew enough about papyrus to say you dont need to post your source then you wouldnt be having compiler errors to begin with. LISTEN to the two pages of experienced scripters telling you what you need to do! POST. YOUR. SOURCE. All of it. Post the EXACT compiler errors from the output windows and stop making yourself absolutely unhelpable.
×
×
  • Create New...