Hi guys. Melike brought this Itemstate problem to my attention, and it reminded me that I had the same problem a while back. Basically, the editor isn't allowing $ITEMSTATEx := 0 (where x is the number of the item) which is used to drop an item during a script.
I'm not sure if this has been mentioned in this forum before or not, but I couldn't see it listed. (If any bug catching points are given, give them to Melike, who brought this to my attention)
Items can be picked up fine, but the only way they can be dropped is by clicking on the little bag (drop item) button beside a link, and setting it to drop an item. However, you can't write a script tha causes an item to be dropped under certain circumstances. You'd have to write a couple links, and restrict their useage so that some links don't drop the item and some do, rather than writing scripts to work it out.
I've tested $ITEMSTATE := 0 in both link and page scripts, and it errors instantly. Here's the error message displayed when after following a link, a page is reached, and the page just has this script: $ITEMSTATE1 := 0
Server Error in '/' Application.
PostProcessed already!
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: PostProcessed already!
Source Error:
Line 34: case "FollowLink":
Line 35: {
Line 36: StoryStateReturnValues ret = State.FollowLink(int.Parse(Request.Form["pbValue"]));
Line 37: switch (ret)
Line 38: {
|
Source File: c:\Websites\ChooseYourStory\ChooseYourStory.com\Story\Viewer\Default.aspx Line: 36
Stack Trace:
[Exception: PostProcessed already!]
ChooseYourStory.Stories.StoryState.PostProcess() in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory\Stories\StoryState_PostProcess.cs:185
ChooseYourStory.Stories.StoryState.DropItem(Int32 itemId) in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory\Stories\StoryState_PublicInterface.cs:361
ChooseYourStory.Stories.Scripting.ItemExpression.AssignValue(Object value, StoryState state) in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory.Stories.Scripting\ItemExpression.cs:112
ChooseYourStory.Stories.Scripting.AssignmentStatement.Execute(StoryState state) in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory.Stories.Scripting\AssignmentStatement.cs:38
ChooseYourStory.Stories.Scripting.ParsedScript.Execute(StoryState state) in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory.Stories.Scripting\ParsedScript.cs:26
ChooseYourStory.Stories.StoryState.Scripting_ExecutePageScripts() in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory\Stories\StoryState_Scripting.cs:114
ChooseYourStory.Stories.StoryState.PostProcess_Scripts() in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory\Stories\StoryState_PostProcess.cs:172
ChooseYourStory.Stories.StoryState.PostProcess() in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory\Stories\StoryState_PostProcess.cs:192
ChooseYourStory.Stories.StoryState.FollowLink(Int32 linkId) in C:\Projects\ChooseYourStory\CysWebSolution\ChooseYourStory\Stories\StoryState_PublicInterface.cs:256
ASP.story_viewer_default_aspx.OnLoad(EventArgs e) in c:\Websites\ChooseYourStory\ChooseYourStory.com\Story\Viewer\Default.aspx:36
System.Web.UI.Control.LoadRecursive() +101
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2588
|
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832