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

1 hour ago, Vain said:

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...

If compiled then could you make an array ( or would you want to ) in place of formlistthree? IDK shot in the dark if the formlist inception theory does not pan out

Link to comment
Share on other sites

First, I haven't read every post here.

There is an example of how to use AddForm in the CC content "Arcane Accessories". The script add forms to levelled lists, not form lists, but you can try the example below with form lists. You must have two properties:

  • one for the levelled list  or form list where you want to add the form,
  • one for the form you want to add

then use AddForm.

Example in the main Arcane Accesories quest script (qf_ccbgssse014_spellpack_sta_0100083c):

leveleditem property LItemSpellTomes75Destruction auto
book property ccBGSSSE014_SpellTome_Dest_MarasWrath auto

LItemSpellTomes75Destruction.AddForm(ccBGSSSE014_SpellTome_Dest_MarasWrath as form, 1, 1)

There are also tons of examples of how to use AddForm in the Hearthfires scripts, BYOHHoouseBuilding quest, and these seems to be about adding forms to form lists. :)

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

5 hours ago, ladyonthemoon said:

First, I haven't read every post here.

There is an example of how to use AddForm in the CC content "Arcane Accessories". The script add forms to levelled lists, not form lists, but you can try the example below with form lists. You must have two properties:

  • one for the levelled list  or form list where you want to add the form,
  • one for the form you want to add

then use AddForm.

Example in the main Arcane Accesories quest script (qf_ccbgssse014_spellpack_sta_0100083c):


leveleditem property LItemSpellTomes75Destruction auto
book property ccBGSSSE014_SpellTome_Dest_MarasWrath auto

LItemSpellTomes75Destruction.AddForm(ccBGSSSE014_SpellTome_Dest_MarasWrath as form, 1, 1)

There are also tons of examples of how to use AddForm in the Hearthfires scripts, BYOHHoouseBuilding quest, and these seems to be about adding forms to form lists. :)

Ok so going off this wonderful advice, Ty by the by, I went through the script and found this

        ;----------------------------------
        ;| DLC01 -> Adoption System Setup  | 
        ;----------------------------------
        ;Add the DLC01 Daggers to the childrens' gift lists.
        Form BYOHDragonboneDagger = Game.GetFormFromFile(0x00014FCB, sDLC01Filename)
        Form BYOHPrelateDagger = Game.GetFormFromFile(0x0001681F, sDLC01Filename)
        BYOHRelationshipAdoptionPlayerGiftChildMale.AddForm(BYOHDragonboneDagger)
        BYOHRelationshipAdoptionPlayerGiftChildFemale.AddForm(BYOHDragonboneDagger)
        BYOHRelationshipAdoptionPlayerGiftChildMale.AddForm(BYOHPrelateDagger)
        BYOHRelationshipAdoptionPlayerGiftChildFemale.AddForm(BYOHPrelateDagger)
        ;Add the DLC01 Dawnguard Dogs to the potential pet lists.
        Form BYOHHuskyBareCompanionRace = Game.GetFormFromFile(0x000122B7, sDLC01Filename)
;         ;Debug.Trace("Adding: " + BYOHHuskyBareCompanionRace)
        BYOHRelationshipAdoption_PetAllowedRacesList.AddForm(BYOHHuskyBareCompanionRace)
        BYOHRelationshipAdoption_PetDogsList.AddForm(BYOHHuskyBareCompanionRace)
        Form BYOHHuskyArmoredCompanionRace = Game.GetFormFromFile(0x00003D01, sDLC01Filename)
;         ;Debug.Trace("Adding: " + BYOHHuskyArmoredCompanionRace)
        BYOHRelationshipAdoption_PetAllowedRacesList.AddForm(BYOHHuskyArmoredCompanionRace)
        BYOHRelationshipAdoption_PetDogsList.AddForm(BYOHHuskyArmoredCompanionRace)

 

This was a good segment that showed using .AddFrom to add to formlist. now by looking at your script Vain and compairing it the one you compiled should do what you want. That is to add to the formlist via AddFrom

Once again LadyonTheMoon shines a light while Rabid_Kiwi fumbled in the dark. lolz 

 

SO going off of that your command should be

           flPLanterPlantedFlora.AddForm(Nirnroot)

Only thing is that this formlist will only add it to the already planted list so if you want nirnroot plantable you will also need to use this

         flPlanterPlantableItem.Addform(Nirnroot)

 

Hope this helps and again ty Ladyonthemoon for pointing us to a script.

  • Thanks 1
Link to comment
Share on other sites

I hope adding the formlist with the objects works because I can't seem to add the objects directly without SKSE (arrays are the same issue) as scripts can't natively contain any TreeObject properties.

Skyrim just doesn't have TreeObject defined.  Very sad.

Link to comment
Share on other sites

3 minutes ago, Vain said:

I hope adding the formlist with the objects works because I can't seem to add the objects directly without SKSE (arrays are the same issue) as scripts can't natively contain any TreeObject properties.

Skyrim just doesn't have TreeObject defined.  Very sad.

