Jump to content

Modding-Howto: Harvesting a little extra.


nosdregamon

Recommended Posts

Posted

For my mod, I want to allow the player, to harvest nightshade, finding a few fruits of belladonna every now and then (For the resulting ingredient, I used a slightly recollored jazbay fruit),

 

Does anybody have a hint, how to create/where to hook in such a function in CK?

 

I don't want to touch the original plant (I'm afraid of creating incompatibilities).

 

 

EDIT: Is this the right Board for questions like this? Would there be a better board?

Posted

The thread is in the right place.

 

What are you trying to do, exactly?

 

When you grab one ingredient then you may get some other ingredient?

-> You can do it with a really simple script

 

You want to have the Nightshade (or any other ingredient) to be more often on the landscape?

-> Edit the cells where you wanna put this ingredient, and add it.

 

 

I think you wanna do the first case.

 

Quick solution:

 

1) Create a quest.

2) Add an alias

3) Set the alias to the player

4) Add a script to the alias

5) Add an Event OnItemAdded(...)

6) In the event, based on some random functions you will decide, add also to the player the Belladonna or whatever ingredient you want.

 

Posted

I think you wanna do the first case.

 

Quick solution:

 

1) Create a quest.

2) Add an alias

3) Set the alias to the player

4) Add a script to the alias

5) Add an Event OnItemAdded(...)

6) In the event, based on some random functions you will decide, add also to the player the Belladonna or whatever ingredient you want.

 

Yes, that's it. Thank you very much.

 

 

Posted

Quick solution:

 

1) Create a quest.

2) Add an alias

3) Set the alias to the player

4) Add a script to the alias

5) Add an Event OnItemAdded(...)

6) In the event, based on some random functions you will decide, add also to the player the Belladonna or whatever ingredient you want.

 

onitemadd or onitemremove are a lot of problems, stack dumps getting your gear back after jail, stack dumps when a quest remove your gear, stack dumps with auto loot...

 

few mods mess with flora, one of the is requiem

to replace the one something you loot when you click on that something, by a leveled list

just do that, make that nighshade loot a leveled list, first item is a leveled list with one nightshade, second item is a leveled list with x belladona (randon chance)

Posted

I tried CPUs suggestion on a player alias, I get the "OnInit"-Debug-Notifications, but it seems "OnItemAdded" wont fire at all.

 

 

 

Scriptname whgNightHarvest extends ReferenceAlias  

Ingredient Property Nightshade Auto Conditional
Ingredient Property Belladonna Auto Conditional
Alias Property playerAlias  Auto  

event OnPlayerLoadGame()
    Debug.notification("Harvester Onload")
    ;AddInventoryEventFilter(Nightshade)
endEvent

Event OnInit()
    Debug.notification("Harvester OnInit")
    ;AddInventoryEventFilter(Nightshade)
endEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    Debug.notification(aiItemCount)
    Debug.notification(akBaseItem)
    Debug.notification(akSourceContainer)
endEvent;

I haven't even set inventory filters yet, so I would expect the event to fire all the time I pick something up. Any clue why this wont work?

 

 

 

few mods mess with flora, one of the is requiem

to replace the one something you loot when you click on that something, by a leveled list

just do that, make that nighshade loot a leveled list, first item is a leveled list with one nightshade, second item is a leveled list with x belladona (randon chance)

Sounds like a nice solution perfectly script free, but I'm actually using Requiem. Damn.


Posted

I tried CPUs suggestion on a player alias, I get the "OnInit"-Debug-Notifications, but it seems "OnItemAdded" wont fire at all.

 

 

Scriptname whgNightHarvest extends ReferenceAlias  

Ingredient Property Nightshade Auto Conditional
Ingredient Property Belladonna Auto Conditional
Alias Property playerAlias  Auto  

event OnPlayerLoadGame()
    Debug.notification("Harvester Onload")
    ;AddInventoryEventFilter(Nightshade)
endEvent

Event OnInit()
    Debug.notification("Harvester OnInit")
    ;AddInventoryEventFilter(Nightshade)
endEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    Debug.notification(aiItemCount)
    Debug.notification(akBaseItem)
    Debug.notification(akSourceContainer)
endEvent;

I haven't even set inventory filters yet, so I would expect the event to fire all the time I pick something up. Any clue why this wont work?

 

I have no clue why, but using exact the same script on a new quest works.

 

Thanks.

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...