Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-06-2006, 12:04 AM
talkingnoodle talkingnoodle is offline
Rapidwolve
talkingnoodle's Avatar
Join Date: Nov 2005
Location: Leominster, MA
Posts: 229
talkingnoodle is on a distinguished road
Send a message via AIM to talkingnoodle Send a message via MSN to talkingnoodle
Help!

NPC Code:

function Button_2.onAction() {
Main_Window.destroy();
player.chat = "Started Event: " @ List_1.getselectedtext();
}



im using GuiPopUpMenuCtrl(List_1) and I want it to set my chat to what my option was, but instead it is saying 'Started Event: 0' instead of 'Started Event: <event>'

Last edited by talkingnoodle; 01-06-2006 at 02:54 PM..
Reply With Quote
  #2  
Old 01-06-2006, 12:22 AM
Kronan Kronan is offline
yo
Kronan's Avatar
Join Date: May 2001
Location: Florida, USA
Posts: 682
Kronan is on a distinguished road
Send a message via ICQ to Kronan Send a message via AIM to Kronan Send a message via Yahoo to Kronan
I don't quite understand why you deleted your thread from the GS2 forum, that was in the CORRECT forum for this question. But here is what I had posted there.

Your problem is because you're using getselectedtext(). That does not do what you want it to do. You want to be using gettext().

http://wiki.graal.us/GScript - Please use this, it can be your best friend when you need to look something up.

I took this right from the wiki:

Quote:
GuiButtonBaseCtrl (GuiControl):
buttontype - string
checked - boolean
groupnum - integer
text - string
gettext() - returns string
performclick()
settext(str)
__________________
Reply With Quote
  #3  
Old 01-06-2006, 01:19 AM
talkingnoodle talkingnoodle is offline
Rapidwolve
talkingnoodle's Avatar
Join Date: Nov 2005
Location: Leominster, MA
Posts: 229
talkingnoodle is on a distinguished road
Send a message via AIM to talkingnoodle Send a message via MSN to talkingnoodle
yes but im not looking for button...im using the popupctrl and gettext() doesnt work either :/
Reply With Quote
  #4  
Old 01-06-2006, 01:26 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Kronan: He is correct in using getselectedtext() to retrieve the value.

The problem may also be that you are destroying the main window, before you are attempting to read the text from it.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 01-06-2006, 01:28 AM
talkingnoodle talkingnoodle is offline
Rapidwolve
talkingnoodle's Avatar
Join Date: Nov 2005
Location: Leominster, MA
Posts: 229
talkingnoodle is on a distinguished road
Send a message via AIM to talkingnoodle Send a message via MSN to talkingnoodle
that doesnt work either...ive tried everything :/
Reply With Quote
  #6  
Old 01-09-2006, 03:44 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
This should work:
PHP Code:
function Button_2.onAction() {
  
player.chat "Started Event: " List_1.text;
  
Main_Window.destroy();

You must get the text first, before you destroy the window and its subcontrols. "text" and "getSelectedTex()" should give the same values, "getSelectedText()" is mainly for backwards compatibility. If you still don't get the text, then "List_1" is eventually not the correct name of the popup control.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.