Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Scripting questions


sm0kem
 Share

Recommended Posts

Hey guys,

Is is possible (either via vanilla papyrus or skse) to teleport player to a random location in tamriel worldspace from within a script, without pre allocating markers in CK? The idea is to do everything within a script and make fully dynamic without relying on static content

 

Thanks

Link to comment
Share on other sites

Hmm. This might be an option. Do you know how script radius values relate to ingame distances? For example you mentioned 2048 would be (58,50 m).

Also, if you know of any good example of such code in Bethesda scripts or any popular mods, please let me know.

 

Thanks

Link to comment
Share on other sites

The only examples I can think of are the different wilderness encounters that occur during the game when you explore Skyrim: vampires, farmers that were attacked by a dragon, and so on. All these quests create encounters using the player as the ground reference, spawning actors within a range of different radius around the player.

Link to comment
Share on other sites

I'm trying to use a script to add objects to a FormList but Skyrim doesn't seem to recognize the AddForm command.  In theory, I should be able to use a command via the in-game console but...

AddForm(flPlanterPlantedFlora Nirnroot)
Script command AddForm not found
flPlanterPlantedFlora.AddForm(Nirnroot)
Unknown variable or function 'AddForm'.
Syntax Error.

flPlanterPlantedFlora.AddForm(Nirnroot)

Could not parse this line.
Unknown reference object 'flPlanterPlantedFlora'.

 

Link to comment
Share on other sites

On 3/11/2018 at 9:05 PM, Vain said:

I'm trying to use a script to add objects to a FormList but Skyrim doesn't seem to recognize the AddForm command.  In theory, I should be able to use a command via the in-game console but...


AddForm(flPlanterPlantedFlora Nirnroot)
Script command AddForm not found
flPlanterPlantedFlora.AddForm(Nirnroot)
Unknown variable or function 'AddForm'.
Syntax Error.

flPlanterPlantedFlora.AddForm(Nirnroot)

Could not parse this line.
Unknown reference object 'flPlanterPlantedFlora'.

 

Ok from my little experience i will say have you set your properties not trying to be mean here just starting at the basics. In this case you would have to tell the script that is going to be working with "flpanterplantedflora" ::{ I looked on the ck could not find that so on that part I am flying blind } and "Nirnroot"

So it should look like this

{What ever grouping flPlanterPlantedFlora is under} property flPlanterPlantedFlora auto

Ingredient property Nirnroot auto

flPlanterPlantedFlora.AddForm(Nirnroot,1,1)

 

 

 

hope this helps ya

 

so the finished script would look like this

{What ever grouping flPlanterPlantedFlora is under} property flPlanterPlantedFlora auto

Ingredient property Nirnroot auto

 

Event OnInit()

       flPlanterPlantedFlora.AddForm(Nirnroot,1,1)

EndEvent

Edited by Rabid_Kiwi
bad shift pinky
Link to comment
Share on other sites

I am guessing you are trying to make nirnroot plantable. If this is the case you may have to do it by each planter. So your best bet in that case is to find a cell with a planter, look at the script they used to add the plants to them, then copy it to note pad or something, edit that script to include nirnroot ( Remember to change the properties to the name of each planter that you are doing this with the same if you were doing it with a custom chest ) and then just use that script for each planter that you are wanting to beable to plant nirnroot in.

Hope this helps ya.

  • Upvote 1
Link to comment
Share on other sites

The the script should look like this

 

FormList  property flPlanterPlantedFlora auto

Ingredient property Nirnroot auto

 

Event OnInit()

       flPlanterPlantedFlora.AddForm(Nirnroot,1,1)

EndEvent

Edited by Rabid_Kiwi
Happy little space thumb
Link to comment
Share on other sites

For Form Lists the command is subtly different than with a leveled list.  It doesn't do anything at all when done that way... but I may just need to try again.
 

Function AddForm(Form apForm) native

vs
 

Function AddForm(Form apForm, int auiLevel, int auiCount) native

So for a Form List it goes

AddForm(flPlanterPlantedFlora Nirnroot)

... maybe

Edited by Vain
Link to comment
Share on other sites

2 minutes ago, Vain said:

I will look into that planter script and see if I can extend it instead of starting from scratch.

I will start searching the interwebz to see if some one else has had this problem and what they did to solve it because I have no life

Edited by Rabid_Kiwi
changed a v to a f because i speelzgut
  • Thanks 1
Link to comment
Share on other sites

Well... from what I've seen no one has tried this or succeeded.  Bruma doesn't even do this, it modifies the form lists directly making it compete with any other mod that adds plantable items.  A modding group with that sort of manpower you'd think would look into this so it may only be possible with SKSE.  The issue is that the form list governs trees.  The planter script only looks at the form list, it doesn't add anything to them.

Link to comment
Share on other sites

OK so far I have found a few somewhat promising leads this thread has a few good idea's on how you can work around this problem. by making a new formlist and adding it to the other formlist. or making an array and adding it to the form list.

https://forums.nexusmods.com/index.php?/topic/5250005-sorting-formlists/

 

Edit: So what I am saying is completely theoretical (and most likely wont work because Ich Ben ein dummkopt ) is to create a formlist out side of the flplanterplatedflora then directly add the nirnroot to the made form list, then use a script to add the made formlist to flplanterplatedflora. Hell i know I am not the best person to be helping you so I am sorry for my lack of experience on that part. Sry m8.

Edited by Rabid_Kiwi
to expand on my ( Most likely stupid ) Idea
  • Thanks 1
Link to comment
Share on other sites

Booooooooooooooooo that sucks. sry to hear that. Again sorry for my inexperience in this matter. mayhaps i am doing more harm then good. I will keep an ear to the ground if I come across anything I will post it here. Most of my searching has not really provided anything....

 

Ohhh i just came across this have you tired it?

https://www.creationkit.com/index.php?title=AddFormToFormList

there is also ListAddForm

The difference from what I have been able to see is that AddFormToFormList adds the item to the top, and ListAddForm adds it to the bottom. Hope this helps ya

 

So 

AddformToFormlist flPlanterPlantedFlora Nirnroot

{or}

ListAddForm flPlanterPlantedFlora Nirnroot

Edited by Rabid_Kiwi
expanding a bit more
  • Thanks 1
Link to comment
Share on other sites

Scriptname AddtoForm extends FormList

formlist property FormListOne auto	
formlist property FormListTwo auto
formlist property FormListThree auto
formlist property FormListFour auto
Message Property FormListUpdated Auto

Int RunOnce = 0

Event OnInit()
	If RunOnce == 0
		AddformToFormlist FormListThree FormListOne
		
		FormListUpdated.Show()
		
		RunOnce = 1
	EndIf

EndEvent
Starting 1 compile threads for 1 files...
Compiling "AddtoForm"...
AddtoForm.psc(13,34): required (...)+ loop did not match anything at input 'FormListOne'
No output generated for AddtoForm, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on AddtoForm

Headdesk, I can't think anymore.  I've tried rephrasing it in dozens of different ways with parentheses, periods, commas, you name it.  I'm going to sleep on it again...

I lied.

This compiled
 

Scriptname Vain01AddtoForm extends Form  

Import Game

FormList Property FormListThree Auto
Message Property FormListUpdated Auto
FormList Property FormListOne Auto
FormList Property FormListTwo Auto

Int RunOnce = 0

Event OnInit()

	If RunOnce == 0
		FormListOne.AddForm(FormListThree)
		FormListUpdated.Show()
		RunOnce = 1
	EndIf
EndEvent

In-game test shows the message is displaying at least...

Edited by Vain
  • Love This 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...