well I created a small mod to test the addform script I made to add nirnroot to a planter and You can plant it but there is something blocking it from growing it seems so the addform works 

This was the script I used in a quest to do it if it helps ya

Scriptname _ZZRKNirn extends Quest Hidden 

Formlist property flPlanterPlantableItem Auto
Formlist property  flPLanterPlantedFlora Auto
Ingredient property Nirnroot Auto

Event OnInit()
       flPlanterPlantableItem.Addform(Nirnroot)
       flPlanterPlantableItem.Addform(Nirnroot)
       Debug.Notification("well I worked")
EndEvent

Link to comment
Share on other sites

3 minutes ago, Vain said:

I shall inquire of Google but this I do not know

I think you must use the category of the object; like "Armor" for armours, "Book" for books, and so on. If the category you are looking for doesn't exist, all you have to do is create it.

You'll know soon enough if it works or not, no need for searching the web or asking here and there for that. Especially when people have only one kind of fast and easy answer: "use skse".

 

  • Love This 1
Link to comment
Share on other sites

39 minutes ago, Vain said:

I hope adding the formlist with the objects works because I can't seem to add the objects directly without SKSE (arrays are the same issue) as scripts can't natively contain any TreeObject properties.

Skyrim just doesn't have TreeObject defined.  Very sad.

Would that not be under tree. So tree property {What ever tree data you are using here} ? Or did I ask a stupid question.

 

to expand a bit like 

Tree Property BYOHHouseIngrdNirnroot01 auto

Edited by Rabid_Kiwi
just keep digging the hole.
Link to comment
Share on other sites

3 hours ago, ladyonthemoon said:

If Vain has it right (I cannot check right now) it should be:


TreeObject Property BYOHHouseIngrdNirnroot01 Auto

 

Yeah, that specifically is an SKSE addition.  Without SKSE you can't use TreeObject as a property.  I will continue to work on this and let you know what results I get.

Link to comment
Share on other sites

21 minutes ago, Vain said:

I didn't even know there was a list that can be user modified easily.  I thought SKSE modified the Skyrim executable

As I said, I'll have to Google

You don't need to do that; just add the property I wrote earlier manually to your script, fill it in the properties manager and see if it compiles.

Edited by ladyonthemoon
Link to comment
Share on other sites

11 hours ago, ladyonthemoon said:

 

Sorry about that, it's not TreeObject, it's Flora.

The property that works is


Flora Property BYOHHouseIngrdNirnroot01 Auto

Flora is an existing type. :)

Okay, this doesn't work either, since BYOHHouseIngrdNirnroot01 is not a Flora type of object, it's a Tree, and the Tree type doesn't exist. I thought first that we could just create it on the fly but it doesn't seem to be possible, but, if the skse guys did it, I'm pretty sure we can do it too; we just need the knowledge. :)

In the meantime, what about ... (I'm back after some tests)

Edited by ladyonthemoon
Link to comment
Share on other sites

@VainLet's see if I understand what you need to do:

  1. you need to add the Nirnroot ingredient to the flPlanterPlantableItem form list,
  2. you need to add the BYOHHouseIngrdNirnroot01 Tree to the flPlanterPlantedFlora form list.

The first thing shouldn't be too difficult to do since the Ingredient property type exists; the second is problematic since the Tree property type doesn't exist. It exists in skse but, for some reason doesn't work? Is that it?

If you do not want to modify the form list, you can add a new levelled list containing the tree.

  1. create a levelled list and add the BYOHHouseIngrdNirnroot01 tree to it, check "use all",
  2. add the new levelled list to the flPlanterPlantableItem form list by script.
flPlanterPlantableItem.AddForm(NewLevelledList)

I hope this can help. :)

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

It might help... the end goal is to create something like the add to leveled list script.  Make it possible for mods that add plantables to work in concert as each uses a script to add their plants instead of each modifying and overwriting the form list manually.

Link to comment
Share on other sites

5 hours ago, Vain said:

It might help... the end goal is to create something like the add to leveled list script.  Make it possible for mods that add plantables to work in concert as each uses a script to add their plants instead of each modifying and overwriting the form list manually.

Everything I did did not test out to work soo sry for wasting your time i edited out my processes 

Edited by Rabid_Kiwi
just keep digging the hole.
Link to comment
Share on other sites

17 hours ago, Vain said:

It might help... the end goal is to create something like the add to leveled list script.  Make it possible for mods that add plantables to work in concert as each uses a script to add their plants instead of each modifying and overwriting the form list manually.

You can do that, add a new levelled list containing the tree to the form list by script. I modified my post.

Link to comment
Share on other sites

Okay... further testing shows that tree objects can also not be added to Leveled Lists.  There's a BYOHHouseIngredient<x> and there's a BYOHHouseIngrd<x>... and the Ingrd's are trees and the Ingredients are... those loose ingredients you find lying around in the houses.  A few of the items are Flora objects though.  Soul husks, Chaurus, Hawk, Pine Thrush, and Rock Warbler nests are Flora objects... so I should be able to test a working script with them.

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...