SKKmods Posted November 8, 2022 Share Posted November 8, 2022 >If I wait until the bleedout ring recovers them, that objective marker of a combat settler needing a stimpak stays forever, When a combat settler enters bleedout with no self recovery they are added to a quest RefCollectionAlias whos members are map marked so the player can actually find 'em. They are not removed until the healing function is called either by the healing perk or trade dialog. Link to comment Share on other sites More sharing options...
NeinGaming Posted November 8, 2022 Author Share Posted November 8, 2022 Oh, I didn't mean to call that a bug or anything! But that answers why it only happens sometimes: depending on whether Combat Settlers or the ring handles the OnEnterBleedout event first. So I'll set bleedout recovery to false right away, when the item goes into the inventory, and instead of letting people get up after 5 mins, it'll kill them if they're still in bleedout ^^ Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 9, 2022 Share Posted November 9, 2022 To *create* a ReferenceAlias ("PiperAlias") you literally have to do work in CK and specifically create a quest, yes. The original idea was that RefAliases work better in general and will perhaps be more likely to send events (for no valid reason, plain actors should also work, but it is what it is). ReferenceAliases aren't ObjectReferences per se, they merely contain them and they can in turn be fetched using .GetRef() or .GetReference() on the RefAlias. (Companion.GetRef()) You can borrow RefAliases from other quests and scripts if they are accessible whenever you run your scripts (i.e. quest is running, refalias is available and or filled, whichever is the criteria for your idea). You can use RefAlias "Companion" from FollowerScript.psc in your script to get free access to a refalias on your current companion without doing CK-work, but you will have to do parallel checks to see whether you currently have Piper as companion if this is required by your idea. An application of the above could look something like thisFollowersScript FScript ; FollowerScript as variable, you can create a property alsoEvent OnInit() RegisterForRemoteEvent(FScript.Companion, "OnKill") ; FollowerScript.Companion is a referencealias property on FollowerScript that holds your current companionEndEventEvent ReferenceAlias.OnKill(ReferenceAlias WhoDunnit, Actor akVictim) If (WhoDunnit.GetRef() == Game.GetForm(0x2F1E)) ; Do the stuff EndIfEndEvent Link to comment Share on other sites More sharing options...
NeinGaming Posted November 10, 2022 Author Share Posted November 10, 2022 Using Followerscript as variable I get Cannot call Companion() on a None object, aborting function callWhen I add it as a property, do I leave the FormID at null? Or would I need to do that properly in CK? But hey, I wouldn't go so far as to say I have an idea ^^ Generally, I want to make something that allows settlers and maybe other NPC to gain "experience" on kills and basically randomly level up, getting stat points, some base health, perks. But that obviously shouldn't be an item I have to give to them beforehand, having things in item form seems like a really simple, somewhat confined way for me to test and play with things.But for companions, what I actually want in the long run is something like perk mags. Basically, something they "consume" when you give it to them, gaining something. So if I can't get OnKill to work for them it would be no biggie. It just made me curious because to my beginner mind, OnKill should work like the other events. What I really need to do is check out the source and general workings of mods I'm playing with, which I know work well, and just observe and learn. And maybe just download all mods I can find that have to do with followers, decompile all the scripts and search for OnKill ^^If I find something, I'll report :) Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 10, 2022 Share Posted November 10, 2022 A quick heads up first -- I think I've been typing FollowerScript when it should be FollowerSScript As for your error:"Companion" shouldn't be a function in this case, i.e. no "()". If you want to include it in a function call it's "FollowersScript.GetScript().Companion". Did you try to wrap it in some kind of function called "Companion"? No CK-wrangling of RefAliases on your part will be necessary in this very specific case unless you want more control. If you want to create a property out of FollowersScript (for further use milliseconds later):FollowersScript Property FScript Auto ; that's it ...And then access the ReferenceAlias "Companion" this way: FScript.Companion The ReferenceAliases do have FormIDs but you won't need them when you acquire them as property from another script, and probably never in any scenario.I bet you're thinking of the ObjectReference for Piper, which is something *enveloped by* the ReferenceAlias. It is wrapped up by it, like a skin suit. You only have to worry about that when it's time to do the checking:If FScript.Companion.GetRef() == Game.GetForm(0xPipersNumber) -- (this is a cheat way of accessing ObjectRefs btw, I don't think GetForm() was built to handle Refs, only Forms, but it works.) "GetRef()" reveals which ObjectReference is currently limping around in the skin suit.Btw, If you're interested in quick-and-dirty ways of injecting scripts directly into refs, items, actors (sounds like something that could suit your needs since you'd rather stay away from CK), I made a Global Injection function that works through console but could be made to work other ways as well (Aiming at ref then using hotkey). Will paste it in a comment in a sec. Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 10, 2022 Share Posted November 10, 2022 Anti-CK-injectors: Function Inject (String ScrpName) Global var[] arguments = new var[1] arguments[0] = ("APS " + ScrpName) UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.BGSCodeObj.executeCommand", arguments)EndFunctionFunction AimInject(String ScrpName) Global var[] arguments = new var[1] arguments[0] = ("PNR") UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.BGSCodeObj.executeCommand", arguments) Utility.Wait(0.2) arguments[0] = ("APS " + ScrpName) UI.Invoke("Console", "root1.AnimHolder_mc.Menu_mc.BGSCodeObj.executeCommand", arguments)EndFunction Link to comment Share on other sites More sharing options...
NeinGaming Posted November 10, 2022 Author Share Posted November 10, 2022 A quick heads up first -- I think I've been typing FollowerScript when it should be FollowerSScript No, that's not it I double checked. "Companion" shouldn't be a function in this case, i.e. no "()". If you want to include it in a function call it's "FollowersScript.GetScript().Companion". Did you try to wrap it in some kind of function called "Companion"? No, I have it as you put it, RegisterForRemoteEvent(FScript.Companion, "OnKill")Yet I get an error as if I had called a function, but that's a lie, I swear xD As for the question about the property, I meant when I add the property in FO4edit to the script, in addition to typing it in the script itself. Of course, I just did that because I saw it elsewhere. But I get the same error when using it as a plain variable instead of a property, so that's probably neither here nor there. Btw, If you're interested in quick-and-dirty ways of injecting scripts directly into refs, items, actors (sounds like something that could suit your needs since you'd rather stay away from CK) Thank you so much, I will bookmark this, as I did so many other things here already. Is there also a way to undo that? You're right in that I kinda "just wanna code", but I already have the impression this plain isn't like "normal" programming often is, in that you can carve out your little niche of things you understand, and use and wrappers for them, to gleefully ignore how all the rest works (as long as it works). So sooner or later I will need to get CK to run, and learn a whole lot of basics. I feel like I'm trying to read a book through a keyhole. But I still will to avoid CK where I can, I mean, just those off-hand comments in youtube tutorials... "while it's generating previs data, don't check your email, because the CK sometimes hangs when you do something else"... I truly salute all you people using it to bring us all these wonderful things, no sarcasm. Link to comment Share on other sites More sharing options...
RaidersClamoring Posted November 10, 2022 Share Posted November 10, 2022 Ah I see. Well it's behaving in ways and for reasons I can't decipher from here I'm afraid. For some example uses of FollowersScript in other scripts, check Advanced Animation Framework. I think I'll let dagobaking and others take it from here. Nothing beats Tested And Working.https://www.nexusmods.com/fallout4/mods/31304?tab=files With APS, no, you can't uninject the ref I'm afraid, you can set the scripts up so that all variables are nullified at some desired point and then block the script from re-initiating, which it otherwise will the next time you load the cell (or game, for player), with one final Bool "If ignore == true --> (don't do stuff)" or something. Link to comment Share on other sites More sharing options...
Recommended Posts