Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-28-2009, 01:51 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
GUI textlist problem.

I'm a bit new to GS2, but i managed to make a GUI that pops up, gives the player a list of options, which the player clicks, then clicks the button that applies the selection and closes the window.

Inside the script telling the apply button to check what was selected, i basically use the following setup:
if(){}
else if () {}
else if () {}
else if () {}
etc.

however, it seems that no matter what i select, it always chooses whatever the last if(){} on the list was.

for examle If the setup is the following:
if(){}//line 1
if(){}//line 2
if(){}//line 3
if(){}//line 4

then whatever i select will be whatever is on line 4.

HOWEVER, if the setup is like this:
if(){}//line 1
else if(){}//line 2
else if(){}//line 3
else if(){}//line 4

then no matter what option is chosen, the NPC will always use whatever is on line 1.

has the "else" feature changed in GS2 or something?

EDIT: Maybe "GUI textlist problem" was the wrong name to call the thread, but any help would still be greatly appreciated.
Reply With Quote
 


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 11:39 AM.


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