Jump to content

FlashyJoer

Premium Member
  • Posts

    191
  • Joined

  • Last visited

Everything posted by FlashyJoer

  1. Thanks for the confirmation! :) My only true concern is persistence, but I feel so long as the script is running, which it should as its attached to a quest alias that never stops/restarts, there shouldnt been an issue. I did perform a test with an NPC where they approached, we spoke and then they didnt approach me again, as they had the keyword assigned and thus didnt meet the ref alias fill conditions. I went to Red Rocket (from Sanctaury) and experienced the lull a laptop gives on cell loading - the actor was unload I assumed. But, my debug notices told me on array refresh that actor was in the array and keyword was found and removed. And upon returning to SH, he immediately approached me, so I assume there is persistence due to the script continually running with the actor in the array... At least, that is my hope and takeaway from witnessed events...
  2. So... the above code works and works exactly as I was hoping! Leaving this here for future searches... and less hair pulling.
  3. While it should in theory work, sadly it appears not to and I have no idea why it is not. Regardless I have now switched from using a formlist to creating an array out of the actors. Actor[] Approachers ReferenceAlias Property ApproachREF auto Event OnInit() Approachers = New Actor[0] Starttimergametime(0.5,1) Endevent Event OnPlayerLoadGame() Starttimergametime(0.5,1) EndEvent OnTimerGameTimer(int TID) If TID == 1 Int index = 0 While Index < Approachers.length Actor Verify = Approachers[index] If Verify.HasKeyword(Approacher_KYWD) Verify.RemoveKeyword(Approacher_KYWD) Endif Utility.Wait(0.1) index += 1 Endwhile Utility.Wait(0.5) Approachers.Clear() Utility.Wait(0.1) StartTimerGameTime(0.5, 10) Endif Endevent {Ref Alias Fill Function} Quest.stop() Quest.start() If Quest.IsRunning() Actor John = ApproachREF.GetReference() as Actor John.AddKeyword(Approacher_KYWD) Approachers.Add(John) Else Debug.trace("Quest did not fill alias") Endif More or less, this is the new hope to add the keyword to the ref alias NPC so that on next ref fill, they will not be chosen until such a time as the game time timer runs out and runs through the array to clear keywords from indexed actors and then flush the array. For those who need to know if THIS works, I will report back...
  4. I believe I will have to go with the scripting solution, which is less than optimal, as the IsInList is definitely looking at the formlist to see if the BASE Object of the form is in the list. Which isnt what I want at all... so, I have come up with an alternate means, by way of a little hackery and I wonder if someone with knowledge of arrays could look at this flow: 1. In NPC approach, they talk to you, I add a keyword to the form and then add them to the formlist. 2. Quest stops, restarts and one condition is now to look for the keyword, instead of the formlist. That should work without question for filling the ref alias with someone OTHER than the first NPC who approached. But how to clear the keywords from the forms in the formlist, I asked myself and then I came up with this idea. Using the same timer that I was using to REVERT() the formlist (removing script added forms), I will use an array instead, as follows and this is where I need confirmation that what I am coding will work... Int index = 0 Actor[] ClearList While Index < FL_Approachers.getsize() If FL_Approachers.Find(ClearList[index]) > -1 If ClearList[index].HasKeyword(Approacher_KYWD) ClearList[index].RemoveKeyword(Approacher_KYWD) FL_Approachers.RemoveAddedForm(ClearList[index]) Endif Endif Utility.Wait(0.1) index += 1 Endwhile My hope is that what this does is go through the formlist one index at a time, check the form at index 'x' for a keyword. If present, remove keyword and then remove added form... Wait... if I remove the added form, that will reset the indexes. Best to just remove the keyword and then go to the next index. Once all indexes are exhausted in the formlist and the endwhile finished, thats where I should put the FL_Approachers.Revert() command I think... If noone chimes in, I suppose I will return with results...
  5. The plot thickens, and I only update this with personal findings for other down the road who may have the same question - my need is still very much relevant. But... if you add an actor to the formlist, you can query the formlist on the papyrus level, ie: I can tell the script to stop the quest with the attached reference alias if the actor is in the formlist via 'If AliasFill.hasForm(Johnny)'. And when I do this, I know have: if aliasfill.hasform(johnny) quest.stop() return else aliasfill.addform(johnny) endif So when the NPC approaches me via their attached travel to player package and I interact with them, it adds them to the formlist. When the dialogue terminates, the quest is stopped and the alias flushed. That quest will restart based on a timer and when it does restart, it will NOT select this NPC and will instead, as shown above, just stop the quest and wait for the timer to restart it. Okay, so this works... but - the alias is set to find nearest actor in the loaded cell to the player, so this as a general rule will not work because in this code, it never looks for the next nearest, it simply stops and waits for restart. So I think forms added to a formlist are only accessible from a script level, whereas the IsInList condition on the refalias is looking at the BASE EDITOR level, which is empty as I created an empty formlist.
  6. I should add that GetFormID() is no good either, as you cannot simply add an integer to a formlist according to the compiler. Again, unless I am missing something... Now, if I try this: Actor John = NPCJohn.GetReference() as Actor; this is needed for other functions in my script ObjectReference Johnny = John.GetbaseObject() as ObjectReference AliasFills.AddForm(Johnny) Utility.Wait(0.1) if AliasFills.HasForm(Johnny) Debug.Notification("Johnny added to FormList") endIf It compiles... no clue if it will actually work ingame yet, but I am thinking not due to the whole non-world object reference of Base Object...
  7. Hi all, got a vexing one. I have a blank formlist Ive made in the CK. I have a ref alias that fills in the mod fine. Papyrus adds the ref alias to the formlist and a verification if/notification/endif fragment shows the NPC has been added to the formlist. Now the ref alias has condition IsInList <myformlist> == 0, meaning only select the NPC if they are NOT currently in the formlist. Per wiki: IsInList This function takes a FormList as a parameter and returns 1 if the reference's base object is a member of the FormList or 0 if it is not. My issue is and I am hoping someone can help, even through the ref alias is added to the formlist and my script verifies the added form is present, I fear the form is NULL after the ref alias stops or more precisely, it no longer references the NPC who was supposed to be added. I see behavior that corroborates this because even though a test NPC is added to the list, per my script, on the next fire of the ref alias fill, that same NPC is selected even though, by rights, they shouldnt be. So, I am thinking its due to the ref alias formID is getting added, which is no longer valid once the quest stops, ahead of restarting. Now, Ive wracked my brains trying to get at the actual formid of the NPC and NOT the ref alias to add to the form, but I just cannot figure out how to get there. GetBaseObject is no good as that will just get the Base from the CK and not the world populated NPCs form. I've tried GetLeveledActorBase but it does not seem to want to compile unless I add .getrace, issex, etc, which is not what I want. GetName is no good either, because SETTLER is quite common. So the ask is... HOW do I get the formID of the ACTOR and not the ref alias to add to the formlist? Is this possible? Is it a matter of persistence? I would figure settler NPCs would be persistent anyways, but yes... stumped. ideas / help / solutions? Many thanks!
  8. As a mod author who uses MCM, I must say it is brain-dead easy to make your own, whether for your own mod or someone else's - you just need to know what global variables you will be adjusting. My flagship mod, RSE (not on the Nexus) uses an MCM that has 10 distinct pages with over 100 user controls and it has never caused me any grief to add new items to it as I go nor has it caused problems within the mod itself. It just comes down to a simple fact - does the mod NEED an MCM and does it have global variables you can modify with toggles and sliders?
  9. Use 'STATES'. By using states you can have multiple EVENTS of the same type in a single script. I will refer you to the script attached to the water fountain "Vault_WaterFountain01" - script name: drinkfromfountainscript. You can see below how they are nested within OnBeginState events: State waiting ;turn off fountain (slow) when entering the waiting state Event OnBeginState(string asOldState) debug.trace(self + " OnBeginState waiting, from " + asOldState) BeginDrinking() EndEvent ;On activate start drinking Event OnActivate(ObjectReference akActionRef) debug.trace(self + " OnActivate: WAITING") If akActionRef == Game.GetPlayer() myPlayer = game.getPlayer() drinkTime = 1 amountDrunk = 1 GotoState("drinking") EndIf EndEvent endState State drinking Event OnBeginState(string asOldState) debug.trace(self + " OnBeginState drinking, from " + asOldState) ;turn on fountain (fast) SetAnimationVariableFloat("fDampRate", 0.08) SetAnimationVariableFloat("fToggleBlend", 1.0) ;wait for water flow FountainStart.play(self) utility.wait(0.25) ;drink for 1 sec (1 drinktime) ;drinkingSound.play(self) while drinkTime > 0 utility.wait(1.0) ;add spell fx for each drink spellOnDrink.Cast(myPlayer) ;play drinking sound drinkingSound.play(self) ;decrement drinktime drinkTime = drinkTime-1 endWhile utility.wait(0.5) Tutorial.SetStage(500) ; if this is furniture, loop while in it if GetBaseObject() is furniture && IsFurnitureInUse() GotoState("looping") else GotoState("waiting") endif EndEvent ;if you spam the button while drinking... Event OnActivate(ObjectReference akActionRef) debug.trace(self + " OnActivate: DRINKING") If akActionRef == Game.Getplayer() DrinkAgain() EndIf EndEvent endState
  10. Still stuck and nothing I do fixes this... all other mods that use MCM hotkeys are working fine and I have cloned their every step to no avail - I cannot get my mod to activate a function when hotkey is pressed even though the MCM registers the fact that the hotkey is set and recorded to the keybinds.json in the settings folder. Has noone ever created hotkeys for their mod using MCM that can help?
  11. I am still having zero luck with this... I hope Registrator2000 sees this and can help out. :)
  12. So I am trying to set up hotkey usage in a mod. I've got the keybinds.json set properly, as well as the section in the config.json. When I open my MCM in-game, I can select a hotkey and it is recorded into the settings/keybinds.json as expected and the MCM remembers the hotkey I chose. But when I try to press this key ingame, nothing happens. I am using a string property declaration to obtain the value of the ID for the hotkey in the MCM, as follows: String property MCMHotkeyID = "MCMHotKey" autoreadonly And then I am using an OnControlDown Event, as shown in the MCM help wiki (note that my keybinds is a SendEvent type to the proper mod and formid for the quest that the script is attached to - it is the ONLY script attached to that formid). EDIT: I have also tried using an OnControlUp event as well, to no avail... Event OnControlDown(String sKey) If sKey == MCMHotKeyID Debug.Notification("Key Press Registered!") Endif EndEvent Even this little test does nothing - no message displays. So I ask of anyone with insight into the hotkey setup in MCM, am I missing something / got something wrong on the papyrus side of this, since I can verify the actual MCM is recording the hot key selected? In any source code I could find where people are using hotkeys, they all seem to be working with just this, so I am stumped... Appreciate the help!
  13. Its super simple! Using a potion as a delivery mechanism for the magic effect is a great way to do it but carries the caveat that it could be triggered multiple times on the player and those debuffs start stacking up - in one of my mods, a debuff was stacking upwards of 10 times on the player, making a -20 penalty to charisma... HUGE problem to be aware of. If you use spells to deliver the effect though, the No Recast checkbox works (it does not for potions) which prevents the spell from running on the player when they already suffer the magic effect in question. Either way you go, create the delivery mechanism, add an effect to it with a magnitude and duration and away you go! Obviously you need to have the magic effect created first, otherwise you cannot add it to the delivery system. And be VERY mindful of how the delivery system is made, ie: Fire and Forget / Self. If you effect is not the same, you will not be able to add it to the spell/potion.
  14. Never... when I need to apply refs to a series of available NPCs I usually create up to 10 separate refs on the quest with conditioning to not select NPCs with a particular faction applied to them. Because I apply the faction to them as an alias faction. In this way, I can find say, the 10 closest NPCs to the player and make them all do the same thing and have the same package/faction. I may be doing it very inelegantly though, but it does work...
  15. As soon as the magic effect is applied to the player, it will add itself to the pipboy effects tab and add the pill icon to the UI. You need to be sure the spell AND effect are both named (or potion if you are going that route) in order for the pipboy effect to list properly. Also, you can add keywords to the potion / spell so that the pill icon can be changed. Just right click in the keywords box and filter search for orange or red or yellow - these are the colored pills from survival mode. Applying these keywords to the item makes the pill color change on the UI.
  16. Examine the Knockout Framework - it adds bodies to inventory and then back into the game world when you drop them. Would be a great place to start looking for ways to do it...
  17. Making the package have an owner quest and then assigning that package to the ref alias is how I do it. So if your quest with the ref alias is called 'CollectionQuest', make this the owner quest in the package window. Then, in the actual ref alais, in the alias packages box, right click, select ADD and find your package. As soon as the ref alias is filled, whoever fills it has the package applied. You could also add an oninit() script to the ref alias, so that the moment it is filled, this script is ran on the actor(s). Something like: Event OnInit() Self.EvaluatePackage() EndEvent Which literally just forces the actor to re-evaluate their package stack the moment they are filled into the ref...
  18. If the Fallout4.esm is listed as the only master in FO4Edit, you will be fine. The CK will not allow .ESPs to be made into master files on your mod. The textures for the leaves are just that, textures. Youre good. Carry on!
  19. I think the OP doesnt want to record both... if so, just add a condition to the dialogue entry: GetIsSex (male or female) == 1 That should limit the recording to either male or female player voice files.
  20. Awesome! Thank you both! As always, I am humbled to learn new things from those with the skills :)
  21. Hi all, I have an OnHit event set up that tells me if the player has been hit by an explosion - this works, no problem but I would like to refine it to say by WHAT explosion. Is it possible to limit to 'form akSource' to a specific formid? Many thanks for insight... Right now the script fragment looks like: If akTarget == PlayerREF && (akSource as explosion) ... Endif
  22. Maybe in between shutting down the one quest and starting the new one in your code, forcerefto from the old refalias to the new one? I dont know if that will work, but its a thought... NewRef.ForceRefTo.(OldRef)
  23. This is a fragment, and all it is doing is setting the value of the global variable "extrameatchance" to 0. Im sure if you get to this point in your testing and then open the console up and type "getglobalvalue ExtraMeatChance" the result will be 0.00. Thats all this code snippet does... and if the result IS 0.00, then it is working exactly as you coded it. But here's the question... which stage did you set this fragment on? And do you ever in your main script or in dialogue set stage to this fragment stage? IE: in a playerREF script, do you 'QuestName.setstage(xx)' to set to the stage where the fragment in? If not, this is why you see nothing...
  24. Yep, exactly. The wait function literally waits until time is reached and them moves to the next line of the script.
  25. Wish Id known about that function back then... would have made my life easier! LoL!
×
×
  • Create New...