Jump to content

Biodegradable Matter - Scripting Assistance?


Recommended Posts

If one could currently help with a scripting issue that I am facing, it would be appreciated, as I am but a novice modder.

 

I am trying to get items to disappear from my PC's Inventory after a certain amount of days (meat,hearts,bread,mead) to give them the oppression of 'spoiling'.

 

Here is the example of a draft script I have

 

 

 

begin rottingmatterscript01

Short NumDays
; Removes the
meat / heart / skin from the player after 1 day
if ( NumDays > 1 )

MessageBox, "This biodegradable matter has spoiled, and can no longer be used or consumed. You discard it from your Inventory."

player->RemoveItem, "ingred_rat_meat_01",

player->RemoveItem, "ingred_crab_meat_01",

player->RemoveItem, "ingred_hound_meat_01",
player->RemoveItem, "ingred_scrib_jerky_01",
player->RemoveItem, "ingred_scuttle_meat_01",

player->RemoveItem, "ingred_human_meat_01",

player->RemoveItem, "ingred_daedras_heart_01",

player->RemoveItem, "ingred_cursed_daedras_heart_01",

player->RemoveItem, "ingred_ghoul_heart_01",

player->RemoveItem, "ingred_daedra_skin_01",

player->RemoveItem, "ingred_guar_hide_01",

player->RemoveItem, "ingred_kagouti_hide_01",

player->RemoveItem, "ingred_scamp_skin_01",

player->RemoveItem, "ingred_durzog_meat_01",

player->RemoveItem, "ingred_eyeball",

 

endif

End

 

 

 

Thank you, may the ALMSIVI guide you!

Edited by FalynIndoril
Link to comment
Share on other sites

  • 2 months later...

Hey brother. This may be the script you should look at.

 

Script 1 (A global command script which must be listed in the "start scripts" list under gameplay tab)

 

 

this script contains 2 global variables which you must declare and set to 0

 

 

begin BTM_SpoilIngredientMaster
if ( delSmallKwama > 0 )
player->removeitem "food_kwama_egg_01" 1
set delSmallKwama to ( delSmallKwama - 1 )
endif
end
Script 2
this script is attached to the small kwama egg object. This one is still somewhat buggy. It's most of the way there, but becomes disabled on certain eggs while working perfectly fine on others? To be honest I don't have the patience to debug this any further, but it is almost there I think.
begin BTM_SpoilableIngredients
;Deletes food which has "existed" in player control for multiple days
;vars
short daysPassed
short myDay
short enabletrigger
short OnPCAdd
short OnPCDrop
if ( OnPCAdd == 1 )
set enabletrigger to 1
set OnPCAdd to 0
endif
if ( OnPCDrop == 1 )
set enabletrigger to 0
set OnPCDrop to 0
endif
if ( enabletrigger == 0 )
return
endif
;store first day
if ( daysPassed == 0 )
set myDay to Day
set daysPassed to 1
endif
;if we've already set a day, count the days
if ( myDay != Day )
set daysPassed to daysPassed + 1
set myDay to Day
endif
if ( daysPassed > 2 )
if ( daysPassed < 100 )
set delSmallKwama to ( delSmallKwama + 1 )
set daysPassed to 101
endif
endif
End
Edited by btmangan10
Link to comment
Share on other sites

  • Recently Browsing   0 members

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