Difference between revisions of "Talk:Show - Message"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jaysus
(Created page with "---- '''how to make a quick menu with 3 different buttons that runs once when the game starts the first time after loading this mod:''' ---- 1. create a quest and give it a...")
 
imported>Jayne2132
 
(4 intermediate revisions by 3 users not shown)
Line 6: Line 6:


1.
1.
create a quest and give it an ID (contrary to intuition do not enable "star game enabled" (it now means that it will start everytime the game loads or somin, not only to start once like in FO3 and co, quests automaticly start without conditions now)
create a quest and give it an ID (contrary to intuition do not enable "start game enabled" (it now means that it will start everytime the game loads or something, not only to start once like in FO3/FONV, quests automaticly start without conditions now)


----
----
Line 21: Line 21:


4.
4.
use the following for that script:
use the following template for that script:


Scriptname MyMenuQuestScript extends Quest
<source lang="papyrus">Scriptname MyMenuQuestScript extends Quest
{displays a multiple choice menu}
{displays a multiple choice menu}


message property MyMenuQuestMessage auto                ;;declare your properties/variabels
message property MyMenuQuestMessage auto                ;;declare your properties/variabels
quest property MyMenuQuest auto
quest property MyMenuQuest auto


event OnInit()                                            ;;begins when script or its parent quest gets initialized
event OnInit()                                            ;;begins when script or its parent quest gets initialized


int ibutton = MyMenuQuestMessage.show()                  ;;shows the message item
int ibutton = MyMenuQuestMessage.show()                  ;;shows the message item


        if ibutton == 0                                    ;; 0 is the first button, 1 the second, and so on
      if ibutton == 0                                    ;; 0 is the first button, 1 the second, and so on
                debug.messagebox("you hit button 1")      ;;replace with whatever result function you like
              debug.messagebox("you hit button 1")      ;;replace with whatever result function you like


        elseif ibutton == 1
      elseif ibutton == 1
                debug.messagebox("you hit button 2")
              debug.messagebox("you hit button 2")


        else  
      else  
                debug.messagebox("you didnt hit button 1 or 2 hence must have hit 3")
              debug.messagebox("you didnt hit button 1 or 2 hence must have hit 3")


        endif
      endif


MyMenuQuest.stop()                                        ;;stops the quest
MyMenuQuest.stop()                                        ;;stops the quest
endEvent
endEvent</source>


----
----
Line 52: Line 52:


--[[User:Jaysus|Jaysus]] 04:31, 18 February 2012 (EST)
--[[User:Jaysus|Jaysus]] 04:31, 18 February 2012 (EST)
== Display Text in Center of Screen ==
You can display a non-message box message in the middle of the screen using [[ShowAsHelpMessage - Message]] (see [[Talk:ShowAsHelpMessage - Message]])
--[[User:Jayne2132|Jayne2132]] ([[User talk:Jayne2132|talk]]) 2015-01-29T12:26:36 (EST)

Latest revision as of 12:26, 29 January 2015


how to make a quick menu with 3 different buttons that runs once when the game starts the first time after loading this mod:


1. create a quest and give it an ID (contrary to intuition do not enable "start game enabled" (it now means that it will start everytime the game loads or something, not only to start once like in FO3/FONV, quests automaticly start without conditions now)


2. create a message and add 3 buttons giving them some text (not too long, buttons will be displayed next to each other with this script)


3. add a script to your quest and add properties for your quest and message


4. use the following template for that script:

Scriptname MyMenuQuestScript extends Quest
{displays a multiple choice menu}

message property MyMenuQuestMessage auto                 ;;declare your properties/variabels
quest property MyMenuQuest auto

event OnInit()                                            ;;begins when script or its parent quest gets initialized

int ibutton = MyMenuQuestMessage.show()                   ;;shows the message item

       if ibutton == 0                                    ;; 0 is the first button, 1 the second, and so on
               debug.messagebox("you hit button 1")       ;;replace with whatever result function you like

       elseif ibutton == 1
               debug.messagebox("you hit button 2")

       else 
               debug.messagebox("you didnt hit button 1 or 2 hence must have hit 3")

       endif

MyMenuQuest.stop()                                        ;;stops the quest
endEvent

5. autofill the scripts properties and youre done, start the game and see your menu appear

--Jaysus 04:31, 18 February 2012 (EST)

Display Text in Center of Screen[edit source]

You can display a non-message box message in the middle of the screen using ShowAsHelpMessage - Message (see Talk:ShowAsHelpMessage - Message) --Jayne2132 (talk) 2015-01-29T12:26:36 (EST)