Decoration Display Window

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Decoration Display Window

Postby SimonDenton » Thu Jun 28, 12 11:26 am

Hi All,

How can I make a window pop up when I frob a decoration item? The code for my custom decoration is:

Code: Select all
class QuizPaper extends SummerDecoration;

var QuizWindow quizwindow;
var SummerPlayer player;


/// ----------------------------------------------------------------------
// Frob()
// ----------------------------------------------------------------------

function Frob(Actor Frobber, Inventory frobWith)
{
local SummerPlayer player;

   

   Super.Frob(Frobber, frobWith);

   player = SummerPlayer(Frobber);

   if (player != None)
   {
      if (quizwindow == None)
      {
         
         CreateQuizWindow();
   
      }
      
   }
   
   
   
   
}

// ----------------------------------------------------------------------
// CreateQuizWindow()
// ----------------------------------------------------------------------

function CreateQuizWindow()
{
quizwindow.InitWindow();
}


defaultproperties
{
ItemName="Quiz Paper"
Mesh=LodMesh'DeusExItems.Credits' //Draft for now
}


And my window code is just simply:

class QuizWindow expands MenuUIScreenWindow;

var MenuUIHeaderWindow winHeader;

Code: Select all
// ----------------------------------------------------------------------
// CreateHeaderWindow()
// ----------------------------------------------------------------------

function CreateHeaderWindow()
{
   winHeader = MenuUIHeaderWindow(winClient.NewChild(Class'MenuUIHeaderWindow'));
   winHeader.SetPos(11, 6);
   winHeader.SetSize(300, 12);
   winHeader.SetTextAlignments(HALIGN_Center, VALIGN_Top);
   winHeader.SetText("Quiz");
}


for the sake of testing it out.

When I frob the QuizPaper it just grabs the decoration and doesn't invoke the window. Help would be appreciated.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby Andrievskaya Veronika » Thu Jun 28, 12 1:02 pm

Try to remove this:

Code: Select all

   Super.Frob(Frobber, frobWith);

User avatar
Andrievskaya Veronika
Poster
 
Posts: 164
Joined: Sat Sep 02, 06 7:35 am
Location: Database read error

Postby Cozmo » Thu Jun 28, 12 1:19 pm

If removing the Super.Frob call doesn't work (not sure, but it might make it un-frobbable), try setting bPushable to false; that should stop it from being picked up and will hopefully call the window.
Cozmo_RPG (v1 & v2)
MPConversations - A tool for creating multiplayer RPG stuff
Cozmo
Master
 
Posts: 1266
Joined: Tue Jun 28, 05 10:53 am
Location: UK

Postby SimonDenton » Sat Jun 30, 12 6:42 am

Thank you both! It worked out! Now...to do the real GUI part, Quiz Window :D
Heading: *SubjectStringStoredInQuizPaperObject* + "Quiz"
Single window in the middle
Within this window:
- Question string
- 4 multiple choice, 4 checklist or one password input depending on question type
- Arrow and horizontal scroll bar at the bottom for going through questions
- A "Help" button which adds a window showing a note kind of thing suitting the exam we're doing.
- A finish button to submit results in the bottom right corner.
- Time limit shown on the top right hand corner, if this is 0 then the function for submit is done.

Is it wise to store things like the number of questions, possible question strings/answers/correct answers, marks obtained and marks possible within the QuizPaper decoration object? This data will be carried over to the test scoreboards which instantly compare the player's marks to those of others.
Last edited by SimonDenton on Sat Jun 30, 12 6:44 am, edited 2 times in total.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby SimonDenton » Tue Jul 10, 12 12:00 pm

Below is a graphical representation of my idea.

Image
So we have a randomised bank of questions which can be stored in the Quiz Paper decoration object.

e.g If we do math quiz 1:
- Question Text: Solve the inequality;
- Question Diagram:

Image
- Question enum: Q_MultipleChoice
-MC1Text: -4 < x < 3
-MC2Text: -8 <= x <3
-MC3 Text -8 <= x <= 3
-MC4Text: -8 < x <3
- Correct Answer: MC2

Something like that.[/img]
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm


Return to Editing issues

Who is online

Users browsing this forum: Google [Bot] and 9 guests