Difference between revisions of "DropAllItems"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Scruggs
(looping version)
imported>Haama
(Added warning about using OBSE's loops)
Line 37: Line 37:
  end
  end


Using OBSE's looping functions, you can speed things up a bit:
Note that using OBSE's loop functions may result in a crash. See [[:Category:OBSE_Flow_Control_Functions|this link]] for more information.
<pre>ref item
short quant
short numItems
 
begin gameMode
  if ( timeToDropItems )
    set numItems to getNumItems
    Label 10; start of loop
    if ( numItems )
      set numItems to numItems - 1
      set item to getInventoryObject numItems
      set quant to getItemCount item
      drop item quant
      GoTo 10
    endif
  endif
end</pre>

Revision as of 03:47, 4 July 2007

scn DropAllItemsQuestScript

short DropAllItems
ref ActorRef
ref CurObj
short CurObjNum
float fquestdelaytime


begin GameMode
set fquestdelaytime to 0.001

if ActorRef && DropAllItems == 1
if ActorRef.GetNumItems > 0 
set CurObj to ActorRef.GetInventoryObject (ActorRef.GetNumItems - 1)
set CurObjNum to ActorRef.GetItemCount CurObj
ActorRef.Drop CurObj CurObjNum
ActorRef.RemoveItem CurObj CurObjNum
endif
if ActorRef.GetNumItems == 0
	set DropAllItems to 0
endif
endif
end

make this a quest script, attach it to a quest named DropAllItems. In your script

scn MyScript

ref actor

begin onActivate
set Actor to GetActionRef
messageBox "Good job dropping everything."
set DropAllItems.ActorRef to Actor
set DropAllItems.DropAllItems to 1
end

Note that using OBSE's loop functions may result in a crash. See this link for more information.