Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

How to Add the "Stats" Page

4 years ago

Hello,

I am having trouble figuring out how to add a stats page to my story game. I've read a lot of other story games where they have a stats page link up next to the "Go back", "Restart", "Save", and "Quit" options. I was wondering how this was accomplished and how I can do it! I want my variables to be there instead of either hidden or displayed on every storygame page.

Thank you!

Hazel

How to Add the "Stats" Page

4 years ago
You have to use javascript and it gets a little complicated. I have some of what's needed copied down, but I can't access it right now.

How to Add the "Stats" Page

4 years ago
Technically no, you only need to use html.
$PAGETEXT := $PAGETEXT + "<div style='position:absolute;top:4px;left:355px;background-color:#D65C5C'> <a color='#FFFFDD' onclick='PostBack(&#39;FollowLink&#39;,&#39;1&#39;);return false;' href='#'> <font size='1' color='#FFFFDD'>FORFEIT MATCH</font></a></div>"
Replace "1" inside the () section with the id of the link (make a link to the variable page, then inspect it to find out its ID). Replace "FORFEIT MATCH" with whatever you want the link to be called.

How to Add the "Stats" Page

4 years ago

Thank you Killa Robot! I did as you said, but I got an error message. I can see the "stats" page link on the top where I wanted it though :) When I clicked it that's when I got the error message below:

Would you mind assisting me in what I need to fix? Thank you so much!

Server Error in '/' Application.


Link Resultset not loaded

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: Link Resultset not loaded

Source Error:

 

Line 52: 			case "FollowLink":
Line 53: 				{
Line 54: 					StoryStateReturnValues ret = State.FollowLink(int.Parse(Request.Form["pbValue"]));
Line 55: 					switch (ret)
Line 56: 					{


Source File: c:\Websites\ChooseYourStory\ChooseYourStory.com\Story\Viewer\Default.aspx    Line: 54

Stack Trace:

 

[Exception: Link Resultset not loaded]
   ChooseYourStory.Stories.StoryState.FollowLink(Int32 linkId) in C:\ProgramData\InedoAgent\BuildMaster\prod\Temp\_E88470\Src\ChooseYourStory\Stories\StoryState_PublicInterface.cs:144
   ASP.story_viewer_default_aspx.OnLoad(EventArgs e) in c:\Websites\ChooseYourStory\ChooseYourStory.com\Story\Viewer\Default.aspx:54
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3130.0

How to Add the "Stats" Page

4 years ago
I imagine its because the link number you used doesnt exist. What number did you replace 1 with and how did you find it?

How to Add the "Stats" Page

4 years ago

I believe the number was 62416 and I got it by going to my storygame and clicking on variables.

How to Add the "Stats" Page

4 years ago
There is no existing page that just shows all the variables when playing a storygame. You need to make that page yourself. What we were describing is the way you would make a custom link go to that page. I'm really curious where you actually pulled that number from now.

So, here's what you do:
Step 1 - Make a page where these variables will be
Step 2 - Make a link to this page from another page
Step 3 - Test the storygame and go to that link
Step 4 - Right click the link and find the link number that it has
Step 5 - Use that number for the custom link

How to Add the "Stats" Page

4 years ago

I did everything exactly as you said and I still got the same error message :/

This is the coding I used:

$PAGETEXT := $PAGETEXT + "<div style='position:absolute;top:4px;left:355px;background-color:#D65C5C'>
<a color='#FFFFDD' onclick='PostBack(&#39;FollowLink&#39;,&#39;62416&#39;);return false;' href='#'>
<font size='1' color='#FFFFDD'>YOUR POINTS</font></a></div>"

 

Did I do something wrong in the coding?

How to Add the "Stats" Page

4 years ago
I'm guessing it's fact you're using HTML with the rich text editor enabled.

How to Add the "Stats" Page

4 years ago
There is no way 62416 is the link number. That number is supposed to represent the ID of the link, which starts at 1 and is incremented by 1 every time you add a link. Unless you mean to tell me you actually have 62,416 links in your storygame.

My guess is you're looking at the url and 62,416 is your storygame ID.

What's the name of your storygame? I'm an admin so I can just go onto it myself and find the correct number if you want.

How to Add the "Stats" Page

4 years ago
Maybe you can figure out what the floating box on her profile page is about while you're at it.

How to Add the "Stats" Page

4 years ago
The floating box is the code i showed before. Odds are they added it to a storygame description, or their profile.

How to Add the "Stats" Page

4 years ago
Oh it's probably because they pasted the same code here in the thread. It should go away once that post is out of their recent history.

How to Add the "Stats" Page

4 years ago
@historicfictionlover

How to Add the "Stats" Page

4 years ago

Just note that the link ID on hover is a feature of the extension when previewing a storygame or with dev mode on.

How to Add the "Stats" Page

4 years ago
That explains it. I was sitting here like "whats that box from" lol.

How to Add the "Stats" Page

4 years ago

Killa_Robot, The storygame's name is "Your Game of Love." That would be great if you could help me out, thank you so much.

How to Add the "Stats" Page

4 years ago
Link ID to the Your Points page is 5 btw, but he may have already gotten to it.

How to Add the "Stats" Page

4 years ago
Alright. Strangely when I checked it said you didn't have scripting enabled, but when I enabled it the global page script existed, so I'm not sure what happened there lol.

Anyway, like Mizal said the ID was 5, so I replaced that number and now the link works. I also modified the spacing slighty so the link is closer to the normal ones and fits in more. If you want to move it around just change the number "380" in "left:380px" to something else.

Your next steps are going to be to:
- Go into each variable and uncheck the "Display on All Pages" box
- Go to the points page and populate it with your variables. I did the first one for you. If you're curious about why it works, check out this article:
http://chooseyourstory.com/help/articles/article.aspx?ArticleId=3850

How to Add the "Stats" Page

4 years ago
It always has all the advanced stuff disabled when you're viewing somebody else's story. I guess it's technically a bug, but not one that would be run into very often.

How to Add the "Stats" Page

4 years ago
Yeah, to be fair its probably more an admin feature that needs to be modified so it's not really seen by most people lol.

How to Add the "Stats" Page

4 years ago

Awesome, Thank you so much Killa Robot! And also Mizal!