IsharaMeradin Posted March 22, 2022 Share Posted March 22, 2022 You'll need to make a property for the NPC alias on the stage fragment. After that, the line you last posted should do the trick. Though GetReference() as Actor is faster than GetActorReference(). This is because GetActorReference calls the other. Might as well skip the middleman as it were. Papyrus is an object oriented language and is separate from the game engine. As such it has no knowledge of an form ids or reference ids that might be loaded by the game. It can only work with the information that it is given. Thus forms and references need to be assigned to properties for Papyrus to be able to work with them. The following may be a helpful read if you are still trying to make the switch from Morrowind / Oblivion scripting to Skyrim scriptinghttps://www.creationkit.com/index.php?title=Differences_from_Previous_Scripting Link to comment Share on other sites More sharing options...
xenaclone Posted March 22, 2022 Share Posted March 22, 2022 (edited) Nice, thanks for the answer. :cake: I'll let you know if I can make it work. I got that line of script from one of Bethesda's own quests, but I also notice the alias was used not for a physical NPC, but for a Leveled Actor, which appears as an M in the Render window. So I am going to (try to) make the Alias have its own Property, and then try typing Alias_aaaNPCAliasName.GetReference() as Actor.kill() Edit: You certainly have a lot of mods, IsharaMeradin. Goodness. Edited March 22, 2022 by xenaclone Link to comment Share on other sites More sharing options...
xenaclone Posted March 23, 2022 Share Posted March 23, 2022 (edited) Getting back to ya here. Nothing works. :sad: I added the NPC into a property so now he's got a Property AND an Alias. I used that original line of code .. Alias_aaaNPCAliasName.GetActorReference().kill() and it compiles okay, but still does not work. I don't know to arrange GetReference() As Actor without error messages. How does that line of code get arranged with the rest? Alias_aaaNPCAliasName.GetReference() as Actor.Kill() = ERROR. I tried it without any spaces. ERROR. So I think I'm typing it wrong, is what I"m saying. Edited March 23, 2022 by xenaclone Link to comment Share on other sites More sharing options...
IsharaMeradin Posted March 24, 2022 Share Posted March 24, 2022 Make sure the property is pointing to the alias that the actor is assigned to. Here is the syntax:(ActorAliasPropertyName.GetReference() as Actor).Kill() Link to comment Share on other sites More sharing options...
xenaclone Posted March 24, 2022 Share Posted March 24, 2022 Thanks Pale Redguard. Hope I'm not coming across as whiney! Link to comment Share on other sites More sharing options...
manlethamlet Posted March 26, 2022 Share Posted March 26, 2022 I'm having problems with making a tactical map, like those maps of Skyrim you see in the civil war camps with all the little flags in them. I placed all the flags in the CK and they showed up in game. Since the map is part of a setup that is enabled during a quest, I attached the map and flags to my enable parent and they enabled just fine and showed up normally. When I found out that you can't independently enable/disable objects with an enable parent (I want a couple of locations to switch colors after other quests), I removed them from the parent and made sure to enable them separately. Ever since then, none of the flags become enabled... I managed to fix it temporarily by duplicating all of them and deleting the originals (made sure replace them everywhere they were used), but only the rest of the flags, those under the parent, would enable. And after changing some of the other objects under the same parent, all the flags refuse to enable again. What's happening here? In fact, I'm playing right now after duplicating them all again, and while at first they were enabled, they later despawned after leaving and coming back. Link to comment Share on other sites More sharing options...
LimesBlue Posted April 28, 2022 Share Posted April 28, 2022 I am importing meshes from a Mod Resource Pack and want to know if there is a faster way or if multiple can be done at one time rather than creating each new mesh individually Link to comment Share on other sites More sharing options...
xenaclone Posted January 11, 2023 Share Posted January 11, 2023 (edited) Never mind, solved. Edited January 12, 2023 by xenaclone Link to comment Share on other sites More sharing options...
xenaclone Posted January 12, 2023 Share Posted January 12, 2023 (edited) Double post Edited January 12, 2023 by xenaclone Link to comment Share on other sites More sharing options...
LegallyBlindGamer727 Posted January 14, 2023 Share Posted January 14, 2023 Ok, I'm not good at logic or scripting but I just want to make a simple gift giving system for my follower using my own global variables and formlists. After looking up examples and things on the CK website, I was able to kind of cheat my way into finding something that kinda has what I'm looking for. So, I'm trying to put it into a dialogue event in a quest but it wont compile for me. I'm doing it more or less exactly how the example shows with a few changes since i want the items to be a mystery for the player to guess at Actor Property PlayerREF Auto FormList Property FoodList Auto Bool hasBeenFedToday = False Function FeedCompanion() AddInventoryEventFilter(FoodList) ShowGiftMenu(True, FoodList, False, False) RemoveAllInventoryEventFilters() EndFunction Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If akSourceContainer == PlayerREF RemoveItem(akBaseItem,aiItemCount) If !hasBeenFedToday hasBeenFedToday = True EndIf EndIf EndEvent aside from referencing my own variables and lists. Maybe I'm trying to do too much in one script or am adding too many functions or formlists to use but it just isn't working. I've racked the site for the parts that are giving the error and how to fix them but it only says You can use a FormList as the item parameter - in this case, the function removes the count for each item in. Which i can only assume I've done at the begnning of the script Either no one has this issue or has tried to make a customer relationship system for their followers before. I'd like to make my own code to an extent and not scalp off of others mods but idk. It keeps saying RemoveItem is not a function or does not exist. Do I need to put define in a function somewhere? Isn't it already defined earlier on in Form ak Baseitem or ObjRef ItemRef? ScriptName Dan_GiveGifts Extends QuestBool GiftGivenToday = FalseFormList Property Dan_HatedGifts AutoFormList Property Dan_LikedGifts AutoFormList Property Dan_DislikedGifts AutoFormList Property Dan_LovedGifts AutoGlobalVariable Property Dan_RelPoints AutoActor Property PlayerRef Autobool Function HasForm(Form akForm) nativeEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If Dan_LikedGifts.HasForm(akBaseItem) ;only work with items on our list If akSourceContainer == PlayerREF Dan_LikedGifts.RemoveItem(akBaseItem,aiItemCount) ;he likes it so he'll keep it If !GiftGivenToday == False GiftGivenToday = True EndIf Dan_RelPoints.Mod(1) EndIf EndIf If Dan_LovedGifts.HasForm(akBaseItem) ;only work with items on our list If akSourceContainer == PlayerREF RemoveItem(akBaseItem,aiItemCount) ;he likes it so he'll keep it If !GiftGivenToday == False GiftGivenToday = True EndIf Dan_RelPoints.Mod(2) EndIf EndIf If Dan_DislikedGifts.HasForm(akBaseItem) ;only work with items on our list RemoveItem(akBaseItem,aiItemCount) ;HOW he hates it so he'll drop/delete it? If !GiftGivenToday == False GiftGivenToday = True EndIf Dan_RelPoints.Mod(-1) EndIfEndEvent Link to comment Share on other sites More sharing options...
Recommended Posts