Please help me with this script

Post » Fri Apr 08, 2011 9:16 am

Hey guys,

i'm trying my first script and a mod based on it. Basically, what I want to achieve is to being able to grind all kitchen wear that's made of stone/ceramic etc. into stonemeal. What I did for that was:

- retexturing the stonemeal icon to look more dark and brown to use it as stonemeal icon
- made a new ingredient, named 'stonemeal' with the unique ID: RiflerStoneMeal
- made a new script (adepted from Zinnis bone grinder mod) and attached it to any kitchen wear I want to use it on (excluding thoose that already had scripts attached or where quest items or assigned to a quest)
- gave the player npc the needed items to test in game

So now, when I got into game the script works fine. I gave myself 30 cups + the two that are on the table. It works with the two stonewear items from the table, but as soon as I click on the column of 30 bowls, it gives me the message 'You succesfully grinded it into stonemeal' and then the rest of the 29 bowls simply disappear. Any ideas why that is? I tried the script using a Mortar and Pestel, a Repair Hammer and even made a unique item, but always the same result. I made the script with Notepad++ and then pasted and copied it into the CS...here it is:

scn SalatClayPowderScriptshort buttonshort toolsshort alchskillshort askedshort randshort startmealshort amtfloat timerref Statebegin OnEquip   set State to 1endbegin menumodeif state == 1    MessageBox "Grind this into Stonemeal?" "Yes" "No"    set asked to 1    set state to 2endifif state == 2  set button to GetButtonPressed    if button > -1     set state to 3    endifendifif state == 3    if button == 0        if player.GetItemCount RiflerStoneGrinder > 0            set tools to 1            set state to 4         else            MessageBox "You need a Stonegrinder to grind it into Stonemeal."            set state to 0        endifendifendifif state == 4    set alchskill to player.getAV Alchemy    set rand to GetRandomPercent    set amt to 0    set startmeal to player.GetItemCount RiflerStoneMeal    if alchskill < 25        if rand > 49            MessageBox "You succesfully grind it into Stonemeal."		  set amt to 1        else            MessageBox "Due to your ineptitude with your Stonegrinder, you fail to grind it into Stonemeal."        endif    elseif alchskill > 75        if rand > 49            MessageBox "Due to your expertise in working with your Stonegrinder for alchemical purposes, your grind it into enough Stonemeal for two uses."		  set amt to 2        else            MessageBox "You succesfully grind it into Stonemeal."		  set amt to 1        endif            else            MessageBox "You succesfully grind it into Stonemeal."		  set amt to 1    endif    set state to 5    set tools to 0    if amt > 0        player.additem RiflerStoneMeal amt    endif    set timer to 0.2endifif state == 5  if (timer > 0)    set timer to timer - GetSecondsPassed  else        RemoveMe    endifendifend

User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Thu Apr 07, 2011 10:37 pm

Don't know what's wrong, but what I'd say is that you're making things too complicated.

If you were to make a container, and have it detect objects put into it, and grind them into dust, instead of having everything go on in the inventory, that would probably be easier. Like the assimilator in Midas Magic, or the Grinders that come in Cobl.

Have an activator next to it, or on top of it to start the script. Then, look in the container for any of the stoneware objects, each of which is assigned a value (amount of ceramic dust that will be created) and the total is added up. Then, the objects are deleted, and replaced with X amount of stone-dust.
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am


Return to IV - Oblivion

cron