Help needed, dialog

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Help needed, dialog

Post by rylleman »

I've been pulling my hair for quite some time now trying to figure out whats wrong.
I've got a dialog in my script that won't show. I've checked a lot of other scripts with dialogs and the one in my script is working just like those but it won't show.
I also have a bit of trouble with return values from the LM.GUI.ALERT_WARNING at line 128, I don't think I'm using the right code there.
Could both problems be related?
Any help would be very appriciated!

the script

-david
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Ok, I've solved the first issue. Don't know what was wrong, I rewrote the whole dialog code from scratch and now it works.
But the ALERT_WARNING still doesn't work.

LM.GUI.ALERT_WARNING issue:
In the Scripting reference LM states "After the user clicks a button in the laert box, the function returns 0, 1, or 2, depending if the user pressed button 1, 2, or 3."
But I cant find anything on how to use those values, nor can I find any script using more than one button.

the code I have is;
LM.GUI.Alert(LM.GUI.ALERT_WARNING, "Warning text", "warning line 2", nil, "OK", "CANCEL", nil)

if LM.GUI.ALERT_WARNING == 0 then

print ("ok")

elseif LM.GUI.ALERT_WARNING == 1 then

print ("cncl")

break

end
This is obviously not the right code. How should it look?

-david
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Never mind, I figured it out myself.
User avatar
Rai López
Posts: 2294
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...SORRY! :( If I could I'd help you in this kind of issues, but I only can say you: GOOD LUCK & CHEER UP! :D (sorry...)
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

No problem Ramón!, I like you anyway... :wink:
I finally managed to get it right and has posted the script in its own thread, Random Switches. Enjoy!
User avatar
Rai López
Posts: 2294
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Jaja... :oops: THANK YOU! :D :D :D ...YOU TOO!!! :wink: I can't wait to try it! BYE!
User avatar
mr. blaaa
Posts: 622
Joined: Sun Jul 31, 2005 12:41 am
Location: ---
Contact:

Post by mr. blaaa »

Well, i'd really like to help but this seems to be some lua internal commands.
And my skills in lua arent very good :roll:

But i can make you an Operation Flashpoint map with tons of scripts and dialogues if you wish (Who the hell here needs OFP maps???) :wink:

BTW: What exactly will your script do?
Image
Post Reply