khazerruss Posted August 7, 2016 Share Posted August 7, 2016 How to create a new papyrus event? Link to comment Share on other sites More sharing options...
radiumskull Posted August 7, 2016 Share Posted August 7, 2016 (edited) Not sure if you can. I think this is for Skyrim: http://www.creationkit.com/fallout4/index.php?title=Custom_Papyrus_Events But this says you can't create new Events in FO4 Papyrus: http://www.creationkit.com/fallout4/index.php?title=Differences_from_Skyrim_to_Fallout_4#Events Edited August 7, 2016 by radiumskull Link to comment Share on other sites More sharing options...
scrivener07 Posted August 8, 2016 Share Posted August 8, 2016 You can definitely create new events. There is a little bit of plumbing you have to setup first. When and what kind of event are you creating. Here is some of the documentation as radiumskull has already provided you. http://www.creationkit.com/fallout4/index.php?title=Custom_Papyrus_Eventshttp://www.creationkit.com/fallout4/index.php?title=Events_Reference Link to comment Share on other sites More sharing options...
paulatreides0 Posted August 8, 2016 Share Posted August 8, 2016 I actually had a very similar question. I am trying to run a script that necessitates a type of "onequip" event, but it needs to store the equipped item and the actor, not just one or the other. So it would be something like: "Event OnHeavyWeaponEquip(Actor akActor, Form akBaseObject). Is this possible? And if so, how would I do it? I've looked at all the custom event creation material, but I still have no idea. I know I can define a custom event, but how to do anything else but define I am completely lost on. Link to comment Share on other sites More sharing options...
scrivener07 Posted August 8, 2016 Share Posted August 8, 2016 ScriptName MyModNamespace:PlayerReloadedScript extends ReferenceAlias ; Fields ;--------------------------------------------- ; this is the event delegate, it internally manages a list of scripts to invoke when the event is sent. CustomEvent InitializeEvent ; Methods ;--------------------------------------------- Event OnAliasInit() OnPlayerLoadGame() EndEvent Event OnPlayerLoadGame() Utility.Wait(5.0) SendCustomEvent("InitializeEvent") ; send an event whenever the player reloads the game. EndEvent ScriptName MyModNamespace:MyScript extends Quest MyModNamespace:PlayerReloadedScript Property ScriptInstance Auto Const Mandatory ;We need an instance of the script that contains the delegate we want to register on. ; Methods ;--------------------------------------------- Event OnQuestInit() If (ScriptInstance) RegisterForCustomEvent(ScriptInstance, "InitializeEvent") EndIf EndEvent Event MyModNamespace:PlayerReloadedScript.InitializeEvent(MyModNamespace:PlayerReloadedScript akSender, var[] arguments) Debug.Trace(self + " got the event from " + akSender) EndEvent This is a super bad example of an event because theres already plenty of other ways to get the player game reload event. So dont really forward along events that are already available. But I did here to keep it SIMPLE :) Link to comment Share on other sites More sharing options...
paulatreides0 Posted August 8, 2016 Share Posted August 8, 2016 ScriptName MyModNamespace:PlayerReloadedScript extends ReferenceAlias ; Fields ;--------------------------------------------- ; this is the event delegate, it internally manages a list of scripts to invoke when the event is sent. CustomEvent InitializeEvent ; Methods ;--------------------------------------------- Event OnAliasInit() OnPlayerLoadGame() EndEvent Event OnPlayerLoadGame() Utility.Wait(5.0) SendCustomEvent("InitializeEvent") ; send an event whenever the player reloads the game. EndEvent ScriptName MyModNamespace:MyScript extends Quest MyModNamespace:PlayerReloadedScript Property ScriptInstance Auto Const Mandatory ;We need an instance of the script that contains the delegate we want to register on. ; Methods ;--------------------------------------------- Event OnQuestInit() If (ScriptInstance) RegisterForCustomEvent(ScriptInstance, "InitializeEvent") EndIf EndEvent Event MyModNamespace:PlayerReloadedScript.InitializeEvent(MyModNamespace:PlayerReloadedScript akSender, var[] arguments) Debug.Trace(self + " got the event from " + akSender) EndEvent This is a super bad example of an event because theres already plenty of other ways to get the player game reload event. So dont really forward along events that are already available. But I did here to keep it SIMPLE :smile: So as to not hijack someone else's thread, do you mind if I PM with any questions I have? Link to comment Share on other sites More sharing options...
scrivener07 Posted August 8, 2016 Share Posted August 8, 2016 Id prefer a public thread but I do respond to PMs. Link to comment Share on other sites More sharing options...
paulatreides0 Posted August 8, 2016 Share Posted August 8, 2016 Id prefer a public thread but I do respond to PMs. Ah, okay. If I have any questions I'll open up a public thread then. Link to comment Share on other sites More sharing options...
khazerruss Posted August 8, 2016 Author Share Posted August 8, 2016 (edited) I don't understand.I'm not sure that's what I ment. Lets work on example: So.. Lets say that I want to create an event:Event name is "OnPlayerLookBack"The event triggers whenever player rotates the camera between 160 to 200 degress.The event must be able to be called in any script by typing "Event OnPlayerLookBack()" How do you do that?Can you write it here? Edited August 8, 2016 by khazerruss Link to comment Share on other sites More sharing options...
scrivener07 Posted August 8, 2016 Share Posted August 8, 2016 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) :) Link to comment Share on other sites More sharing options...
Recommended Posts