Quantcast

Jump to content

» «
Photo

How to create a Panel or menu window

4 replies to this topic
ReyEspada45
  • ReyEspada45

    Player Hater

  • Members
  • Joined: 16 Apr 2013

#1

Posted 19 April 2013 - 06:16 PM

Hi, I want to make a panel or menu window, and I know which opcodes I have to use, but I'd want to know how to create a panel with my custom strings:

CODE

08D4: 1@ = create_panel_with_title 'IE09' position 29.0 170.0 width 180.0 columns 1 interactive 1 background 1 alignment 0


I've tried to change 'IE09' and put 'GHOST51', that is a string in a FXT, but it doesn't work, It just appears without any text, and I don't know if 'IE09' is a string in the GXT or another thing.

CODE

08DB: set_panel 1@ column 0 header 'PLA_19' data s$2518 s$2518 s$2518 s$2518 s$2518 s$2518 s$2518 s$2518 s$2518 s$2518 s$2518 s$2518


In this case It doesn't work neither, I've change 'PLA_19' and the string of s$2518 and put 'GHOST51', and the menu appears clear again


then, do these opcodes used to create a menu just use strings of the game and not of a FXT?

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#2

Posted 19 April 2013 - 06:28 PM

yes, IE09 is a string but it isn't the text which will be shown but an entry of american.gxt to allocate the associated text
works also with fxt
i assume you made something wrong with your fxt, so post it

ReyEspada45
  • ReyEspada45

    Player Hater

  • Members
  • Joined: 16 Apr 2013

#3

Posted 19 April 2013 - 06:45 PM

My FXT It's very large, so I post the three last lines:


CODE

GHOST49 Here you can start the misions
GHOST50 You have killed him, Mission Failed
GHOST51 Missions


Maybe there's a specific way to use these opcodes with a FXT, or declare a s$ or @s with the value of this string or its ID, I don't know how to make it work confused.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#4

Posted 19 April 2013 - 07:50 PM

QUOTE (ReyEspada45 @ Friday, Apr 19 2013, 19:45)
My FXT It's very large, so I post the three last lines:


CODE

GHOST49 Here you can start the misions
GHOST50 You have killed him, Mission Failed
GHOST51 Missions


Maybe there's a specific way to use these opcodes with a FXT, or declare a s$ or @s with the value of this string or its ID, I don't know how to make it work  confused.gif

looks good so far, i assume you know the rules: max. 7 chars for the fxt entry, only 1 space between the fxt entry and the text, only 1 space between words (charackters)
NO space at the end of a line
basicly, it's easy to show text with fxt, also inside of panels
test this if it works:
CODE
{$CLEO .cs}
03A4: name_thread 'FXT'
wait 2000
00BA: text_styled 'GHOST51'  1000 ms  4
wait 1000
03E5: show_text_box 'GHOST51'
wait 1000
00BB: show_text_lowpriority GXT 'GHOST51' time 1000 flag 1
wait 1000
08D4: 1@ = create_panel_with_title 'GHOST51' position 29.0 170.0 width 180.0 columns 1 interactive 1 background 1 alignment 0
wait 3000
08DA: remove_panel 1@
wait 1000
05AA: 0@s = 'GHOST51'// 0@ and 1@ are reserverd for  'GHOST51'
00BB: show_text_lowpriority GXT 0@s time 2000 flag 1
0A93: end_custom_thread

if this script shows your text correct, then post your whole panel script

if the text will not be shown: could you ever display any text of a fxt file?




you can declare local vars with 05AA: and the expresion @s and use it then in text opcodes
CODE
05AA: 0@s = 'GHOST51'
00BB: show_text_lowpriority GXT 0@s time 2000 flag 1

it needs to reserve 2 locals

this doesn't work:
CODE
05AA: 0@s = 'GHOST51'// 0@ and 1@ are reserverd for  'GHOST51'
1@ = 0// this corrupts the content of 0@s
00BB: show_text_lowpriority GXT 0@s time 2000 flag 1

this works:
CODE
05AA: 0@s = 'GHOST51'// 0@ and 1@ are reserverd for  'GHOST51'
2@ = 0
00BB: show_text_lowpriority GXT 0@s time 2000 flag 1



ReyEspada45
  • ReyEspada45

    Player Hater

  • Members
  • Joined: 16 Apr 2013

#5

Posted 19 April 2013 - 08:11 PM

wow ZAZ thank you very much, it worked biggrin.gif , maybe I forgot something confused.gif , and well this is the code:

CODE

{$VERSION 3.1.0027}
{$CLEO .CS}

//-------------MAIN---------------
thread "BASE"

:BASE_8
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @BASE_8
if
 $ONMISSION == 0
jf @BASE_8
if
00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 681.565 -533.701 16.1875 radius 5.0 5.0 5.0
jf @BASE_8
wait 1000
03E5: show_text_box 'GHOST51'
wait 1000
00BB: show_text_lowpriority GXT 'GHOST51' time 1000 flag 1
08D4: 1@ = create_panel_with_title 'GHOST51' position 29.0 170.0 width 180.0 columns 1 interactive 1 background 1 alignment 0
08DB: set_panel 1@ column 0 header 'GHOST51' data 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51' 'GHOST51'
0A93: end_custom_thread



that's not the whole code, It's just a test script, I'll use these opcodes in other script that I haven't written confused.gif , thank you colgate.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users