DrakeTheDragon Posted January 23, 2017 Share Posted January 23, 2017 Well, if I recall correctly, chests can just be remote-activated from everywhere in the world regardless of where they are themselves. So whenever you want to open your chest, just issue "<your-chest-editor-id>.activate player" or something along that line from inside your script, and the container dialog for your chest should open. (Activate works a little different than what you would expect. You don't say who activates what but what is activated by whom, so "<your-chest-editor-id>" is activated "by the player". You can also omit the who-activated-it part of the call, as activators which don't interact with their openers, like doors, switches, or some such, don't really need a reference to who activated them. But in your case it's required, of course, as not only the player can open a chest.) Maybe you'll have to first move the chest into your area, by issuing a "<your-chest-editor-id>.moveTo player" or something along that line before you can activate it, but I think to recall that wasn't needed. Link to comment Share on other sites More sharing options...
bomo99 Posted January 23, 2017 Author Share Posted January 23, 2017 (edited) so this part "<your-chest-editor-id>.activate player" would be on the spell script correct?Now im getting an issueSyntax error. Invalid Reference 'The Storage name here'(Only object references and reference variables are allowed in this context)when i copy the midas chest remote script type but if i change it to magic effect same thing happens and this is my code for itscn ChestsummoningBEGIN onActivate'The Storage name here'.activate player 0End Edited January 23, 2017 by bomo99 Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted January 23, 2017 Share Posted January 23, 2017 Uhm, well, this 'The Storage name here' is the same as my <your-chest-editor-id>, just a placeholder, nothing to be used literally like you did. In its place you have to put the EditorID of the container you want to open. If your container's EditorID is for example "LowerClassChest01" (not an actual existing ID as far as I know, but you get the drift), what you have to enter in that line is LowerClassChest01.activate player I don't know if you need this "0" they're using there, or if not using it at all wouldn't be exactly the same here, but it's not like you can't just try out both ways and see if any one works differently in the end. Link to comment Share on other sites More sharing options...
bomo99 Posted January 23, 2017 Author Share Posted January 23, 2017 (edited) the editor id i have for the chest that i want to put as the target is this DremoreCache(Editor id) but i keep getting the erroralso i now have an issue with the armor when i give it to a female companion i get thisi have isolated the problem to the mask but nothing seems to be wrong in the nif file or through the construction setEdit: nvm fixed it it was a problem with the construction set i got it fixed Edited January 23, 2017 by bomo99 Link to comment Share on other sites More sharing options...
bomo99 Posted January 23, 2017 Author Share Posted January 23, 2017 (edited) this is what i putscn ChestsummoningBEGIN onActivateDremoreCache.activate playerEnd and i keep getting this Error---------------------------Script Error---------------------------Script 'Chestsummoning', line 4:Syntax error. Invalid reference 'DremoreCache' (only object references and reference variables are allowed in this context).---------------------------OK ---------------------------i tried object and magic effect type of script and thats what i get Edited January 23, 2017 by bomo99 Link to comment Share on other sites More sharing options...
Surilindur Posted January 23, 2017 Share Posted January 23, 2017 (edited) Is the DremoraCache a container that you have placed in the world, and that is marked as "persistent" (there is a checkbox). The container needs to be a reference (an instance of its base object) placed in the gameworld. The reference needs to be marked as "persistent", and the reference needs to have a unique Editor ID, and you need to use the reference Editor ID in your script (not the base object Editor ID for example). Hopefully that make sense. If you want to use a magic effect script, then you could use it a bit like this: scriptname ChestSummoningSpellScript begin ScriptEffectStart ; this is the start block if you want to do something here, ; like playing visuals as below (uncomment of you want to test them) ; they are called on the ref on which this spell effect script runs, ; presumably only player at the moment ;PlayMagicShaderVisuals effectEnchantMysticism 2.0 ;PlayMagicEffectVisuals DSPL 2.0 end begin ScriptEffectFinish DremoraCacheRef.Activate PlayerRef ; activate the reference by its editor ID endGood luck with your mod! :thumbsup: Edit: Oooops. Removed a variable from the script. Edited January 23, 2017 by Contrathetix Link to comment Share on other sites More sharing options...
bomo99 Posted January 23, 2017 Author Share Posted January 23, 2017 (edited) thank you so much the code you gave workedbut now i am trying to have the player read a book to get the spell but unfortunately when i do this scn ChestGiver Begin OnActivatePlayer.addspell DMRChestEndwhen you read the book you dont get the spell Edited January 23, 2017 by bomo99 Link to comment Share on other sites More sharing options...
bomo99 Posted January 24, 2017 Author Share Posted January 24, 2017 i dont wanna go to far with my mod until i can get the Book script fixed but i wanted to create a summon spell that summon a npc (that i made for the summon) here is the codescn DMRSummonDremoreref casterref summonedbegin scripteffectstartset caster to getselfset summoned to caster.placeatme DMRDremore, 1, 32, 1summoned.moddisposition caster 100summoned.pme zdreendbegin scripteffectupdateif summoned.getdead == 1summoned.removemeendifendbegin scripteffectfinishif summoned.isactor == 1summoned.removemeendifendnow i gave the npc 3 Ai packagesaaaCreatureExterior1500AllowFallsaaaCreatureInterior512AllowFallsFollowPlayerbut when i summon it, it just wanders and doesnt follow the player also if you resummon it before the timer runs out you can get 2 summons when i want it to act like a normal summon. can anyone help me fix this issue. Link to comment Share on other sites More sharing options...
Surilindur Posted January 24, 2017 Share Posted January 24, 2017 For the book script, you could use OnEquip: scriptname DMRSpellBookScript begin OnEquip PlayerRef if ( PlayerRef.HasSpell DMRChest == 0 ) PlayerRef.AddSpell DMRChest endif endAs for the summon: you could also use a permanent, sort of "static" actor. Just like the chest. You can have it stored away in a special holding cell, disabled, and then enable and move it to player when the player summons it. When the spell ends, you can move it back to the cell, reset its stats and inventory and such, and then disable it again. Of course it will not work if you need more than one actor to use the spell, but assuming it is for the player only, it might work (getting other actors to use it might also take somemore work). scriptname DMRSummonDremoraEffectScript begin ScriptEffectStart YourStaticDremoraRef.Enable ; perform any inventory and stat resets here, maybe? YourStaticDremoraRef.MoveTo PlayerRef YourStaticDremoraRef.PlayMagicEffectVisuals ZDRE end begin ScriptEffectFinish YourStaticDremoraRef.Kill endYou could then add all the death-related things to your Dremora itself. For example an actor script: scriptname YourDremoraActorScript begin OnDeath ; you might want to add a delay somewhere here... OnDeath triggers almost immediately! Resurrect 0 ; this might also reset something MoveTo AnXMarkerPlacedInYourHoldingCell Disable endNone of that has been tested, though, but maybe it could give you an idea of what the thing might look like. The actor script needs some serious rework, as the OnDeath block executes almost immediately and does not look too great. And I would not recommend running lots of commands in the same frame for one actor, either, if the commands are complicated, as it cometimes can cause an issue or two (crashing). It could also work fine, though. Using a static actor ref would make the spell usable by only player, but it would solve both the issue with two actors being summoned and the use of PlaceAtMe. RemoveMe is for items, not actors. There is currently no scripting command to delete an actor. Link to comment Share on other sites More sharing options...
bomo99 Posted January 24, 2017 Author Share Posted January 24, 2017 (edited) for the book script you gave me i am getting this errorScript ErrorScript 'DMRChestSummoner', line 4:Unknown variable or function 'HasSpell'.for the summon it works great but the summon doesnt follow the player is there a certain ai package or script that i need to put? Edited January 24, 2017 by bomo99 Link to comment Share on other sites More sharing options...
Recommended Posts